v0.20.0
- DEPRECATE xjs.Object.switch and use native Map
instead of:use:xjs.Object.switch<number>('A', { 'A': () => 65, 'B': () => 66, 'C': () => 67, })() // returns 65
new Map<string, () => number>([ ['A', () => 65], ['B', () => 66], ['C', () => 67], ]).get('A')() // returns 65
-
{Array,Set}.is
now check for SameValueZero-ness before checking the given predicate, if any. That means you don’t have to manually check yourself in the predicate if you provide one.will testxjs.Array.is([65, 66, 67], ['65', '66', '67'], (a, b) => a == b)
a === b || Object.is(a, b)
(the SameValueZero algorithm) first, before checkinga == b
as given in the predicate. - upgrade to TypeScript v3.7.x