@kensio/smartass 1.0.0 → 1.0.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/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)
@@ -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"}
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";
@@ -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,c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,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,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";
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,CAAC;AAC7D,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kCAAkC,CAAC;AACjD,cAAc,sDAAsD,CAAC;AACrE,cA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Ac,sDAAsD,CAAC;AACrE,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.0",
7
+ "version": "1.0.1",
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
@@ -15,7 +15,9 @@
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"