chore: added nonEmptyStringAndNotWhitespace
This commit is contained in:
parent
04ccf21dba
commit
3a9761d4af
3 changed files with 34 additions and 0 deletions
11
readme.md
11
readme.md
|
|
@ -245,6 +245,17 @@ Returns `true` if the value is a `string` and the `.length` is 0.
|
|||
|
||||
Returns `true` if the value is a `string` and the `.length` is more than 0.
|
||||
|
||||
##### .nonEmptyStringAndNotWhitespace(value)
|
||||
|
||||
Returns `true` if `is.emptyString(value)` and if it's a `string` that is not a whitespace.
|
||||
|
||||
```js
|
||||
const values = ['property1', '', null, 'property2', ' ', undefined, , ,]
|
||||
|
||||
values.filter(is.nonEmptyStringAndNotWhitespace)
|
||||
//=> (2) ['property1', 'property2']
|
||||
```
|
||||
|
||||
##### .emptyStringOrWhitespace(value)
|
||||
|
||||
Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue