Skip to content

Commit

Permalink
Named exports
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Aug 2, 2023
1 parent bd5dfda commit cffdb4a
Show file tree
Hide file tree
Showing 4 changed files with 1,252 additions and 408 deletions.
16 changes: 9 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ All the below methods accept a value and returns a boolean for whether the value
##### .undefined(value)
##### .null(value)

**Note:** TypeScript users must use `.null_()` because of a TypeScript naming limitation.

##### .string(value)
##### .number(value)

Expand All @@ -107,8 +105,6 @@ is.array(value, is.number); // Validate `value` is an array and all of its items

##### .function(value)

**Note:** TypeScript users must use `.function_()` because of a TypeScript naming limitation.

##### .buffer(value)
##### .blob(value)
##### .object(value)
Expand Down Expand Up @@ -391,8 +387,6 @@ An object is plain if it's created by either `{}`, `new Object()`, or `Object.cr

Returns `true` for instances created by a class.

**Note:** TypeScript users must use `.class_()` because of a TypeScript naming limitation.

##### .typedArray(value)

##### .arrayLike(value)
Expand Down Expand Up @@ -458,7 +452,7 @@ is.inRange(3, 10);

##### .domElement(value)

Returns `true` if `value` is a DOM Element.
Returns `true` if `value` is an [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).

##### .nodeStream(value)

Expand Down Expand Up @@ -554,6 +548,14 @@ is.all(is.string, '🦄', [], 'unicorns');
//=> false
```

##### .validLength(value)

Returns `true` if the value is a safe integer that is greater than or equal to zero

##### .whitespaceString(value)

Returns `true` if the value is a string with only whitespace characters

## Type guards

When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used extensively to infer the correct type inside if-else statements.
Expand Down
Loading

0 comments on commit cffdb4a

Please sign in to comment.