-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(kitify): Enhance DOM and add type docs
- Loading branch information
Showing
3 changed files
with
39 additions
and
10 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 |
---|---|---|
@@ -1 +1,31 @@ | ||
# type | ||
|
||
Provides some methods for interpreting data types. | ||
|
||
提供一些判读数据类型的方法。 | ||
|
||
```ts | ||
import { isType, isObject, isFunction } from 'kitify' | ||
// or | ||
import { isType, isObject, isFunction } from 'kitify/type' | ||
|
||
isObject({}) // true | ||
isFunction(() => {})) // true | ||
isType(123) // number | ||
isType('hello', 'string') // true | ||
``` | ||
|
||
## isType | ||
|
||
```ts | ||
function isType(value: any, type?: string): string | boolean | ||
``` | ||
|
||
**examples:** | ||
|
||
```ts | ||
isType(123) // number | ||
isType(new Date()) // date | ||
isType('hello', 'string') // true | ||
isType('hello', 'number') // 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