@axi-engine/utils 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -155,6 +155,11 @@ declare function throwIf(condition: boolean, exceptionMessage: string): asserts
155
155
  * console.log('First item:', items[0]);
156
156
  */
157
157
  declare function throwIfEmpty<T>(value: T, exceptionMessage: string): asserts value is NonNullable<T>;
158
+ /**
159
+ * Throws an error unconditionally.
160
+ * @param message The message for the error.
161
+ */
162
+ declare function throwError(message: string): never;
158
163
 
159
164
  interface AxiEngineConfig {
160
165
  pathSeparator: string;
@@ -364,4 +369,4 @@ declare function randInt(min: number, max: number): number;
364
369
  */
365
370
  declare function randId(): string;
366
371
 
367
- export { type AxiEngineConfig, type Constructor, ConstructorRegistry, type DataSink, type DataSource, type DataStorage, Emitter, type PathType, type ScalarType, type Subscribable, areArraysEqual, axiSettings, clampNumber, configure, ensurePathArray, ensurePathString, firstKeyOf, genArray, getPercentOf, getRandomElement, haveSameElements, isBoolean, isNull, isNullOrUndefined, isNumber, isPercentageString, isScalar, isSequentialStart, isString, isUndefined, last, randId, randInt, shuffleArray, throwIf, throwIfEmpty, unique };
372
+ export { type AxiEngineConfig, type Constructor, ConstructorRegistry, type DataSink, type DataSource, type DataStorage, Emitter, type PathType, type ScalarType, type Subscribable, areArraysEqual, axiSettings, clampNumber, configure, ensurePathArray, ensurePathString, firstKeyOf, genArray, getPercentOf, getRandomElement, haveSameElements, isBoolean, isNull, isNullOrUndefined, isNumber, isPercentageString, isScalar, isSequentialStart, isString, isUndefined, last, randId, randInt, shuffleArray, throwError, throwIf, throwIfEmpty, unique };
package/dist/index.d.ts CHANGED
@@ -155,6 +155,11 @@ declare function throwIf(condition: boolean, exceptionMessage: string): asserts
155
155
  * console.log('First item:', items[0]);
156
156
  */
157
157
  declare function throwIfEmpty<T>(value: T, exceptionMessage: string): asserts value is NonNullable<T>;
158
+ /**
159
+ * Throws an error unconditionally.
160
+ * @param message The message for the error.
161
+ */
162
+ declare function throwError(message: string): never;
158
163
 
159
164
  interface AxiEngineConfig {
160
165
  pathSeparator: string;
@@ -364,4 +369,4 @@ declare function randInt(min: number, max: number): number;
364
369
  */
365
370
  declare function randId(): string;
366
371
 
367
- export { type AxiEngineConfig, type Constructor, ConstructorRegistry, type DataSink, type DataSource, type DataStorage, Emitter, type PathType, type ScalarType, type Subscribable, areArraysEqual, axiSettings, clampNumber, configure, ensurePathArray, ensurePathString, firstKeyOf, genArray, getPercentOf, getRandomElement, haveSameElements, isBoolean, isNull, isNullOrUndefined, isNumber, isPercentageString, isScalar, isSequentialStart, isString, isUndefined, last, randId, randInt, shuffleArray, throwIf, throwIfEmpty, unique };
372
+ export { type AxiEngineConfig, type Constructor, ConstructorRegistry, type DataSink, type DataSource, type DataStorage, Emitter, type PathType, type ScalarType, type Subscribable, areArraysEqual, axiSettings, clampNumber, configure, ensurePathArray, ensurePathString, firstKeyOf, genArray, getPercentOf, getRandomElement, haveSameElements, isBoolean, isNull, isNullOrUndefined, isNumber, isPercentageString, isScalar, isSequentialStart, isString, isUndefined, last, randId, randInt, shuffleArray, throwError, throwIf, throwIfEmpty, unique };
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ __export(index_exports, {
46
46
  randId: () => randId,
47
47
  randInt: () => randInt,
48
48
  shuffleArray: () => shuffleArray,
49
+ throwError: () => throwError,
49
50
  throwIf: () => throwIf,
50
51
  throwIfEmpty: () => throwIfEmpty,
51
52
  unique: () => unique
@@ -137,6 +138,9 @@ function throwIfEmpty(value, exceptionMessage) {
137
138
  throw new Error(exceptionMessage);
138
139
  }
139
140
  }
141
+ function throwError(message) {
142
+ throw new Error(message);
143
+ }
140
144
 
141
145
  // src/config.ts
142
146
  var defaultConfig = {
@@ -290,6 +294,7 @@ function randId() {
290
294
  randId,
291
295
  randInt,
292
296
  shuffleArray,
297
+ throwError,
293
298
  throwIf,
294
299
  throwIfEmpty,
295
300
  unique
package/dist/index.mjs CHANGED
@@ -83,6 +83,9 @@ function throwIfEmpty(value, exceptionMessage) {
83
83
  throw new Error(exceptionMessage);
84
84
  }
85
85
  }
86
+ function throwError(message) {
87
+ throw new Error(message);
88
+ }
86
89
 
87
90
  // src/config.ts
88
91
  var defaultConfig = {
@@ -235,6 +238,7 @@ export {
235
238
  randId,
236
239
  randInt,
237
240
  shuffleArray,
241
+ throwError,
238
242
  throwIf,
239
243
  throwIfEmpty,
240
244
  unique
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axi-engine/utils",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Core utility library for Axi Engine, providing common functions for arrays, math, type guards, and more.",
5
5
  "license": "MIT",
6
6
  "repository": {