Skip to content

Commit ac06714

Browse files
committed
Merge branch 'assume'
2 parents a1009c0 + 291a2e8 commit ac06714

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ if (isLike({ foo: "", bar: 0 }, e)) {
9494
The `unknownutil` provides the following ensure functions which will raise
9595
`EnsureError` when a given `x` is not expected type.
9696

97+
- `ensure<T>(x: unknown, pred: Predicate<T>, message?: string): assert x is T`
9798
- `ensureString(x: unknown): assert x is string`
9899
- `ensureNumber(x: unknown): assert x is number`
99100
- `ensureBoolean(x: unknown): assert x is boolean`
@@ -150,6 +151,7 @@ ensureLike({ foo: "", bar: 0 }, b); // Now 'b' is '{foo: string, bar: number}'
150151
The `unknownutil` provides the following assume functions which returns a given
151152
`x` as is or raise `EnsureError` when that is not expected type.
152153

154+
- `assume<T>(x: unknown, pred: Predicate<T>, message?: string): T`
153155
- `assumeString(x: unknown): string`
154156
- `assumeNumber(x: unknown): number`
155157
- `assumeBoolean(x: unknown): boolean`

0 commit comments

Comments
 (0)