Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 23, 2024
1 parent 7a397c9 commit 0ead3e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ assert.string(2);
//=> Error: Expected value which is `string`, received value of type `number`.
```

Most assertions also support an optional custom error message.
Assertions (except `assertAll` and `assertAny`) also support an optional custom error message.

```js
import {assert} from '@sindresorhus/is';

assert.nonEmptyString(process.env.API_URL, 'API_URL env variable is required.');
//=> Error: API_URL env variable is required.
assert.nonEmptyString(process.env.API_URL, 'The API_URL environment variable is required.');
//=> Error: The API_URL environment variable is required.
```

And with TypeScript:
Expand Down

0 comments on commit 0ead3e6

Please sign in to comment.