@configura/web-utilities 1.6.1-alpha.0 → 1.6.1-alpha.1
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/assert.d.ts +13 -0
- package/dist/assert.js +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/assert.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @throws error with the supplied message, if the condition is not true.
|
|
3
|
+
*
|
|
4
|
+
* Can for example be used like a type guard in TypeScript.
|
|
5
|
+
*/
|
|
6
|
+
export declare function assert(condition: any, msg?: string): asserts condition;
|
|
7
|
+
/**
|
|
8
|
+
* @throws error with the supplied message, if the value === undefined.
|
|
9
|
+
*
|
|
10
|
+
* Can be used like a type guard in TypeScript.
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertDefined<T>(value: T, msg?: string): asserts value is Exclude<T, undefined>;
|
|
13
|
+
//# sourceMappingURL=assert.d.ts.map
|
package/dist/assert.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @throws error with the supplied message, if the condition is not true.
|
|
3
|
+
*
|
|
4
|
+
* Can for example be used like a type guard in TypeScript.
|
|
5
|
+
*/
|
|
6
|
+
export function assert(condition, msg) {
|
|
7
|
+
if (!condition) {
|
|
8
|
+
throw new Error(msg);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @throws error with the supplied message, if the value === undefined.
|
|
13
|
+
*
|
|
14
|
+
* Can be used like a type guard in TypeScript.
|
|
15
|
+
*/
|
|
16
|
+
export function assertDefined(value, msg) {
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
throw new Error(msg);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/web-utilities",
|
|
3
|
-
"version": "1.6.1-alpha.
|
|
3
|
+
"version": "1.6.1-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "afaf1e342f0648246a1dcb6f7bc636d4d1979bec"
|
|
26
26
|
}
|