Skip to content

v5.2.0

Latest
Compare
Choose a tag to compare
@gvergnaud gvergnaud released this 12 Jun 12:32
· 3 commits to main since this release

The main thing

new P.string.length(n) pattern

P.string.length(len) matches strings with exactly len characters.

const fn = (input: string) =>
  match(input)
    .with(P.string.length(2), () => '馃帀')
    .otherwise(() => '鉂');

console.log(fn('ok')); // logs '馃帀'

What's Changed

New Contributors

Full Changelog: v5.1.2...v5.2.0