@x-oasis/null-throw 0.1.12
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/README.md +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/null-throw.cjs.development.js +13 -0
- package/dist/null-throw.cjs.development.js.map +1 -0
- package/dist/null-throw.cjs.production.min.js +2 -0
- package/dist/null-throw.cjs.production.min.js.map +1 -0
- package/dist/null-throw.esm.js +9 -0
- package/dist/null-throw.esm.js.map +1 -0
- package/package.json +19 -0
- package/src/index.ts +9 -0
- package/test/test.spec.ts +5 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +7 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function <T>(x: T): T;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function index (x) {
|
|
6
|
+
if (x != null) {
|
|
7
|
+
return x;
|
|
8
|
+
}
|
|
9
|
+
throw new Error('Got unexpected null or undefined');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.default = index;
|
|
13
|
+
//# sourceMappingURL=null-throw.cjs.development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null-throw.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["// https://github.com/zertosh/nullthrows\n// https://github.com/expo/nullthrows/blob/main/src/nullthrows.ts\n\nexport default function <T>(x: T): T {\n if (x != null) {\n return x;\n }\n throw new Error('Got unexpected null or undefined');\n}\n"],"names":["x","Error"],"mappings":";;;;gBAG4BA,CAAI;EAC9B,IAAIA,CAAC,IAAI,IAAI,EAAE;IACb,OAAOA,CAAC;;EAEV,MAAM,IAAIC,KAAK,CAAC,kCAAkC,CAAC;AACrD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null-throw.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["// https://github.com/zertosh/nullthrows\n// https://github.com/expo/nullthrows/blob/main/src/nullthrows.ts\n\nexport default function <T>(x: T): T {\n if (x != null) {\n return x;\n }\n throw new Error('Got unexpected null or undefined');\n}\n"],"names":["x","Error"],"mappings":"6FAG4BA,GAC1B,GAAS,MAALA,EACF,OAAOA,EAET,MAAM,IAAIC,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null-throw.esm.js","sources":["../src/index.ts"],"sourcesContent":["// https://github.com/zertosh/nullthrows\n// https://github.com/expo/nullthrows/blob/main/src/nullthrows.ts\n\nexport default function <T>(x: T): T {\n if (x != null) {\n return x;\n }\n throw new Error('Got unexpected null or undefined');\n}\n"],"names":["x","Error"],"mappings":"gBAG4BA,CAAI;EAC9B,IAAIA,CAAC,IAAI,IAAI,EAAE;IACb,OAAOA,CAAC;;EAEV,MAAM,IAAIC,KAAK,CAAC,kCAAkC,CAAC;AACrD;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@x-oasis/null-throw",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "null-throw function",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"module": "dist/null-throw.esm.js",
|
|
8
|
+
"author": "",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"tsdx": "^0.14.1"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsdx build --tsconfig tsconfig.build.json",
|
|
15
|
+
"clean": "rimraf ./dist",
|
|
16
|
+
"test": "vitest",
|
|
17
|
+
"compile": "tsc -p tsconfig.build.json"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/index.ts
ADDED