Skip to content

Commit

Permalink
chore: consistent typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JUSTIVE committed Jun 5, 2024
1 parent 002034d commit 8527727
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,13 @@ const minLength = <const min extends number>(min: min) =>
when((value) => isString(value) && value.length >= min);

/**
* `P.string.length(len)` is a pattern, matching **strings** with at exact `len` characters.
* `P.string.length(len)` is a pattern, matching **strings** with exact `len` characters.
*
* [Read the documentation for `P.string.length` on GitHub](https://github.com/gvergnaud/ts-pattern#pstringlength)
*
* @example
* match(value)
* .with(P.string.minLength(10), () => 'string with more length >= 10')
* .with(P.string.length(10), () => 'strings with length === 10')
*/
const length = <const len extends number>(len: len) =>
when((value) => isString(value) && value.length === len);
Expand Down
4 changes: 2 additions & 2 deletions src/types/Pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,13 @@ export type StringChainable<
omitted | 'minLength'
>;
/**
* `P.string.length(len)` is a pattern, matching **strings** with at exact `len` characters.
* `P.string.length(len)` is a pattern, matching **strings** with exact `len` characters.
*
* [Read the documentation for `P.string.length` on GitHub](https://github.com/gvergnaud/ts-pattern#pstringlength)
*
* @example
* match(value)
* .with(P.string.length(10), () => 'string with exact length === 10')
* .with(P.string.length(10), () => 'strings with length === 10')
*/
length<input, const len extends number>(
len: len
Expand Down
1 change: 1 addition & 0 deletions tests/strings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe('Strings', () => {
});

expect(f('aa')).toBe('yes');
expect(f('bb')).toBe('yes');
expect(f('aaa')).toBe('no');
expect(f('a')).toBe('no');
});
Expand Down

0 comments on commit 8527727

Please sign in to comment.