@effect-vfs/core 0.2.0 → 0.3.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/BytePath.d.ts +49 -5
- package/dist/BytePath.d.ts.map +1 -1
- package/dist/BytePath.js +9 -9
- package/dist/Snapshot.d.ts +61 -5
- package/dist/Snapshot.d.ts.map +1 -1
- package/dist/Snapshot.js +60 -5
- package/dist/SnapshotDelta.d.ts +208 -31
- package/dist/SnapshotDelta.d.ts.map +1 -1
- package/dist/SnapshotDelta.js +162 -25
- package/dist/VirtualFileSystem.d.ts +1035 -348
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +620 -1772
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/bytePath.d.ts +10 -0
- package/dist/internal/bytePath.d.ts.map +1 -0
- package/dist/internal/bytePath.js +41 -0
- package/dist/internal/bytes.d.ts +6 -0
- package/dist/internal/bytes.d.ts.map +1 -0
- package/dist/internal/bytes.js +17 -0
- package/dist/internal/canonicalBase64.d.ts +14 -6
- package/dist/internal/canonicalBase64.d.ts.map +1 -1
- package/dist/internal/canonicalBase64.js +29 -7
- package/dist/internal/image.d.ts +85 -104
- package/dist/internal/image.d.ts.map +1 -1
- package/dist/internal/image.js +99 -95
- package/dist/internal/metadata.d.ts +28 -0
- package/dist/internal/metadata.d.ts.map +1 -0
- package/dist/internal/metadata.js +29 -0
- package/dist/internal/snapshotDelta.d.ts +0 -1
- package/dist/internal/snapshotDelta.d.ts.map +1 -1
- package/dist/internal/snapshotDelta.js +358 -325
- package/dist/internal/snapshotDeltaModel.d.ts +10 -0
- package/dist/internal/snapshotDeltaModel.d.ts.map +1 -0
- package/dist/internal/snapshotDeltaModel.js +15 -0
- package/dist/internal/virtualFileSystem/errors.d.ts +31 -0
- package/dist/internal/virtualFileSystem/errors.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/errors.js +51 -0
- package/dist/internal/virtualFileSystem/fixture.d.ts +63 -0
- package/dist/internal/virtualFileSystem/fixture.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/fixture.js +144 -0
- package/dist/internal/{content.d.ts → virtualFileSystem/overlayContent.d.ts} +4 -14
- package/dist/internal/virtualFileSystem/overlayContent.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/overlayContent.js +29 -0
- package/dist/internal/{overlayChanges.d.ts → virtualFileSystem/overlayDiff.d.ts} +3 -12
- package/dist/internal/virtualFileSystem/overlayDiff.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/overlayDiff.js +120 -0
- package/dist/internal/virtualFileSystem/path.d.ts +44 -0
- package/dist/internal/virtualFileSystem/path.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/path.js +127 -0
- package/dist/internal/virtualFileSystem/testHooks.d.ts +20 -0
- package/dist/internal/virtualFileSystem/testHooks.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/testHooks.js +23 -0
- package/dist/internal/virtualFileSystem/watchHub.d.ts +16 -0
- package/dist/internal/virtualFileSystem/watchHub.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem/watchHub.js +33 -0
- package/dist/internal/virtualFileSystem.d.ts +366 -0
- package/dist/internal/virtualFileSystem.d.ts.map +1 -0
- package/dist/internal/virtualFileSystem.js +1755 -0
- package/package.json +15 -5
- package/dist/internal/content.d.ts.map +0 -1
- package/dist/internal/content.js +0 -26
- package/dist/internal/overlayChanges.d.ts.map +0 -1
- package/dist/internal/overlayChanges.js +0 -146
- package/dist/internal/overlayTesting.d.ts +0 -12
- package/dist/internal/overlayTesting.d.ts.map +0 -1
- package/dist/internal/overlayTesting.js +0 -12
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-vfs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A runtime-neutral virtual filesystem core for Effect.",
|
|
5
5
|
"homepage": "https://github.com/lloydrichards/effect-virtual-fs#readme",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/lloydrichards/effect-virtual-fs/issues"
|
|
8
8
|
},
|
|
9
|
-
"keywords": [
|
|
9
|
+
"keywords": [
|
|
10
|
+
"effect",
|
|
11
|
+
"filesystem",
|
|
12
|
+
"virtual-filesystem",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
10
15
|
"type": "module",
|
|
11
16
|
"sideEffects": false,
|
|
12
17
|
"license": "MIT",
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
"types": "./dist/index.d.ts",
|
|
16
21
|
"scripts": {
|
|
17
22
|
"build": "tsc --project tsconfig.build.json && tsc --project compatibility/node-next/tsconfig.json",
|
|
18
|
-
"clean": "git clean -xdf .cache .turbo dist node_modules tsconfig.tsbuildinfo",
|
|
23
|
+
"clean": "git clean -xdf .cache .turbo dist docs node_modules tsconfig.tsbuildinfo",
|
|
19
24
|
"test": "vitest run",
|
|
20
25
|
"type-check": "tsc --noEmit && tsc --project contracts/tsconfig.json"
|
|
21
26
|
},
|
|
@@ -24,8 +29,9 @@
|
|
|
24
29
|
},
|
|
25
30
|
"devDependencies": {
|
|
26
31
|
"@effect/platform-bun": "4.0.0-rc.114",
|
|
27
|
-
"@
|
|
32
|
+
"@effect/platform-node-shared": "4.0.0-rc.114",
|
|
28
33
|
"@effect/vitest": "4.0.0-rc.114",
|
|
34
|
+
"@repo/config-typescript": "workspace:*",
|
|
29
35
|
"effect": "4.0.0-rc.114"
|
|
30
36
|
},
|
|
31
37
|
"exports": {
|
|
@@ -42,7 +48,11 @@
|
|
|
42
48
|
"./*/index": null,
|
|
43
49
|
"./package.json": "./package.json"
|
|
44
50
|
},
|
|
45
|
-
"files": [
|
|
51
|
+
"files": [
|
|
52
|
+
"dist/**",
|
|
53
|
+
"README.md",
|
|
54
|
+
"LICENSE"
|
|
55
|
+
],
|
|
46
56
|
"publishConfig": {
|
|
47
57
|
"access": "public"
|
|
48
58
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/internal/content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,gBAAgB;AAChB,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAC3B;AAID,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,aAAc,QAAQ,KAAG,OAAwC,CAAA;AAEhG,gBAAgB;AAChB,eAAO,MAAM,IAAI,UAAW,UAAU,KAAG,OAAsB,CAAA;AAE/D,gBAAgB;AAChB,eAAO,MAAM,KAAK,QAAO,OAAkC,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,UAAU,aAAc,QAAQ,SAAS,KAAK,CAAC,QAAQ,KAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CASjG,CAAA"}
|
package/dist/internal/content.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as Image from "./image.js";
|
|
2
|
-
const overlayContents = new WeakMap();
|
|
3
|
-
/** @internal */
|
|
4
|
-
export const hasOverlayContents = (snapshot) => overlayContents.has(snapshot);
|
|
5
|
-
/** @internal */
|
|
6
|
-
export const make = (bytes) => ({ bytes });
|
|
7
|
-
/** @internal */
|
|
8
|
-
export const empty = () => make(new Uint8Array(0));
|
|
9
|
-
/**
|
|
10
|
-
* Returns the immutable file payloads associated with the identity of a base
|
|
11
|
-
* snapshot. The cache is weak so it cannot extend the snapshot's lifetime.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export const forOverlay = (snapshot, image) => {
|
|
16
|
-
const cached = overlayContents.get(snapshot);
|
|
17
|
-
if (cached !== undefined)
|
|
18
|
-
return cached;
|
|
19
|
-
const decoded = new Map();
|
|
20
|
-
for (const record of image.records) {
|
|
21
|
-
if (record.kind === "file")
|
|
22
|
-
decoded.set(record.id, make(Image.bytes(record.data)));
|
|
23
|
-
}
|
|
24
|
-
overlayContents.set(snapshot, decoded);
|
|
25
|
-
return decoded;
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlayChanges.d.ts","sourceRoot":"","sources":["../../src/internal/overlayChanges.ts"],"names":[],"mappings":"AAGA,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAAA;IAC/C,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAA;CACvC;AAED,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAA;AAEtH,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CAAE,GAC9F;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CAAE,GAChG;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC7C,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC5C,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;CACvD,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;CACvD,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;CACvD,CAAA;AA4EH,gBAAgB;AAChB,eAAO,MAAM,cAAc,SACnB,aAAa,CAAC,gBAAgB,CAAC,WAC5B,aAAa,CAAC,gBAAgB,CAAC,kCAEvC,aAAa,CAAC,gBAAgB,CAoEhC,CAAA"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import * as Encoding from "effect/Encoding";
|
|
2
|
-
import * as Equal from "effect/Equal";
|
|
3
|
-
const timestampFields = new Set(["atimeNs", "mtimeNs", "ctimeNs", "birthtimeNs"]);
|
|
4
|
-
const differenceOrder = [
|
|
5
|
-
"content",
|
|
6
|
-
"mode",
|
|
7
|
-
"uid",
|
|
8
|
-
"gid",
|
|
9
|
-
"atimeNs",
|
|
10
|
-
"mtimeNs",
|
|
11
|
-
"ctimeNs",
|
|
12
|
-
"birthtimeNs"
|
|
13
|
-
];
|
|
14
|
-
const tagOrder = {
|
|
15
|
-
Added: 0,
|
|
16
|
-
Removed: 1,
|
|
17
|
-
Replaced: 2,
|
|
18
|
-
Renamed: 3,
|
|
19
|
-
Updated: 4
|
|
20
|
-
};
|
|
21
|
-
const key = Encoding.encodeHex;
|
|
22
|
-
const comparePaths = (left, right) => {
|
|
23
|
-
const length = Math.min(left.length, right.length);
|
|
24
|
-
for (let index = 0; index < length; index++) {
|
|
25
|
-
const difference = left[index] - right[index];
|
|
26
|
-
if (difference !== 0)
|
|
27
|
-
return difference;
|
|
28
|
-
}
|
|
29
|
-
return left.length - right.length;
|
|
30
|
-
};
|
|
31
|
-
const sameBytes = (left, right) => {
|
|
32
|
-
return Equal.equals(left, right);
|
|
33
|
-
};
|
|
34
|
-
const differences = (before, after, includeTimestamps) => differenceOrder.filter((field) => {
|
|
35
|
-
if (!includeTimestamps && timestampFields.has(field))
|
|
36
|
-
return false;
|
|
37
|
-
if (field === "content")
|
|
38
|
-
return before.kind !== after.kind || !sameBytes(before.content, after.content);
|
|
39
|
-
return before.metadata[field] !== after.metadata[field];
|
|
40
|
-
});
|
|
41
|
-
const byLineage = (entries) => {
|
|
42
|
-
const result = new Map();
|
|
43
|
-
for (const entry of entries) {
|
|
44
|
-
if (entry.lineage === undefined)
|
|
45
|
-
continue;
|
|
46
|
-
const group = result.get(entry.lineage);
|
|
47
|
-
if (group === undefined)
|
|
48
|
-
result.set(entry.lineage, new Map([[key(entry.path), entry]]));
|
|
49
|
-
else
|
|
50
|
-
group.set(key(entry.path), entry);
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
53
|
-
};
|
|
54
|
-
const copyChange = (change) => {
|
|
55
|
-
switch (change._tag) {
|
|
56
|
-
case "Added":
|
|
57
|
-
case "Removed":
|
|
58
|
-
return Object.freeze({ ...change, path: change.path.slice() });
|
|
59
|
-
case "Replaced":
|
|
60
|
-
case "Updated":
|
|
61
|
-
return Object.freeze({
|
|
62
|
-
...change,
|
|
63
|
-
path: change.path.slice(),
|
|
64
|
-
differences: Object.freeze([...change.differences])
|
|
65
|
-
});
|
|
66
|
-
case "Renamed":
|
|
67
|
-
return Object.freeze({
|
|
68
|
-
...change,
|
|
69
|
-
from: change.from.slice(),
|
|
70
|
-
to: change.to.slice(),
|
|
71
|
-
differences: Object.freeze([...change.differences])
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
/** @internal */
|
|
76
|
-
export const compareOverlay = (base, current, includeTimestamps = false) => {
|
|
77
|
-
const basePaths = new Map(base.map((entry) => [key(entry.path), entry]));
|
|
78
|
-
const currentPaths = new Map(current.map((entry) => [key(entry.path), entry]));
|
|
79
|
-
const baseLineages = byLineage(base);
|
|
80
|
-
const currentLineages = byLineage(current);
|
|
81
|
-
const consumedBase = new Set();
|
|
82
|
-
const consumedCurrent = new Set();
|
|
83
|
-
const changes = [];
|
|
84
|
-
for (const [lineage, beforeEntries] of baseLineages) {
|
|
85
|
-
const afterEntries = currentLineages.get(lineage);
|
|
86
|
-
if (afterEntries === undefined)
|
|
87
|
-
continue;
|
|
88
|
-
const removed = [...beforeEntries].filter(([pathKey]) => !afterEntries.has(pathKey)).map(([, entry]) => entry);
|
|
89
|
-
const added = [...afterEntries].filter(([pathKey]) => !beforeEntries.has(pathKey)).map(([, entry]) => entry);
|
|
90
|
-
if (removed.length !== 1 || added.length !== 1)
|
|
91
|
-
continue;
|
|
92
|
-
const before = removed[0];
|
|
93
|
-
const after = added[0];
|
|
94
|
-
consumedBase.add(key(before.path));
|
|
95
|
-
consumedCurrent.add(key(after.path));
|
|
96
|
-
changes.push({
|
|
97
|
-
_tag: "Renamed",
|
|
98
|
-
from: before.path,
|
|
99
|
-
to: after.path,
|
|
100
|
-
kind: after.kind,
|
|
101
|
-
differences: differences(before, after, includeTimestamps)
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
for (const before of base) {
|
|
105
|
-
const pathKey = key(before.path);
|
|
106
|
-
if (consumedBase.has(pathKey))
|
|
107
|
-
continue;
|
|
108
|
-
const after = currentPaths.get(pathKey);
|
|
109
|
-
if (after === undefined || consumedCurrent.has(pathKey)) {
|
|
110
|
-
changes.push({ _tag: "Removed", path: before.path, kind: before.kind });
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
consumedCurrent.add(pathKey);
|
|
114
|
-
if (before.lineage === undefined || before.lineage !== after.lineage) {
|
|
115
|
-
changes.push({
|
|
116
|
-
_tag: "Replaced",
|
|
117
|
-
path: before.path,
|
|
118
|
-
beforeKind: before.kind,
|
|
119
|
-
afterKind: after.kind,
|
|
120
|
-
differences: differences(before, after, includeTimestamps)
|
|
121
|
-
});
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
const changed = differences(before, after, includeTimestamps);
|
|
125
|
-
if (changed.length > 0)
|
|
126
|
-
changes.push({ _tag: "Updated", path: before.path, kind: after.kind, differences: changed });
|
|
127
|
-
}
|
|
128
|
-
for (const after of current) {
|
|
129
|
-
const pathKey = key(after.path);
|
|
130
|
-
if (!consumedCurrent.has(pathKey) && (!basePaths.has(pathKey) || consumedBase.has(pathKey))) {
|
|
131
|
-
changes.push({ _tag: "Added", path: after.path, kind: after.kind });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
changes.sort((left, right) => {
|
|
135
|
-
const leftPath = left._tag === "Renamed" ? left.from : left.path;
|
|
136
|
-
const rightPath = right._tag === "Renamed" ? right.from : right.path;
|
|
137
|
-
const pathOrder = comparePaths(leftPath, rightPath);
|
|
138
|
-
if (pathOrder !== 0)
|
|
139
|
-
return pathOrder;
|
|
140
|
-
const typeOrder = tagOrder[left._tag] - tagOrder[right._tag];
|
|
141
|
-
if (typeOrder !== 0)
|
|
142
|
-
return typeOrder;
|
|
143
|
-
return left._tag === "Renamed" && right._tag === "Renamed" ? comparePaths(left.to, right.to) : 0;
|
|
144
|
-
});
|
|
145
|
-
return Object.freeze(changes.map(copyChange));
|
|
146
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Package-internal synchronization hooks for deterministic overlay tests. @internal */
|
|
2
|
-
import type * as Effect from "effect/Effect";
|
|
3
|
-
import type { Snapshot } from "../Snapshot.js";
|
|
4
|
-
/** @internal */
|
|
5
|
-
export interface ObservationHook {
|
|
6
|
-
readonly betweenSnapshotAndSummary: Effect.Effect<void>;
|
|
7
|
-
}
|
|
8
|
-
/** @internal */
|
|
9
|
-
export declare const getObservationHook: (snapshot: Snapshot) => ObservationHook | undefined;
|
|
10
|
-
/** @internal */
|
|
11
|
-
export declare const setObservationHook: (snapshot: Snapshot, hook: ObservationHook) => () => void;
|
|
12
|
-
//# sourceMappingURL=overlayTesting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlayTesting.d.ts","sourceRoot":"","sources":["../../src/internal/overlayTesting.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAExF,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAE9C,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CACxD;AAID,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,aAAc,QAAQ,KAAG,eAAe,GAAG,SAA2C,CAAA;AAErH,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,aAAc,QAAQ,QAAQ,eAAe,KAAG,MAAM,IAKpF,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Package-internal synchronization hooks for deterministic overlay tests. @internal */
|
|
2
|
-
const observationHooks = new WeakMap();
|
|
3
|
-
/** @internal */
|
|
4
|
-
export const getObservationHook = (snapshot) => observationHooks.get(snapshot);
|
|
5
|
-
/** @internal */
|
|
6
|
-
export const setObservationHook = (snapshot, hook) => {
|
|
7
|
-
observationHooks.set(snapshot, hook);
|
|
8
|
-
return () => {
|
|
9
|
-
if (observationHooks.get(snapshot) === hook)
|
|
10
|
-
observationHooks.delete(snapshot);
|
|
11
|
-
};
|
|
12
|
-
};
|