@ms-cloudpack/json-utilities 0.0.6 → 0.0.8

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/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { readJson, readJsonSync } from './readJson.js';
2
2
  export { writeJson, writeJsonSync } from './writeJson.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/readJson.d.ts CHANGED
@@ -7,3 +7,4 @@ export declare function readJson<TData>(path: string): Promise<TData | undefined
7
7
  * or is unparsable.
8
8
  */
9
9
  export declare function readJsonSync<TData>(path: string): TData | undefined;
10
+ //# sourceMappingURL=readJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readJson.d.ts","sourceRoot":"","sources":["../src/readJson.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAsB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAU9E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAUnE"}
@@ -1,11 +1,11 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.4"
9
- }
10
- ]
11
- }
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.36.4"
9
+ }
10
+ ]
11
+ }
@@ -6,3 +6,4 @@ export declare function writeJson(filePath: string, data: any): Promise<void>;
6
6
  * Synchronously writes json to a path. Ensures the path exists.
7
7
  */
8
8
  export declare function writeJsonSync(filePath: string, data: any): void;
9
+ //# sourceMappingURL=writeJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeJson.d.ts","sourceRoot":"","sources":["../src/writeJson.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;AAED;;GAEG;AAEH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAK/D"}
package/lib/writeJson.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import fs from 'fs';
2
2
  import fsPromises from 'fs/promises';
3
3
  import path from 'path';
4
- import { ensureDir, ensureDirSync } from 'fs-extra';
4
+ import fsExtra from 'fs-extra';
5
5
  /**
6
6
  * Writes json to a path. Ensures the path exists.
7
7
  */
8
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
9
  export async function writeJson(filePath, data) {
10
10
  const folderPath = path.dirname(filePath);
11
- await ensureDir(folderPath);
11
+ await fsExtra.ensureDir(folderPath);
12
12
  await fsPromises.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');
13
13
  }
14
14
  /**
@@ -17,7 +17,7 @@ export async function writeJson(filePath, data) {
17
17
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
18
  export function writeJsonSync(filePath, data) {
19
19
  const folderPath = path.dirname(filePath);
20
- ensureDirSync(folderPath);
20
+ fsExtra.ensureDirSync(folderPath);
21
21
  fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8');
22
22
  }
23
23
  //# sourceMappingURL=writeJson.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeJson.js","sourceRoot":"","sources":["../src/writeJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpD;;GAEG;AACH,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,IAAS;IACzD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC;IAC5B,MAAM,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAS;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE1C,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1B,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import fs from 'fs';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { ensureDir, ensureDirSync } from 'fs-extra';\n\n/**\n * Writes json to a path. Ensures the path exists.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function writeJson(filePath: string, data: any): Promise<void> {\n const folderPath = path.dirname(filePath);\n\n await ensureDir(folderPath);\n await fsPromises.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');\n}\n\n/**\n * Synchronously writes json to a path. Ensures the path exists.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function writeJsonSync(filePath: string, data: any): void {\n const folderPath = path.dirname(filePath);\n\n ensureDirSync(folderPath);\n fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8');\n}\n"]}
1
+ {"version":3,"file":"writeJson.js","sourceRoot":"","sources":["../src/writeJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B;;GAEG;AACH,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,IAAS;IACzD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAS;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE1C,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAClC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import fs from 'fs';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport fsExtra from 'fs-extra';\n\n/**\n * Writes json to a path. Ensures the path exists.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function writeJson(filePath: string, data: any): Promise<void> {\n const folderPath = path.dirname(filePath);\n\n await fsExtra.ensureDir(folderPath);\n await fsPromises.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');\n}\n\n/**\n * Synchronously writes json to a path. Ensures the path exists.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function writeJsonSync(filePath: string, data: any): void {\n const folderPath = path.dirname(filePath);\n\n fsExtra.ensureDirSync(folderPath);\n fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/json-utilities",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Helpers for reading/writing json files.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,6 +8,7 @@
8
8
  "sideEffects": false,
9
9
  "exports": {
10
10
  ".": {
11
+ "source": "./src/index.ts",
11
12
  "types": "./lib/index.d.ts",
12
13
  "import": "./lib/index.js"
13
14
  }
@@ -16,11 +17,10 @@
16
17
  "fs-extra": "^11.0.0"
17
18
  },
18
19
  "devDependencies": {
19
- "@ms-cloudpack/eslint-config-base": "*",
20
+ "@ms-cloudpack/eslint-plugin-internal": "*",
20
21
  "@ms-cloudpack/scripts": "*"
21
22
  },
22
23
  "scripts": {
23
- "api:update": "cloudpack-scripts api-update",
24
24
  "api": "cloudpack-scripts api",
25
25
  "build:watch": "cloudpack-scripts build-watch",
26
26
  "build": "cloudpack-scripts build",