@thi.ng/file-io 0.3.0 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-05-20T09:18:30Z
3
+ - **Last updated**: 2022-06-09T16:14:01Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/delete.d.ts CHANGED
@@ -8,5 +8,5 @@ import type { ILogger } from "@thi.ng/logger";
8
8
  * @param logger
9
9
  * @param dryRun
10
10
  */
11
- export declare const deleteFile: (path: string, logger?: ILogger | undefined, dryRun?: boolean) => void;
11
+ export declare const deleteFile: (path: string, logger?: ILogger, dryRun?: boolean) => void;
12
12
  //# sourceMappingURL=delete.d.ts.map
package/files.d.ts CHANGED
@@ -15,7 +15,7 @@ import type { ILogger } from "@thi.ng/logger";
15
15
  * @param maxDepth
16
16
  * @param logger
17
17
  */
18
- export declare const files: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger | undefined) => IterableIterator<string>;
18
+ export declare const files: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger) => IterableIterator<string>;
19
19
  /**
20
20
  * Similar to {@link files}, however yields iterator of only matching
21
21
  * sub-directories in given `dir`. Normal files are being ignored.
@@ -29,5 +29,5 @@ export declare const files: (dir: string, match?: string | RegExp, maxDepth?: nu
29
29
  * @param maxDepth
30
30
  * @param logger
31
31
  */
32
- export declare const dirs: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger | undefined) => IterableIterator<string>;
32
+ export declare const dirs: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger) => IterableIterator<string>;
33
33
  //# sourceMappingURL=files.d.ts.map
package/hash.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ILogger } from "@thi.ng/logger";
2
2
  export declare type HashAlgo = "gost-mac" | "md4" | "md5" | "md_gost94" | "ripemd160" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512" | "streebog256" | "streebog512" | "whirlpool";
3
- export declare const fileHash: (path: string, logger?: ILogger | undefined, algo?: HashAlgo) => string;
4
- export declare const stringHash: (src: string, logger?: ILogger | undefined, algo?: HashAlgo) => string;
3
+ export declare const fileHash: (path: string, logger?: ILogger, algo?: HashAlgo) => string;
4
+ export declare const stringHash: (src: string, logger?: ILogger, algo?: HashAlgo) => string;
5
5
  //# sourceMappingURL=hash.d.ts.map
package/json.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Fn3, NumOrString } from "@thi.ng/api";
2
2
  import type { ILogger } from "@thi.ng/logger";
3
- export declare const readJSON: (path: string, logger?: ILogger | undefined) => any;
3
+ export declare const readJSON: (path: string, logger?: ILogger) => any;
4
4
  /**
5
5
  * Serializes `obj` to JSON and writes result to UTF-8 file `path`. See
6
6
  * {@link writeText} for more details.
@@ -16,5 +16,5 @@ export declare const readJSON: (path: string, logger?: ILogger | undefined) => a
16
16
  * @param logger
17
17
  * @param dryRun
18
18
  */
19
- export declare const writeJSON: (path: string, obj: any, replacer?: Fn3<any, string, any, any> | NumOrString[] | null | undefined, space?: NumOrString | undefined, logger?: ILogger | undefined, dryRun?: boolean) => void;
19
+ export declare const writeJSON: (path: string, obj: any, replacer?: Fn3<any, string, any, any> | NumOrString[] | null | undefined, space?: NumOrString | undefined, logger?: ILogger, dryRun?: boolean) => void;
20
20
  //# sourceMappingURL=json.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/file-io",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "Assorted file I/O utils (with logging support) for NodeJS",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,18 +34,18 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.3.6",
38
- "@thi.ng/checks": "^3.1.6",
39
- "@thi.ng/logger": "^1.1.6",
40
- "@thi.ng/random": "^3.2.6"
37
+ "@thi.ng/api": "^8.3.7",
38
+ "@thi.ng/checks": "^3.2.1",
39
+ "@thi.ng/logger": "^1.1.7",
40
+ "@thi.ng/random": "^3.3.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@microsoft/api-extractor": "^7.23.1",
44
- "@thi.ng/testament": "^0.2.7",
43
+ "@microsoft/api-extractor": "^7.25.0",
44
+ "@thi.ng/testament": "^0.2.8",
45
45
  "rimraf": "^3.0.2",
46
46
  "tools": "^0.0.1",
47
- "typedoc": "^0.22.15",
48
- "typescript": "^4.6.4"
47
+ "typedoc": "^0.22.17",
48
+ "typescript": "^4.7.3"
49
49
  },
50
50
  "keywords": [
51
51
  "file",
@@ -108,5 +108,5 @@
108
108
  "status": "stable",
109
109
  "year": 2022
110
110
  },
111
- "gitHead": "e5c61ba561129c4a4b874aee1541b0c051ab6638\n"
111
+ "gitHead": "ab0188234419f2d9f471de80871df930e5555bd6\n"
112
112
  }
package/temp.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TypedArray } from "@thi.ng/api";
2
2
  import type { ILogger } from "@thi.ng/logger";
3
- export declare const createTempFile: (body: string | TypedArray, logger?: ILogger | undefined, name?: string | undefined) => string;
4
- export declare const tempFilePath: (name?: string | undefined) => string;
3
+ export declare const createTempFile: (body: string | TypedArray, logger?: ILogger, name?: string) => string;
4
+ export declare const tempFilePath: (name?: string) => string;
5
5
  //# sourceMappingURL=temp.d.ts.map
package/text.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ILogger } from "@thi.ng/logger";
2
- export declare const readText: (path: string, logger?: ILogger | undefined) => string;
2
+ export declare const readText: (path: string, logger?: ILogger) => string;
3
3
  /**
4
4
  * Writes `body` as UTF-8 file to given `path`. If `dryRun` is true (default:
5
5
  * false), the file WON'T be written, however if a `logger` is provided then at
@@ -10,5 +10,5 @@ export declare const readText: (path: string, logger?: ILogger | undefined) => s
10
10
  * @param logger
11
11
  * @param dryRun
12
12
  */
13
- export declare const writeText: (path: string, body: string | string[], logger?: ILogger | undefined, dryRun?: boolean) => void;
13
+ export declare const writeText: (path: string, body: string | string[], logger?: ILogger, dryRun?: boolean) => void;
14
14
  //# sourceMappingURL=text.d.ts.map
package/write.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { TypedArray } from "@thi.ng/api";
3
2
  import type { ILogger } from "@thi.ng/logger";
4
3
  import { WriteFileOptions } from "fs";
@@ -13,5 +12,5 @@ import { WriteFileOptions } from "fs";
13
12
  * @param logger
14
13
  * @param dryRun
15
14
  */
16
- export declare const writeFile: (path: string, body: string | TypedArray, opts?: WriteFileOptions | undefined, logger?: ILogger | undefined, dryRun?: boolean) => void;
15
+ export declare const writeFile: (path: string, body: string | TypedArray, opts?: WriteFileOptions, logger?: ILogger, dryRun?: boolean) => void;
17
16
  //# sourceMappingURL=write.d.ts.map