Skip to content

Releases: chharvey/extrajs

v0.26.0

11 Apr 02:57
Compare
Choose a tag to compare

Breaking

  • require Node v18+
  • remove string parameters from {BigInt,Number}#assertType

Non-Breaking

  • using eslint internally
  • new method xjs.Map.forEachAggregated, analogous to xjs.Array.forEachAggregated
  • refactor some methods to improve safety

New Data Structures

  • LinkedList
  • Queue
  • Max Binary Heap

Fixes

  • fix issue where xjs.Map.is wasn’t using the comparison predicates

v0.25.0

10 Jul 23:49
Compare
Choose a tag to compare
  • new Array static methods:
    • xjs_Array.forEachAggregated: like .forEach but catches and aggregates errors, and runs until the end of the array
    • xjs_Array.mapAggregated: like .map but catches and aggregates errors, and runs until the end of the array
  • new Set static methods:
    • xjs_Set.has
    • xjs_Set.add
    • xjs_Set.delete
  • new Map static methods:
    • xjs_Map.has
    • xjs_Map.get
    • xjs_Map.set
    • xjs_Map.delete
  • updated Set static methods, taking optional comparator parameter:
    • xjs_Set.union
    • xjs_Set.intersection
    • xjs_Set.difference
    • xjs_Set.symmetricDifference
  • node v16+ required

v0.24.1

23 Jun 05:22
Compare
Choose a tag to compare
  • upgrade deps & address security vulns

v0.24.0

04 Jul 04:39
Compare
Choose a tag to compare

Fixes

  • fix issue where constructing a MapEq with multiple entries would result in an error
  • fix type-checking of tests

O/M

  • update deps
  • add more MapEq tests

New Features

  • add MapEq#delete

v0.23.1

10 Jun 01:47
Compare
Choose a tag to compare
  • convert gulp scripts to npm scripts
  • update build output
  • update dependencies
  • node v14+ required

Important:
The peerDependency of typescript >= 3.8.0 has been removed, so if you’re using TypeScript in your project, you can use lower versions. However, TS files in this project use features in 4.3+, for example, import type ... and the override keyword. This means in your tsconfig you should set:

"compilerOptions": {
  ...
  "skipLibCheck": true
}

v0.23.0

10 Jun 02:09
Compare
Choose a tag to compare

DEPRECATED

critical fix in v0.23.1

v0.22.0

02 May 17:09
Compare
Choose a tag to compare
  • add template literal tag function xjs.String.dedent
  • add xjs.Map.tee
  • new class MapEq — uses a custom comparator function to determine unique keys
  • update deps
  • reorganize package.json, adding "files" field

v0.21.1

08 Aug 02:46
Compare
Choose a tag to compare

v0.21.0

19 Apr 06:15
Compare
Choose a tag to compare

Breaking

  • type-only imports (import type …)
  • add support for new native primitive type bigint (Requires "target": "ES2020" or later in tsconfig):
    • xjs.Object.typeOf
    • xjs.BigInt.assertType
    • xjs.Math.mod
    • xjs.Math.minBigInt
    • xjs.Math.maxBigInt
    • xjs.Math.clampBigInt

Non-Breaking

  • new enum NumericType, describing types of numbers. Members include INTEGER, POSITIVE, FINITE, etc.
  • the methods xjs.{Number,BigInt}.assertType take a member of enum NumericType as its second parameter. Strings are still allowed, but deprecated: a warning will be logged to the console.
    xjs.Number.assertType(42, 'integer'); // before (will log a warning)
    xjs.Number.assertType(42, NumericType.INTEGER); // after
  • update dependencies, including TypeScript v3.8.x
  • all-new testing system with Mocha
  • replace jsdoc @param <T> with @typeparam T
  • fixup 713b865 for Map

v0.20.0

29 Feb 05:37
Compare
Choose a tag to compare
  • 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