@axi-engine/utils 0.2.2 → 0.2.3

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
@@ -127,11 +127,11 @@ declare function getRandomElement<T>(array: T[]): T | undefined;
127
127
 
128
128
  /**
129
129
  * Throws an error if the condition is true.
130
- * @param conditionForThrow - If true, an error will be thrown.
130
+ * @param condition - If true, an error will be thrown.
131
131
  * @param exceptionMessage - The message for the error.
132
132
  * @throws {Error} if the value is true
133
133
  */
134
- declare function throwIf(conditionForThrow: boolean, exceptionMessage: string): void | never;
134
+ declare function throwIf(condition: boolean, exceptionMessage: string): asserts condition is false;
135
135
  /**
136
136
  * Throws an error if the value is null, undefined, or an empty array.
137
137
  *
package/dist/index.d.ts CHANGED
@@ -127,11 +127,11 @@ declare function getRandomElement<T>(array: T[]): T | undefined;
127
127
 
128
128
  /**
129
129
  * Throws an error if the condition is true.
130
- * @param conditionForThrow - If true, an error will be thrown.
130
+ * @param condition - If true, an error will be thrown.
131
131
  * @param exceptionMessage - The message for the error.
132
132
  * @throws {Error} if the value is true
133
133
  */
134
- declare function throwIf(conditionForThrow: boolean, exceptionMessage: string): void | never;
134
+ declare function throwIf(condition: boolean, exceptionMessage: string): asserts condition is false;
135
135
  /**
136
136
  * Throws an error if the value is null, undefined, or an empty array.
137
137
  *
package/dist/index.js CHANGED
@@ -126,8 +126,8 @@ function isPercentageString(val) {
126
126
  }
127
127
 
128
128
  // src/assertion.ts
129
- function throwIf(conditionForThrow, exceptionMessage) {
130
- if (conditionForThrow) {
129
+ function throwIf(condition, exceptionMessage) {
130
+ if (condition) {
131
131
  throw new Error(exceptionMessage);
132
132
  }
133
133
  }
package/dist/index.mjs CHANGED
@@ -72,8 +72,8 @@ function isPercentageString(val) {
72
72
  }
73
73
 
74
74
  // src/assertion.ts
75
- function throwIf(conditionForThrow, exceptionMessage) {
76
- if (conditionForThrow) {
75
+ function throwIf(condition, exceptionMessage) {
76
+ if (condition) {
77
77
  throw new Error(exceptionMessage);
78
78
  }
79
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axi-engine/utils",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
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": {