@typescript-eslint/experimental-utils 5.8.1 → 5.8.2-alpha.6
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/eslint-utils/index.d.ts +1 -0
- package/dist/eslint-utils/index.d.ts.map +1 -1
- package/dist/eslint-utils/index.js +1 -0
- package/dist/eslint-utils/index.js.map +1 -1
- package/dist/eslint-utils/nullThrows.d.ts +14 -0
- package/dist/eslint-utils/nullThrows.d.ts.map +1 -0
- package/dist/eslint-utils/nullThrows.js +28 -0
- package/dist/eslint-utils/nullThrows.js.map +1 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -17,4 +17,5 @@ __exportStar(require("./InferTypesFromRule"), exports);
|
|
|
17
17
|
__exportStar(require("./RuleCreator"), exports);
|
|
18
18
|
__exportStar(require("./RuleTester"), exports);
|
|
19
19
|
__exportStar(require("./deepMerge"), exports);
|
|
20
|
+
__exportStar(require("./nullThrows"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A set of common reasons for calling nullThrows
|
|
3
|
+
*/
|
|
4
|
+
declare const NullThrowsReasons: {
|
|
5
|
+
readonly MissingParent: "Expected node to have a parent.";
|
|
6
|
+
readonly MissingToken: (token: string, thing: string) => string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Assert that a value must not be null or undefined.
|
|
10
|
+
* This is a nice explicit alternative to the non-null assertion operator.
|
|
11
|
+
*/
|
|
12
|
+
declare function nullThrows<T>(value: T | null | undefined, message: string): T;
|
|
13
|
+
export { nullThrows, NullThrowsReasons };
|
|
14
|
+
//# sourceMappingURL=nullThrows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullThrows.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/nullThrows.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,iBAAiB;;mCAEC,MAAM,SAAS,MAAM;CAEnC,CAAC;AAEX;;;GAGG;AACH,iBAAS,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAYtE;AAED,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NullThrowsReasons = exports.nullThrows = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A set of common reasons for calling nullThrows
|
|
6
|
+
*/
|
|
7
|
+
const NullThrowsReasons = {
|
|
8
|
+
MissingParent: 'Expected node to have a parent.',
|
|
9
|
+
MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
|
|
10
|
+
};
|
|
11
|
+
exports.NullThrowsReasons = NullThrowsReasons;
|
|
12
|
+
/**
|
|
13
|
+
* Assert that a value must not be null or undefined.
|
|
14
|
+
* This is a nice explicit alternative to the non-null assertion operator.
|
|
15
|
+
*/
|
|
16
|
+
function nullThrows(value, message) {
|
|
17
|
+
// this function is primarily used to keep types happy in a safe way
|
|
18
|
+
// i.e. is used when we expect that a value is never nullish
|
|
19
|
+
// this means that it's pretty much impossible to test the below if...
|
|
20
|
+
// so ignore it in coverage metrics.
|
|
21
|
+
/* istanbul ignore if */
|
|
22
|
+
if (value === null || value === undefined) {
|
|
23
|
+
throw new Error(`Non-null Assertion Failed: ${message}`);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
exports.nullThrows = nullThrows;
|
|
28
|
+
//# sourceMappingURL=nullThrows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullThrows.js","sourceRoot":"","sources":["../../src/eslint-utils/nullThrows.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAC7C,sBAAsB,KAAK,YAAY,KAAK,GAAG;CACzC,CAAC;AAoBU,8CAAiB;AAlBtC;;;GAGG;AACH,SAAS,UAAU,CAAI,KAA2B,EAAE,OAAe;IACjE,oEAAoE;IACpE,4DAA4D;IAC5D,sEAAsE;IAEtE,oCAAoC;IACpC,wBAAwB;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;KAC1D;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAEQ,gCAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/experimental-utils",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.2-alpha.6+a9eb0b9e",
|
|
4
4
|
"description": "(Experimental) Utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@types/json-schema": "^7.0.9",
|
|
43
|
-
"@typescript-eslint/scope-manager": "5.8.
|
|
44
|
-
"@typescript-eslint/types": "5.8.
|
|
45
|
-
"@typescript-eslint/typescript-estree": "5.8.
|
|
43
|
+
"@typescript-eslint/scope-manager": "5.8.2-alpha.6+a9eb0b9e",
|
|
44
|
+
"@typescript-eslint/types": "5.8.2-alpha.6+a9eb0b9e",
|
|
45
|
+
"@typescript-eslint/typescript-estree": "5.8.2-alpha.6+a9eb0b9e",
|
|
46
46
|
"eslint-scope": "^5.1.1",
|
|
47
47
|
"eslint-utils": "^3.0.0"
|
|
48
48
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a9eb0b9eb2db291ea36065ec34f84bf5c5504b43"
|
|
67
67
|
}
|