@kensio/smartass 1.0.0 → 1.0.2
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 +2 -0
- package/dist/assert/string-not-includes/string-not-includes.assert.d.ts +5 -0
- package/dist/assert/string-not-includes/string-not-includes.assert.d.ts.map +1 -0
- package/dist/assert/string-not-includes/string-not-includes.assert.js +12 -0
- package/dist/assert/string-not-includes/string-not-includes.assert.js.map +1 -0
- package/dist/assert/undefined/undefined.assert.d.ts +6 -0
- package/dist/assert/undefined/undefined.assert.d.ts.map +1 -0
- package/dist/assert/undefined/undefined.assert.js +12 -0
- package/dist/assert/undefined/undefined.assert.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ npm install @kensio/smartass
|
|
|
55
55
|
- [assertOneOf](src/assert/one-of/one-of.assert.ts)
|
|
56
56
|
- [assertStringEndsWith](src/assert/string-ends-with/string-ends-with.assert.ts)
|
|
57
57
|
- [assertStringIncludes](src/assert/string-includes/string-includes.assert.ts)
|
|
58
|
+
- [assertStringNotIncludes](src/assert/string-not-includes/string-not-includes.assert.ts)
|
|
58
59
|
- [assertStringStartsWith](src/assert/string-starts-with/string-starts-with.assert.ts)
|
|
59
60
|
- [assertThrowsError](src/assert/throws-error/throws-error.assert.ts)
|
|
60
61
|
- [assertThrowsErrorAsync](src/assert/throws-error-async/throws-error-async.assert.ts)
|
|
@@ -67,4 +68,5 @@ npm install @kensio/smartass
|
|
|
67
68
|
- [assertTypeObject](src/assert/type-object/type-object.assert.ts)
|
|
68
69
|
- [assertTypeString](src/assert/type-string/type-string.assert.ts)
|
|
69
70
|
- [assertTypeTypedArray](src/assert/type-typed-array/type-typed-array.assert.ts)
|
|
71
|
+
- [assertUndefined](src/assert/undefined/undefined.assert.ts)
|
|
70
72
|
- [assertUuidV4](src/assert/uuid/uuid-v4.assert.ts)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assert that a string does not include a given substring, with type narrowing.
|
|
3
|
+
*/
|
|
4
|
+
export declare function assertStringNotIncludes<const T extends string>(value: string, substring: T, message?: string): asserts value is Exclude<string, `${string}${T}${string}`>;
|
|
5
|
+
//# sourceMappingURL=string-not-includes.assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-not-includes.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAC5D,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,CAAC,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,CAS5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssertionError } from "../../assertion-error.js";
|
|
2
|
+
import { desc, repr } from "../../describe/describe.js";
|
|
3
|
+
/**
|
|
4
|
+
* Assert that a string does not include a given substring, with type narrowing.
|
|
5
|
+
*/
|
|
6
|
+
export function assertStringNotIncludes(value, substring, message) {
|
|
7
|
+
if (value.includes(substring)) {
|
|
8
|
+
throw new AssertionError(message ??
|
|
9
|
+
`Expected ${desc(value)} not to include ${repr(substring)}, but it did.`, value, `string not including ${repr(substring)}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=string-not-includes.assert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-not-includes.assert.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAa,EACb,SAAY,EACZ,OAAgB;IAEhB,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,YAAY,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,eAAe,EAC1E,KAAK,EACL,wBAAwB,IAAI,CAAC,SAAS,CAAC,EAAE,CAC1C,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undefined.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/undefined/undefined.assert.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,SAA6C,GACnD,OAAO,CAAC,KAAK,IAAI,SAAS,CAI5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssertionError } from "../../assertion-error.js";
|
|
2
|
+
import { desc } from "../../describe/describe.js";
|
|
3
|
+
/**
|
|
4
|
+
* Assert that a value is strictly undefined, with type-narrowing to the
|
|
5
|
+
* `undefined` type.
|
|
6
|
+
*/
|
|
7
|
+
export function assertUndefined(value, message = `Expected ${desc(value)} to be undefined.`) {
|
|
8
|
+
if (value !== undefined) {
|
|
9
|
+
throw new AssertionError(message, value, undefined);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=undefined.assert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undefined.assert.js","sourceRoot":"","sources":["../../../src/assert/undefined/undefined.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,mBAAmB;IAEpD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./assert/object-matches/object-matches.assert.js";
|
|
|
15
15
|
export * from "./assert/one-of/one-of.assert.js";
|
|
16
16
|
export * from "./assert/string-ends-with/string-ends-with.assert.js";
|
|
17
17
|
export * from "./assert/string-includes/string-includes.assert.js";
|
|
18
|
+
export * from "./assert/string-not-includes/string-not-includes.assert.js";
|
|
18
19
|
export * from "./assert/string-starts-with/string-starts-with.assert.js";
|
|
19
20
|
export * from "./assert/throws-error-async/throws-error-async.assert.js";
|
|
20
21
|
export * from "./assert/throws-error/throws-error.assert.js";
|
|
@@ -27,5 +28,6 @@ export * from "./assert/type-numeric/type-numeric.assert.js";
|
|
|
27
28
|
export * from "./assert/type-object/type-object.assert.js";
|
|
28
29
|
export * from "./assert/type-string/type-string.assert.js";
|
|
29
30
|
export * from "./assert/type-typed-array/type-typed-array.assert.js";
|
|
31
|
+
export * from "./assert/undefined/undefined.assert.js";
|
|
30
32
|
export * from "./assert/uuid/uuid-v4.assert.js";
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,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AAc,0DAA0D,CAAC;AACzE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sDAAsD,CAAC;AACrE,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./assert/object-matches/object-matches.assert.js";
|
|
|
15
15
|
export * from "./assert/one-of/one-of.assert.js";
|
|
16
16
|
export * from "./assert/string-ends-with/string-ends-with.assert.js";
|
|
17
17
|
export * from "./assert/string-includes/string-includes.assert.js";
|
|
18
|
+
export * from "./assert/string-not-includes/string-not-includes.assert.js";
|
|
18
19
|
export * from "./assert/string-starts-with/string-starts-with.assert.js";
|
|
19
20
|
export * from "./assert/throws-error-async/throws-error-async.assert.js";
|
|
20
21
|
export * from "./assert/throws-error/throws-error.assert.js";
|
|
@@ -27,5 +28,6 @@ export * from "./assert/type-numeric/type-numeric.assert.js";
|
|
|
27
28
|
export * from "./assert/type-object/type-object.assert.js";
|
|
28
29
|
export * from "./assert/type-string/type-string.assert.js";
|
|
29
30
|
export * from "./assert/type-typed-array/type-typed-array.assert.js";
|
|
31
|
+
export * from "./assert/undefined/undefined.assert.js";
|
|
30
32
|
export * from "./assert/uuid/uuid-v4.assert.js";
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,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,CAAC;AACnE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC;AACzE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sDAAsD,CAAC;AACrE,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"author": "Kensio Software",
|
|
5
5
|
"repository": "https://github.com/KensioSoftware/smartass",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.2",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
19
21
|
],
|
|
20
22
|
"publishConfig": {
|
|
21
23
|
"access": "public"
|
|
22
24
|
},
|
|
23
25
|
"sideEffects": false,
|
|
24
26
|
"engines": {
|
|
25
|
-
"node": ">=24.
|
|
27
|
+
"node": ">=24.16.0"
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|
|
28
30
|
"test",
|
|
@@ -34,9 +36,9 @@
|
|
|
34
36
|
"@eslint/js": "^10.0.1",
|
|
35
37
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
36
38
|
"@types/node": "^25.9.1",
|
|
37
|
-
"@vitest/coverage-v8": "^4.1.
|
|
38
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
39
|
-
"eslint": "^10.4.
|
|
39
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
40
|
+
"@vitest/eslint-plugin": "^1.6.19",
|
|
41
|
+
"eslint": "^10.4.1",
|
|
40
42
|
"eslint-config-prettier": "^10.1.8",
|
|
41
43
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
42
44
|
"eslint-plugin-no-secrets": "^2.3.3",
|
|
@@ -47,7 +49,7 @@
|
|
|
47
49
|
"prettier": "^3.8.3",
|
|
48
50
|
"typescript": "^5.9.3",
|
|
49
51
|
"typescript-eslint": "^8.60.0",
|
|
50
|
-
"vitest": "^4.1.
|
|
52
|
+
"vitest": "^4.1.8"
|
|
51
53
|
},
|
|
52
54
|
"scripts": {
|
|
53
55
|
"build": "tsc -p tsconfig.build.json",
|