Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jul 21, 2023
1 parent a04c656 commit 5d8dc37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,19 @@ 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();
```

Expand Down

0 comments on commit 5d8dc37

Please sign in to comment.