Releases: chharvey/extrajs
Releases · chharvey/extrajs
Release list
v0.27.0
Non-Breaking
New Classes
-
Stack
New Methods
- new method
xjs.Array.forEither- Executes a callback on each item of an array until that callback returns. (The “dual” of
xjs.Array.forEach)
- Executes a callback on each item of an array until that callback returns. (The “dual” of
- rename
DeletableQueue->EditableQueueand add new methods:#promoteByIndex(index: number, slots?: number)#demoteByIndex(index: number, slots?: number)#promoteByIndexToStart(index: number)#demoteByIndexToEnd(index: number)#promote(item: T / predicate: (T) => boolean, slots?: number)#demote(item: T / predicate: (T) => boolean, slots?: number)#promoteToStart(item: T / predicate: (T) => boolean)#demoteToEnd(item: T / predicate: (T) => boolean)
New Features
-
xjs.Map.teenow allows a comparator predicate for key equalityxjs.Map.tee(my_map, my_key, my_value, (key1, key2) => Object.is(key1, key2));
Fixes
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.iswasn’t using the comparison predicates
v0.25.0
- new Array static methods:
-
xjs_Array.forEachAggregated: like.forEachbut catches and aggregates errors, and runs until the end of the array -
xjs_Array.mapAggregated: like.mapbut 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’sesModuleInteropis 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}.assertTypetake a member of enumNumericTypeas 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