Added is.enumCase and assert.enumCase
This commit is contained in:
parent
f5cc764e22
commit
effc01e747
3 changed files with 37 additions and 0 deletions
17
readme.md
17
readme.md
|
|
@ -212,6 +212,23 @@ is.boundFunction(function () {});
|
|||
##### .sharedArrayBuffer(value)
|
||||
##### .dataView(value)
|
||||
|
||||
##### .enumCase(value, enum)
|
||||
|
||||
Returns `true` if `value` is a member of `enum`.
|
||||
|
||||
```ts
|
||||
enum EnumDirection {
|
||||
Asc = 'asc',
|
||||
Desc = 'desc'
|
||||
}
|
||||
|
||||
is.enumCase('asc', EnumDirection);
|
||||
//=> true
|
||||
|
||||
is.enumCase('other', EnumDirection);
|
||||
//=> false
|
||||
```
|
||||
|
||||
#### Emptiness
|
||||
|
||||
##### .emptyString(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue