Skip to content

v0.20.0

Compare
Choose a tag to compare
@chharvey chharvey released this 29 Feb 05:37
· 162 commits to master since this release
  • DEPRECATE xjs.Object.switch and use native Map
    instead of:
    xjs.Object.switch<number>('A', {
      'A': () => 65,
      'B': () => 66,
      'C': () => 67,
    })() // returns 65
    
    use:
    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.
    xjs.Array.is([65, 66, 67], ['65', '66', '67'], (a, b) => a == b)
    
    will test a === b || Object.is(a, b) (the SameValueZero algorithm) first, before checking a == b as given in the predicate.
  • upgrade to TypeScript v3.7.x