-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
isPlainObject
type guard (#16)
* feat: add `isPlainObject` type guard * docs: add isPlainObject
- Loading branch information
1 parent
0e3a83a
commit ddae618
Showing
4 changed files
with
59 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: isPlainObject | ||
description: 'Determine if a value is a plain object' | ||
group: Typed | ||
--- | ||
|
||
## Basic usage | ||
|
||
Pass in a value and get a boolean telling you if the value is a plain object. | ||
|
||
```ts | ||
import { isPlainObject } from 'radash' | ||
|
||
isPlainObject({}) // => true | ||
isPlainObject(Object.create(null)) // => true | ||
|
||
isPlainObject([]) // => false | ||
isPlainObject(null) // => false | ||
isPlainObject(new Date()) // => 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 |
---|---|---|
|
@@ -96,6 +96,7 @@ export { | |
isIntString, | ||
isNumber, | ||
isObject, | ||
isPlainObject, | ||
isPrimitive, | ||
isPromise, | ||
isString, | ||
|
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