Skip to content

Commit 494ddba

Browse files
committed
feat: export assert, DEV, and validators
1 parent 1eae338 commit 494ddba

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ New entries must be placed in a section entitled `Unreleased`.
3232
bare.writeFixedString(bc, "bare")
3333
```
3434

35+
- Export `assert`, `DEV` and integer validators
36+
37+
`@bare-ts/lib` now exports an `assert` function and integer validators such as `isI32`.
38+
We plan to use these functions in a future version of `@bare-ts/tools`.
39+
40+
The library also exports a `DEV` constant that is `true` if the `development` condition is passed,
41+
or if `NODE_ENV` is set to `development` under the `node` condition.
42+
Use the Node's CLI option [`--conditions`](https://nodejs.org/api/packages.html#resolving-user-conditions) to pass the `development` condition.
43+
44+
These functions should only be used for validating arguments of BARE decoders and encoders.
45+
3546
## 0.5.0 (2025-11-10)
3647

3748
- BREAKING CHANGES: require TypeScript 5.7 or above

‎src/index.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ export * from "./codec/uint.ts"
2121
export * from "./core/bare-error.ts"
2222
export * from "./core/byte-cursor.ts"
2323
export * from "./core/config.ts"
24+
25+
export * from "./util/assert.ts"
26+
export * from "./util/validator.ts"

0 commit comments

Comments
 (0)