@naturalcycles/nodejs-lib 15.130.0 → 15.130.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/dist/fs/fs2.d.ts CHANGED
@@ -32,7 +32,7 @@ declare class FS2 {
32
32
  appendFileAsync(filePath: string, data: string | Buffer): Promise<void>;
33
33
  outputPrettyJson(filePath: string, data: any): void;
34
34
  outputJson(filePath: string, data: any, opt?: JsonOptions): void;
35
- outputPrettyAsync(filePath: string, data: any): Promise<void>;
35
+ outputPrettyJsonAsync(filePath: string, data: any): Promise<void>;
36
36
  outputJsonAsync(filePath: string, data: any, opt?: JsonOptions): Promise<void>;
37
37
  outputFile(filePath: string, data: string | Buffer): void;
38
38
  outputFileAsync(filePath: string, data: string | Buffer): Promise<void>;
package/dist/fs/fs2.js CHANGED
@@ -88,7 +88,7 @@ class FS2 {
88
88
  const str = stringify(data, opt);
89
89
  this.outputFile(filePath, str);
90
90
  }
91
- async outputPrettyAsync(filePath, data) {
91
+ async outputPrettyJsonAsync(filePath, data) {
92
92
  await this.outputJsonAsync(filePath, data, prettyJsonOptions);
93
93
  }
94
94
  async outputJsonAsync(filePath, data, opt) {
@@ -24,7 +24,7 @@ export function secretsDecrypt(dir, file, encKeyBuffer, del = false, jsonMode =
24
24
  _assert(!filename.endsWith('.plain.json'), `${path.basename(filename)} MUST NOT end with '.plain.json'`);
25
25
  plainFilename = filename.replace('.json', '.plain.json');
26
26
  const json = decryptObject(fs2.readJson(filename), encKeyBuffer);
27
- fs2.writeJson(plainFilename, json, { spaces: 2 });
27
+ fs2.writePrettyJson(plainFilename, json);
28
28
  }
29
29
  else {
30
30
  const enc = fs.readFileSync(filename);
@@ -23,7 +23,7 @@ export function secretsEncrypt(pattern, file, encKeyBuffer, del = false, jsonMod
23
23
  _assert(filename.endsWith('.plain.json'), `${path.basename(filename)} MUST end with '.plain.json'`);
24
24
  encFilename = filename.replace('.plain', '');
25
25
  const json = encryptObject(fs2.readJson(filename), encKeyBuffer);
26
- fs2.writeJson(encFilename, json, { spaces: 2 });
26
+ fs2.writePrettyJson(encFilename, json);
27
27
  }
28
28
  else {
29
29
  const plain = fs.readFileSync(filename);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "15.130.0",
4
+ "version": "15.130.1",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@standard-schema/spec": "^1",
package/src/fs/fs2.ts CHANGED
@@ -112,7 +112,7 @@ class FS2 {
112
112
  this.outputFile(filePath, str)
113
113
  }
114
114
 
115
- async outputPrettyAsync(filePath: string, data: any): Promise<void> {
115
+ async outputPrettyJsonAsync(filePath: string, data: any): Promise<void> {
116
116
  await this.outputJsonAsync(filePath, data, prettyJsonOptions)
117
117
  }
118
118
 
@@ -49,7 +49,7 @@ export function secretsDecrypt(
49
49
 
50
50
  const json = decryptObject(fs2.readJson(filename), encKeyBuffer)
51
51
 
52
- fs2.writeJson(plainFilename, json, { spaces: 2 })
52
+ fs2.writePrettyJson(plainFilename, json)
53
53
  } else {
54
54
  const enc = fs.readFileSync(filename)
55
55
  const plain = decryptRandomIVBuffer(enc, encKeyBuffer)
@@ -44,7 +44,7 @@ export function secretsEncrypt(
44
44
 
45
45
  const json = encryptObject(fs2.readJson(filename), encKeyBuffer)
46
46
 
47
- fs2.writeJson(encFilename, json, { spaces: 2 })
47
+ fs2.writePrettyJson(encFilename, json)
48
48
  } else {
49
49
  const plain = fs.readFileSync(filename)
50
50
  const enc = encryptRandomIVBuffer(plain, encKeyBuffer)