@kensio/smartass 1.20.0 → 1.22.0

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.
Files changed (39) hide show
  1. package/LICENSE +202 -661
  2. package/README.md +14 -0
  3. package/dist/assert/directory-exists/directory-exists.assert.d.ts +5 -0
  4. package/dist/assert/directory-exists/directory-exists.assert.d.ts.map +1 -0
  5. package/dist/assert/directory-exists/directory-exists.assert.js +20 -0
  6. package/dist/assert/directory-exists/directory-exists.assert.js.map +1 -0
  7. package/dist/assert/file-equals/file-equals.assert.d.ts +9 -0
  8. package/dist/assert/file-equals/file-equals.assert.d.ts.map +1 -0
  9. package/dist/assert/file-equals/file-equals.assert.js +38 -0
  10. package/dist/assert/file-equals/file-equals.assert.js.map +1 -0
  11. package/dist/assert/file-exists/file-exists.assert.d.ts +5 -0
  12. package/dist/assert/file-exists/file-exists.assert.d.ts.map +1 -0
  13. package/dist/assert/file-exists/file-exists.assert.js +20 -0
  14. package/dist/assert/file-exists/file-exists.assert.js.map +1 -0
  15. package/dist/assert/file-includes/file-includes.assert.d.ts +5 -0
  16. package/dist/assert/file-includes/file-includes.assert.d.ts.map +1 -0
  17. package/dist/assert/file-includes/file-includes.assert.js +17 -0
  18. package/dist/assert/file-includes/file-includes.assert.js.map +1 -0
  19. package/dist/assert/file-not-includes/file-not-includes.assert.d.ts +5 -0
  20. package/dist/assert/file-not-includes/file-not-includes.assert.d.ts.map +1 -0
  21. package/dist/assert/file-not-includes/file-not-includes.assert.js +17 -0
  22. package/dist/assert/file-not-includes/file-not-includes.assert.js.map +1 -0
  23. package/dist/assert/path-exists/path-exists.assert.d.ts +5 -0
  24. package/dist/assert/path-exists/path-exists.assert.d.ts.map +1 -0
  25. package/dist/assert/path-exists/path-exists.assert.js +18 -0
  26. package/dist/assert/path-exists/path-exists.assert.js.map +1 -0
  27. package/dist/assert/path-not-exists/path-not-exists.assert.d.ts +5 -0
  28. package/dist/assert/path-not-exists/path-not-exists.assert.d.ts.map +1 -0
  29. package/dist/assert/path-not-exists/path-not-exists.assert.js +18 -0
  30. package/dist/assert/path-not-exists/path-not-exists.assert.js.map +1 -0
  31. package/dist/compare/file-includes.d.ts +6 -0
  32. package/dist/compare/file-includes.d.ts.map +1 -0
  33. package/dist/compare/file-includes.js +37 -0
  34. package/dist/compare/file-includes.js.map +1 -0
  35. package/dist/index.d.ts +7 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +7 -0
  38. package/dist/index.js.map +1 -1
  39. package/package.json +4 -4
package/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @kensio/smartass
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/%40kensio%2Fsmartass)](https://www.npmjs.com/package/@kensio/smartass)
4
+ ![CI](https://img.shields.io/github/actions/workflow/status/KensioSoftware/smartass/pr.yml?label=CI)
5
+ ![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/hughgrigg/57bc32d63dcc345dea15d1f1c38b51bb/raw/coverage.json)
6
+ ![Node](https://img.shields.io/node/v/%40kensio%2Fsmartass)
7
+ ![TypeScript](https://img.shields.io/badge/TS-TypeScript-3178C6)
8
+ ![License](https://img.shields.io/npm/l/%40kensio%2Fsmartass)
9
+
3
10
  TypeScript-first test assertion functions with precise type narrowing via
4
11
  assertion signatures.
5
12
 
@@ -79,7 +86,12 @@ structure.
79
86
  - [assertArrayMinLength](src/assert/array-min-length/array-min-length.assert.ts)
80
87
  - [assertArrayNotEmpty](src/assert/array-not-empty/array-not-empty.assert.ts)
81
88
  - [assertBufferEqual](src/assert/buffer-equal/buffer-equal.assert.ts)
89
+ - [assertDirectoryExists](src/assert/directory-exists/directory-exists.assert.ts)
82
90
  - [assertFalse](src/assert/false/false.assert.ts)
91
+ - [assertFileEquals](src/assert/file-equals/file-equals.assert.ts)
92
+ - [assertFileExists](src/assert/file-exists/file-exists.assert.ts)
93
+ - [assertFileIncludes](src/assert/file-includes/file-includes.assert.ts)
94
+ - [assertFileNotIncludes](src/assert/file-not-includes/file-not-includes.assert.ts)
83
95
  - [assertIdentical](src/assert/identical/identical.assert.ts)
84
96
  - [assertInstanceOf](src/assert/instance-of/instance-of.assert.ts)
85
97
  - [assertMapSize](src/assert/map-size/map-size.assert.ts)
@@ -90,6 +102,8 @@ structure.
90
102
  - [assertObjectHasProperty](src/assert/object-has-property/object-has-property.assert.ts)
91
103
  - [assertObjectMatches](src/assert/object-matches/object-matches.assert.ts)
92
104
  - [assertOneOf](src/assert/one-of/one-of.assert.ts)
105
+ - [assertPathExists](src/assert/path-exists/path-exists.assert.ts)
106
+ - [assertPathNotExists](src/assert/path-not-exists/path-not-exists.assert.ts)
93
107
  - [assertSetSize](src/assert/set-size/set-size.assert.ts)
94
108
  - [assertStringEndsWith](src/assert/string-ends-with/string-ends-with.assert.ts)
95
109
  - [assertStringIncludes](src/assert/string-includes/string-includes.assert.ts)
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a filesystem path exists and is a directory.
3
+ */
4
+ export declare function assertDirectoryExists(directoryPath: string | string[], message?: string): void;
5
+ //# sourceMappingURL=directory-exists.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory-exists.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/directory-exists/directory-exists.assert.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,EAChC,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAgBN"}
@@ -0,0 +1,20 @@
1
+ import { statSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { AssertionError } from "../../assertion-error.js";
4
+ import { repr } from "../../describe/describe.js";
5
+ import { assertPathExists } from "../path-exists/path-exists.assert.js";
6
+ /**
7
+ * Assert that a filesystem path exists and is a directory.
8
+ */
9
+ export function assertDirectoryExists(directoryPath, message) {
10
+ const resolvedDirectoryPath = Array.isArray(directoryPath)
11
+ ? path.join(...directoryPath)
12
+ : directoryPath;
13
+ assertPathExists(resolvedDirectoryPath, message);
14
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
15
+ if (!statSync(resolvedDirectoryPath).isDirectory()) {
16
+ throw new AssertionError(message ??
17
+ `Expected path ${repr(resolvedDirectoryPath)} to be a directory, but it was not.`, resolvedDirectoryPath, "directory");
18
+ }
19
+ }
20
+ //# sourceMappingURL=directory-exists.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory-exists.assert.js","sourceRoot":"","sources":["../../../src/assert/directory-exists/directory-exists.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,aAAgC,EAChC,OAAgB;IAEhB,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC;QACxD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC;QAC7B,CAAC,CAAC,aAAa,CAAC;IAElB,gBAAgB,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAEjD,mEAAmE;IACnE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,qBAAqB,CAAC,qCAAqC,EACnF,qBAAqB,EACrB,WAAW,CACZ,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface AssertFileEqualsOptions {
2
+ normalizeLineEndings?: boolean;
3
+ trimTrailingWhitespace?: boolean;
4
+ }
5
+ /**
6
+ * Assert that a file's content exactly equals the expected content.
7
+ */
8
+ export declare function assertFileEquals(filePath: string | string[], expected: string, opts?: AssertFileEqualsOptions, message?: string): void;
9
+ //# sourceMappingURL=file-equals.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-equals.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/file-equals/file-equals.assert.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,uBAAuB;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAOD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,uBAA4B,EAClC,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAqBN"}
@@ -0,0 +1,38 @@
1
+ import { readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { AssertionError } from "../../assertion-error.js";
4
+ import { repr } from "../../describe/describe.js";
5
+ import { assertFileExists } from "../file-exists/file-exists.assert.js";
6
+ const defaultOptions = {
7
+ normalizeLineEndings: true,
8
+ trimTrailingWhitespace: true,
9
+ };
10
+ /**
11
+ * Assert that a file's content exactly equals the expected content.
12
+ */
13
+ export function assertFileEquals(filePath, expected, opts = {}, message) {
14
+ const resolvedFilePath = Array.isArray(filePath)
15
+ ? path.join(...filePath)
16
+ : filePath;
17
+ const options = { ...defaultOptions, ...opts };
18
+ assertFileExists(resolvedFilePath, message);
19
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
20
+ const actual = readFileSync(resolvedFilePath, "utf8");
21
+ const normalizedActual = normalizeFileContent(actual, options);
22
+ const normalizedExpected = normalizeFileContent(expected, options);
23
+ if (normalizedActual !== normalizedExpected) {
24
+ throw new AssertionError(message ??
25
+ `Expected file ${repr(resolvedFilePath)} to equal ${repr(expected)}, but it did not.`, normalizedActual, normalizedExpected);
26
+ }
27
+ }
28
+ function normalizeFileContent(content, options) {
29
+ let normalized = content;
30
+ if (options.normalizeLineEndings) {
31
+ normalized = normalized.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
32
+ }
33
+ if (options.trimTrailingWhitespace) {
34
+ normalized = normalized.replace(/\s+$/u, "");
35
+ }
36
+ return normalized;
37
+ }
38
+ //# sourceMappingURL=file-equals.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-equals.assert.js","sourceRoot":"","sources":["../../../src/assert/file-equals/file-equals.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAOxE,MAAM,cAAc,GAAG;IACrB,oBAAoB,EAAE,IAAI;IAC1B,sBAAsB,EAAE,IAAI;CACe,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA2B,EAC3B,QAAgB,EAChB,OAAgC,EAAE,EAClC,OAAgB;IAEhB,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IACb,MAAM,OAAO,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,EAAE,CAAC;IAE/C,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAE5C,mEAAmE;IACnE,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEnE,IAAI,gBAAgB,KAAK,kBAAkB,EAAE,CAAC;QAC5C,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,gBAAgB,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EACvF,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAC3B,OAAe,EACf,OAA0C;IAE1C,IAAI,UAAU,GAAG,OAAO,CAAC;IAEzB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACjC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACnC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a filesystem path exists and is a file.
3
+ */
4
+ export declare function assertFileExists(filePath: string | string[], message?: string): void;
5
+ //# sourceMappingURL=file-exists.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-exists.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/file-exists/file-exists.assert.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAgBN"}
@@ -0,0 +1,20 @@
1
+ import { statSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { AssertionError } from "../../assertion-error.js";
4
+ import { repr } from "../../describe/describe.js";
5
+ import { assertPathExists } from "../path-exists/path-exists.assert.js";
6
+ /**
7
+ * Assert that a filesystem path exists and is a file.
8
+ */
9
+ export function assertFileExists(filePath, message) {
10
+ const resolvedFilePath = Array.isArray(filePath)
11
+ ? path.join(...filePath)
12
+ : filePath;
13
+ assertPathExists(resolvedFilePath, message);
14
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
15
+ if (!statSync(resolvedFilePath).isFile()) {
16
+ throw new AssertionError(message ??
17
+ `Expected path ${repr(resolvedFilePath)} to be a file, but it was not.`, resolvedFilePath, "file");
18
+ }
19
+ }
20
+ //# sourceMappingURL=file-exists.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-exists.assert.js","sourceRoot":"","sources":["../../../src/assert/file-exists/file-exists.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA2B,EAC3B,OAAgB;IAEhB,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IAEb,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAE5C,mEAAmE;IACnE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACzC,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,gBAAgB,CAAC,gCAAgC,EACzE,gBAAgB,EAChB,MAAM,CACP,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a file includes a given substring.
3
+ */
4
+ export declare function assertFileIncludes(filePath: string | string[], substring: string, message?: string): Promise<void>;
5
+ //# sourceMappingURL=file-includes.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-includes.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/file-includes/file-includes.assert.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -0,0 +1,17 @@
1
+ import path from "node:path";
2
+ import { AssertionError } from "../../assertion-error.js";
3
+ import { repr } from "../../describe/describe.js";
4
+ import { fileIncludesSubstring } from "../../compare/file-includes.js";
5
+ /**
6
+ * Assert that a file includes a given substring.
7
+ */
8
+ export async function assertFileIncludes(filePath, substring, message) {
9
+ const resolvedFilePath = Array.isArray(filePath)
10
+ ? path.join(...filePath)
11
+ : filePath;
12
+ if (!(await fileIncludesSubstring(resolvedFilePath, substring))) {
13
+ throw new AssertionError(message ??
14
+ `Expected file ${repr(resolvedFilePath)} to include ${repr(substring)}, but it did not.`, resolvedFilePath, substring);
15
+ }
16
+ }
17
+ //# sourceMappingURL=file-includes.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-includes.assert.js","sourceRoot":"","sources":["../../../src/assert/file-includes/file-includes.assert.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAA2B,EAC3B,SAAiB,EACjB,OAAgB;IAEhB,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IAEb,IAAI,CAAC,CAAC,MAAM,qBAAqB,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,gBAAgB,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAC1F,gBAAgB,EAChB,SAAS,CACV,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a file does not include a given substring.
3
+ */
4
+ export declare function assertFileNotIncludes(filePath: string | string[], substring: string, message?: string): Promise<void>;
5
+ //# sourceMappingURL=file-not-includes.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-not-includes.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/file-not-includes/file-not-includes.assert.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -0,0 +1,17 @@
1
+ import path from "node:path";
2
+ import { AssertionError } from "../../assertion-error.js";
3
+ import { repr } from "../../describe/describe.js";
4
+ import { fileIncludesSubstring } from "../../compare/file-includes.js";
5
+ /**
6
+ * Assert that a file does not include a given substring.
7
+ */
8
+ export async function assertFileNotIncludes(filePath, substring, message) {
9
+ const resolvedFilePath = Array.isArray(filePath)
10
+ ? path.join(...filePath)
11
+ : filePath;
12
+ if (await fileIncludesSubstring(resolvedFilePath, substring)) {
13
+ throw new AssertionError(message ??
14
+ `Expected file ${repr(resolvedFilePath)} not to include ${repr(substring)}, but it did.`, resolvedFilePath, substring);
15
+ }
16
+ }
17
+ //# sourceMappingURL=file-not-includes.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-not-includes.assert.js","sourceRoot":"","sources":["../../../src/assert/file-not-includes/file-not-includes.assert.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,QAA2B,EAC3B,SAAiB,EACjB,OAAgB;IAEhB,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IAEb,IAAI,MAAM,qBAAqB,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,eAAe,EAC1F,gBAAgB,EAChB,SAAS,CACV,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a filesystem path exists.
3
+ */
4
+ export declare function assertPathExists(filePath: string | string[], message?: string): void;
5
+ //# sourceMappingURL=path-exists.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-exists.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/path-exists/path-exists.assert.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAcN"}
@@ -0,0 +1,18 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { AssertionError } from "../../assertion-error.js";
4
+ import { repr } from "../../describe/describe.js";
5
+ /**
6
+ * Assert that a filesystem path exists.
7
+ */
8
+ export function assertPathExists(filePath, message) {
9
+ const resolvedPath = Array.isArray(filePath)
10
+ ? path.join(...filePath)
11
+ : filePath;
12
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
13
+ if (!existsSync(resolvedPath)) {
14
+ throw new AssertionError(message ??
15
+ `Expected path ${repr(resolvedPath)} to exist, but it did not.`, resolvedPath, "existing path");
16
+ }
17
+ }
18
+ //# sourceMappingURL=path-exists.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-exists.assert.js","sourceRoot":"","sources":["../../../src/assert/path-exists/path-exists.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA2B,EAC3B,OAAgB;IAEhB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC1C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IAEb,mEAAmE;IACnE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,YAAY,CAAC,4BAA4B,EACjE,YAAY,EACZ,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a filesystem path does not exist.
3
+ */
4
+ export declare function assertPathNotExists(filePath: string | string[], message?: string): void;
5
+ //# sourceMappingURL=path-not-exists.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-not-exists.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/path-not-exists/path-not-exists.assert.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAcN"}
@@ -0,0 +1,18 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { AssertionError } from "../../assertion-error.js";
4
+ import { repr } from "../../describe/describe.js";
5
+ /**
6
+ * Assert that a filesystem path does not exist.
7
+ */
8
+ export function assertPathNotExists(filePath, message) {
9
+ const resolvedPath = Array.isArray(filePath)
10
+ ? path.join(...filePath)
11
+ : filePath;
12
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
13
+ if (existsSync(resolvedPath)) {
14
+ throw new AssertionError(message ??
15
+ `Expected path ${repr(resolvedPath)} not to exist, but it did.`, resolvedPath, "non-existing path");
16
+ }
17
+ }
18
+ //# sourceMappingURL=path-not-exists.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-not-exists.assert.js","sourceRoot":"","sources":["../../../src/assert/path-not-exists/path-not-exists.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAA2B,EAC3B,OAAgB;IAEhB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC1C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC;IAEb,mEAAmE;IACnE,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,iBAAiB,IAAI,CAAC,YAAY,CAAC,4BAA4B,EACjE,YAAY,EACZ,mBAAmB,CACpB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Check whether a file contains a substring, without loading the entire file
3
+ * into memory.
4
+ */
5
+ export declare function fileIncludesSubstring(filePath: string, substring: string, encoding?: BufferEncoding): Promise<boolean>;
6
+ //# sourceMappingURL=file-includes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-includes.d.ts","sourceRoot":"","sources":["../../src/compare/file-includes.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,cAAuB,GAChC,OAAO,CAAC,OAAO,CAAC,CAqClB"}
@@ -0,0 +1,37 @@
1
+ import { createReadStream } from "node:fs";
2
+ /**
3
+ * Check whether a file contains a substring, without loading the entire file
4
+ * into memory.
5
+ */
6
+ export function fileIncludesSubstring(filePath, substring, encoding = "utf8") {
7
+ if (substring === "") {
8
+ return Promise.resolve(true);
9
+ }
10
+ return new Promise((resolve, reject) => {
11
+ const needle = Buffer.from(substring, encoding);
12
+ const overlap = needle.length - 1;
13
+ let tail = Buffer.alloc(0);
14
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
15
+ const stream = createReadStream(filePath);
16
+ stream.on("data", (chunk) => {
17
+ const buffer = Buffer.isBuffer(chunk)
18
+ ? chunk
19
+ : Buffer.from(chunk, encoding);
20
+ const combined = Buffer.concat([tail, buffer]);
21
+ if (combined.includes(needle)) {
22
+ resolve(true);
23
+ stream.destroy();
24
+ return;
25
+ }
26
+ tail =
27
+ combined.length > overlap
28
+ ? combined.subarray(combined.length - overlap)
29
+ : combined;
30
+ });
31
+ stream.on("end", () => {
32
+ resolve(false);
33
+ });
34
+ stream.on("error", reject);
35
+ });
36
+ }
37
+ //# sourceMappingURL=file-includes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-includes.js","sourceRoot":"","sources":["../../src/compare/file-includes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,SAAiB,EACjB,WAA2B,MAAM;IAEjC,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClC,IAAI,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE3B,mEAAmE;QACnE,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAsB,EAAE,EAAE;YAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACnC,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YAE/C,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;gBACd,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO;YACT,CAAC;YAED,IAAI;gBACF,QAAQ,CAAC,MAAM,GAAG,OAAO;oBACvB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC;oBAC9C,CAAC,CAAC,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -11,7 +11,12 @@ export * from "./assert/array-not-empty/array-not-empty.assert.js";
11
11
  export * from "./assert/array-not-empty/array-not-empty.match.js";
12
12
  export * from "./assert/buffer-equal/buffer-equal.assert.js";
13
13
  export * from "./assert/buffer-equal/buffer-equal.match.js";
14
+ export * from "./assert/directory-exists/directory-exists.assert.js";
14
15
  export * from "./assert/false/false.assert.js";
16
+ export * from "./assert/file-equals/file-equals.assert.js";
17
+ export * from "./assert/file-exists/file-exists.assert.js";
18
+ export * from "./assert/file-includes/file-includes.assert.js";
19
+ export * from "./assert/file-not-includes/file-not-includes.assert.js";
15
20
  export * from "./assert/identical/identical.assert.js";
16
21
  export * from "./assert/instance-of/instance-of.assert.js";
17
22
  export * from "./assert/instance-of/instance-of.match.js";
@@ -29,6 +34,8 @@ export * from "./assert/object-has-property/object-has-property.match.js";
29
34
  export * from "./assert/object-matches/object-matches.assert.js";
30
35
  export * from "./assert/one-of/one-of.assert.js";
31
36
  export * from "./assert/one-of/one-of.match.js";
37
+ export * from "./assert/path-exists/path-exists.assert.js";
38
+ export * from "./assert/path-not-exists/path-not-exists.assert.js";
32
39
  export * from "./assert/set-size/set-size.assert.js";
33
40
  export * from "./assert/set-size/set-size.match.js";
34
41
  export * from "./assert/string-ends-with/string-ends-with.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,yDAAyD,CAAC;AACxE,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC;AACrE,cAAc,qDAAqD,CAAC;AACpE,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,uDAAuD,CAAC;AACtE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,kDAAkD,CAAC;AACjE,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sDAAsD,CAAC;AACrE,cAAc,qDAAqD,CAAC;AACpE,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4DAA4D,CAAC;AA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,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AACrE,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -11,7 +11,12 @@ export * from "./assert/array-not-empty/array-not-empty.assert.js";
11
11
  export * from "./assert/array-not-empty/array-not-empty.match.js";
12
12
  export * from "./assert/buffer-equal/buffer-equal.assert.js";
13
13
  export * from "./assert/buffer-equal/buffer-equal.match.js";
14
+ export * from "./assert/directory-exists/directory-exists.assert.js";
14
15
  export * from "./assert/false/false.assert.js";
16
+ export * from "./assert/file-equals/file-equals.assert.js";
17
+ export * from "./assert/file-exists/file-exists.assert.js";
18
+ export * from "./assert/file-includes/file-includes.assert.js";
19
+ export * from "./assert/file-not-includes/file-not-includes.assert.js";
15
20
  export * from "./assert/identical/identical.assert.js";
16
21
  export * from "./assert/instance-of/instance-of.assert.js";
17
22
  export * from "./assert/instance-of/instance-of.match.js";
@@ -29,6 +34,8 @@ export * from "./assert/object-has-property/object-has-property.match.js";
29
34
  export * from "./assert/object-matches/object-matches.assert.js";
30
35
  export * from "./assert/one-of/one-of.assert.js";
31
36
  export * from "./assert/one-of/one-of.match.js";
37
+ export * from "./assert/path-exists/path-exists.assert.js";
38
+ export * from "./assert/path-not-exists/path-not-exists.assert.js";
32
39
  export * from "./assert/set-size/set-size.assert.js";
33
40
  export * from "./assert/set-size/set-size.match.js";
34
41
  export * from "./assert/string-ends-with/string-ends-with.assert.js";
package/dist/index.js.map CHANGED
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c,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AACrE,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC"}
package/package.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "type": "git",
7
7
  "url": "https://github.com/KensioSoftware/smartass"
8
8
  },
9
- "license": "AGPL-3.0",
10
- "version": "1.20.0",
9
+ "license": "Apache-2.0",
10
+ "version": "1.22.0",
11
11
  "type": "module",
12
12
  "main": "./dist/index.js",
13
13
  "types": "./dist/index.d.ts",
@@ -38,12 +38,12 @@
38
38
  "devDependencies": {
39
39
  "@eslint/js": "^10.0.1",
40
40
  "@types/eslint-plugin-security": "^3.0.1",
41
- "@types/node": "^22",
41
+ "@types/node": "^25",
42
42
  "@vitest/coverage-v8": "^4.1.9",
43
43
  "@vitest/eslint-plugin": "^1.6.20",
44
44
  "eslint": "^10.5.0",
45
45
  "eslint-config-prettier": "^10.1.8",
46
- "eslint-plugin-jsdoc": "^62.9.0",
46
+ "eslint-plugin-jsdoc": "^63.0.0",
47
47
  "eslint-plugin-no-secrets": "^2.3.3",
48
48
  "eslint-plugin-security": "^4.0.1",
49
49
  "eslint-plugin-unicorn": "^64.0.0",