Releases: chharvey/extrajs
Releases · chharvey/extrajs
v0.26.0
Breaking
- require Node v18+
- remove string parameters from
{BigInt,Number}#assertType
Non-Breaking
- using eslint internally
- new method
xjs.Map.forEachAggregated
, analogous toxjs.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
- 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
v0.24.0
v0.23.1
- 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
v0.22.0
v0.21.1
- use Node’s
assert.ok()
instead ofassert()
— useful when TypeScript’sesModuleInterop
is set totrue
. - update dependencies
v0.21.0
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 includeINTEGER
,POSITIVE
,FINITE
, etc. - the methods
xjs.{Number,BigInt}.assertType
take a member of enumNumericType
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
- 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