-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b5deb0
commit 9bef6c5
Showing
55 changed files
with
143 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
section.section | ||
header.section__header | ||
h3#method-isTruly.section__h3 isTruly(val) | ||
div.section__content | ||
dl.section__dl | ||
dt.section__dt Since: | ||
dd.section__dd 2.8.0 | ||
h4.section__h4 Description | ||
p isTruly(val) 方法用来检测测试数据是否为在布尔上下文中被视为 true 的值。 | ||
h4.section__h4 Parameters | ||
h5.section__h4 val | ||
dl.section__dl | ||
dt.section__dt Type: | ||
dd.section__dd Any | ||
p (必须)val 待检测的数据。 | ||
h4.section__h4 Returns | ||
dl.section__dl | ||
dt.section__dt Type: | ||
dd.section__dd String。 | ||
p 'val' 在布尔上下文中被视为 true 的值,返回 true,否则返回 false。 | ||
pre.section__pre | ||
code.section__code. | ||
import Types from '@yaohaixiao/types.js' | ||
// 或者单独引用 isTruly() 方法 | ||
// import isTruly from '@yaohaixiao/types.js/isTruly' | ||
|
||
Types.isTruly(true); // -> true | ||
Types.isTruly(1); // -> true | ||
Types.isTruly("hello"); // -> true | ||
Types.isTruly({}); // -> true | ||
Types.isTruly([]); // -> true | ||
|
||
Types.isTruly(false); // -> false | ||
Types.isTruly(0); // -> false | ||
Types.isTruly(''); // -> false | ||
Types.isTruly(null); // -> false | ||
Types.isTruly(undefined); // -> false | ||
Types.isTruly(NaN); // -> false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ section.section | |
include ./is | ||
include ./isFalsy | ||
include ./isNil | ||
include ./isTruly | ||
include ./isValue |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.