Add Type tests

This commit is contained in:
Tal Mac 2023-07-22 02:02:37 +03:00
parent a04c656ec7
commit b12fcef980
2 changed files with 46 additions and 2 deletions

View file

@ -415,15 +415,18 @@ foo();
A `value` is tuple-like if it matches the provided `guards` array both in `.length` and in types.
```js
is.tupleLike([1],[is.number]);
is.tupleLike([1], [is.number]);
//=> true
```
```js
function foo() {
const tuple = [1, '2', true]
const tuple = [1, '2', true];
if (is.tupleLike(tuple, [is.number, is.string, is.boolean])) {
tuple // [number, string, boolean]
}
}
foo();
```