Skip to content

Commit 42505ca

Browse files
Add validity in readme
1 parent c87c456 commit 42505ca

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ const ulid = monotonicFactory(() => Math.random());
107107
ulid(); // 01BXAVRG61YJ5YSBRM51702F6M
108108
```
109109

110+
### Validity
111+
112+
You can verify if a value is a valid ULID by using `isValid`:
113+
114+
```typescript
115+
import { isValid } from "ulid";
116+
117+
isValid("01ARYZ6S41TSV4RRFFQ69G5FAV"); // true
118+
isValid("01ARYZ6S41TSV4RRFFQ69G5FA"); // false
119+
```
120+
110121
### Tests
111122

112123
Install dependencies using `npm install` first, and then simply run `npm test` to run the test suite.

0 commit comments

Comments
 (0)