@agoric/internal 0.3.3-dev-5e6a1e1.0.5e6a1e1 → 0.3.3-dev-0dccf64.0.0dccf64
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/internal",
|
|
3
|
-
"version": "0.3.3-dev-
|
|
3
|
+
"version": "0.3.3-dev-0dccf64.0.0dccf64",
|
|
4
4
|
"description": "Externally unsupported utilities internal to agoric-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"lint:types": "yarn run -T tsc"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agoric/base-zone": "0.1.1-dev-
|
|
23
|
+
"@agoric/base-zone": "0.1.1-dev-0dccf64.0.0dccf64",
|
|
24
24
|
"@endo/cache-map": "^1.1.0",
|
|
25
25
|
"@endo/common": "^1.2.13",
|
|
26
26
|
"@endo/compartment-mapper": "^1.6.3",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"jessie.js": "^0.3.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
41
|
+
"@agoric/cosmic-proto": "0.4.1-dev-0dccf64.0.0dccf64",
|
|
42
42
|
"@endo/exo": "^1.5.12",
|
|
43
43
|
"@endo/init": "^1.1.12",
|
|
44
44
|
"@endo/ses-ava": "^1.3.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"typeCoverage": {
|
|
67
67
|
"atLeast": 92.84
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "0dccf64926ac58da475a8eb599300841f55ee84f"
|
|
70
70
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-json.d.ts","sourceRoot":"","sources":["read-json.js"],"names":[],"mappings":"AASO,iCAJO,CAAC,sBACJ,IAAI,CAAC,cAAc,kBAAkB,CAAC,EAAE,UAAU,CAAC,mBACnD,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAGlC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAOxC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build a function that reads and parses a JSON file.
|
|
5
|
+
*
|
|
6
|
+
* @template [U=ReturnType<typeof JSON.parse>]
|
|
7
|
+
* @param {Pick<typeof import('node:fs/promises'), 'readFile'>} fsp
|
|
8
|
+
* @param {(input: ReturnType<typeof JSON.parse>) => U} [resultReplacer]
|
|
9
|
+
*/
|
|
10
|
+
export const makeReadJsonFile = ({ readFile }, resultReplacer) => {
|
|
11
|
+
/** @type {(path: string) => Promise<U>} */
|
|
12
|
+
const readJsonFile = async path => {
|
|
13
|
+
const text = await readFile(path, 'utf8');
|
|
14
|
+
const result = JSON.parse(text);
|
|
15
|
+
return resultReplacer ? resultReplacer(result) : /** @type {U} */ (result);
|
|
16
|
+
};
|
|
17
|
+
return readJsonFile;
|
|
18
|
+
};
|