@agoric/internal 0.3.3-dev-75e8d38.0 → 0.3.3-dev-9825f6d.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/internal",
3
- "version": "0.3.3-dev-75e8d38.0+75e8d38",
3
+ "version": "0.3.3-dev-9825f6d.0+9825f6d",
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": "tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@agoric/base-zone": "0.1.1-dev-75e8d38.0+75e8d38",
23
+ "@agoric/base-zone": "0.1.1-dev-9825f6d.0+9825f6d",
24
24
  "@endo/common": "^1.2.9",
25
25
  "@endo/errors": "^1.2.9",
26
26
  "@endo/far": "^1.1.10",
@@ -34,7 +34,7 @@
34
34
  "jessie.js": "^0.3.4"
35
35
  },
36
36
  "devDependencies": {
37
- "@agoric/cosmic-proto": "0.4.1-dev-75e8d38.0+75e8d38",
37
+ "@agoric/cosmic-proto": "0.4.1-dev-9825f6d.0+9825f6d",
38
38
  "@endo/exo": "^1.5.8",
39
39
  "@endo/init": "^1.1.8",
40
40
  "@fast-check/ava": "^2.0.1",
@@ -61,5 +61,5 @@
61
61
  "typeCoverage": {
62
62
  "atLeast": 92.65
63
63
  },
64
- "gitHead": "75e8d388b2e48420f325aae6978d047cf7fe4d33"
64
+ "gitHead": "9825f6d2809327a397ed0aa9a25ebc101cf48b59"
65
65
  }
package/src/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from "./errors.js";
4
4
  export * from "./js-utils.js";
5
5
  export * from "./method-tools.js";
6
6
  export * from "./ses-utils.js";
7
+ export * from "./tmpDir.js";
7
8
  export * from "./typeCheck.js";
8
9
  export * from "./typeGuards.js";
9
10
  export * from "./types-index.js";
package/src/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './js-utils.js';
9
9
  export { pureDataMarshaller } from './marshal.js';
10
10
  export * from './method-tools.js';
11
11
  export * from './ses-utils.js';
12
+ export * from './tmpDir.js';
12
13
  export * from './typeCheck.js';
13
14
  export * from './typeGuards.js';
14
15
 
@@ -0,0 +1,2 @@
1
+ export function makeTempDirFactory(tmp: Pick<typeof import("tmp"), "dirSync">): (prefix?: string) => [dirName: string, cleanup: () => void];
2
+ //# sourceMappingURL=tmpDir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmpDir.d.ts","sourceRoot":"","sources":["tmpDir.js"],"names":[],"mappings":"AAMO,wCAFI,IAAI,CAAC,oBAAa,EAAE,SAAS,CAAC,aAGlB,MAAM,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,CASvE"}
package/src/tmpDir.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Create a `tmpDir` function that synchronously creates a temporary directory
3
+ * and a function for deleting it along with any added contents.
4
+ *
5
+ * @param {Pick<import('tmp'), 'dirSync'>} tmp
6
+ */
7
+ export const makeTempDirFactory = tmp => {
8
+ /** @type {(prefix?: string) => [dirName: string, cleanup: () => void]} */
9
+ const tmpDir = prefix => {
10
+ const { name, removeCallback } = tmp.dirSync({
11
+ prefix,
12
+ unsafeCleanup: true,
13
+ });
14
+ return [name, removeCallback];
15
+ };
16
+ return tmpDir;
17
+ };