@fluidframework/runtime-utils 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.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/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +30 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/runtime-utils.api.md +10 -11
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -39
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/runtime-utils-alpha.d.ts +5 -3
- package/dist/runtime-utils-beta.d.ts +5 -3
- package/dist/runtime-utils-public.d.ts +5 -3
- package/dist/runtime-utils-untrimmed.d.ts +34 -9
- package/dist/summaryUtils.d.ts +18 -8
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +34 -9
- package/dist/summaryUtils.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/utils.d.ts +14 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +49 -1
- package/dist/utils.js.map +1 -1
- package/lib/{dataStoreHandleContextUtils.d.mts → dataStoreHandleContextUtils.d.ts} +1 -1
- package/lib/dataStoreHandleContextUtils.d.ts.map +1 -0
- package/lib/{dataStoreHandleContextUtils.mjs → dataStoreHandleContextUtils.js} +1 -1
- package/lib/dataStoreHandleContextUtils.js.map +1 -0
- package/lib/{dataStoreHelpers.d.mts → dataStoreHelpers.d.ts} +1 -1
- package/lib/dataStoreHelpers.d.ts.map +1 -0
- package/lib/{dataStoreHelpers.mjs → dataStoreHelpers.js} +1 -1
- package/lib/dataStoreHelpers.js.map +1 -0
- package/lib/{handles.d.mts → handles.d.ts} +1 -1
- package/lib/handles.d.ts.map +1 -0
- package/lib/{handles.mjs → handles.js} +1 -1
- package/lib/handles.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/lib/{objectstoragepartition.d.mts → objectstoragepartition.d.ts} +1 -1
- package/lib/objectstoragepartition.d.ts.map +1 -0
- package/lib/{objectstoragepartition.mjs → objectstoragepartition.js} +1 -1
- package/lib/objectstoragepartition.js.map +1 -0
- package/lib/{objectstorageutils.d.mts → objectstorageutils.d.ts} +1 -1
- package/lib/objectstorageutils.d.ts.map +1 -0
- package/lib/{objectstorageutils.mjs → objectstorageutils.js} +1 -1
- package/lib/objectstorageutils.js.map +1 -0
- package/lib/{requestParser.d.mts → requestParser.d.ts} +5 -1
- package/lib/requestParser.d.ts.map +1 -0
- package/lib/{requestParser.mjs → requestParser.js} +1 -1
- package/lib/requestParser.js.map +1 -0
- package/lib/{runtime-utils-alpha.d.mts → runtime-utils-alpha.d.ts} +5 -3
- package/lib/{runtime-utils-beta.d.mts → runtime-utils-beta.d.ts} +5 -3
- package/lib/{runtime-utils-public.d.mts → runtime-utils-public.d.ts} +5 -3
- package/lib/{runtime-utils-untrimmed.d.mts → runtime-utils-untrimmed.d.ts} +34 -9
- package/lib/{runtimeFactoryHelper.d.mts → runtimeFactoryHelper.d.ts} +1 -1
- package/lib/runtimeFactoryHelper.d.ts.map +1 -0
- package/lib/{runtimeFactoryHelper.mjs → runtimeFactoryHelper.js} +1 -1
- package/lib/runtimeFactoryHelper.js.map +1 -0
- package/lib/{summaryUtils.d.mts → summaryUtils.d.ts} +19 -9
- package/lib/summaryUtils.d.ts.map +1 -0
- package/lib/{summaryUtils.mjs → summaryUtils.js} +34 -9
- package/lib/summaryUtils.js.map +1 -0
- package/lib/test/dataStoreHelpers.spec.js +29 -0
- package/lib/test/dataStoreHelpers.spec.js.map +1 -0
- package/lib/test/requestParser.spec.js +111 -0
- package/lib/test/requestParser.spec.js.map +1 -0
- package/lib/test/runtimeFactoryHelper.spec.js +44 -0
- package/lib/test/runtimeFactoryHelper.spec.js.map +1 -0
- package/lib/test/summaryUtils.spec.js +283 -0
- package/lib/test/summaryUtils.spec.js.map +1 -0
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js +58 -0
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js.map +1 -0
- package/lib/test/utils.spec.js +65 -0
- package/lib/test/utils.spec.js.map +1 -0
- package/lib/{unpackUsedRoutes.d.mts → unpackUsedRoutes.d.ts} +1 -1
- package/lib/unpackUsedRoutes.d.ts.map +1 -0
- package/lib/{unpackUsedRoutes.mjs → unpackUsedRoutes.js} +1 -1
- package/lib/unpackUsedRoutes.js.map +1 -0
- package/lib/utils.d.ts +34 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +64 -0
- package/lib/utils.js.map +1 -0
- package/package.json +48 -49
- package/src/index.ts +11 -11
- package/src/summaryUtils.ts +48 -18
- package/src/utils.ts +48 -0
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/dataStoreHandleContextUtils.d.mts.map +0 -1
- package/lib/dataStoreHandleContextUtils.mjs.map +0 -1
- package/lib/dataStoreHelpers.d.mts.map +0 -1
- package/lib/dataStoreHelpers.mjs.map +0 -1
- package/lib/handles.d.mts.map +0 -1
- package/lib/handles.mjs.map +0 -1
- package/lib/index.d.mts +0 -15
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -15
- package/lib/index.mjs.map +0 -1
- package/lib/objectstoragepartition.d.mts.map +0 -1
- package/lib/objectstoragepartition.mjs.map +0 -1
- package/lib/objectstorageutils.d.mts.map +0 -1
- package/lib/objectstorageutils.mjs.map +0 -1
- package/lib/requestParser.d.mts.map +0 -1
- package/lib/requestParser.mjs.map +0 -1
- package/lib/runtimeFactoryHelper.d.mts.map +0 -1
- package/lib/runtimeFactoryHelper.mjs.map +0 -1
- package/lib/summaryUtils.d.mts.map +0 -1
- package/lib/summaryUtils.mjs.map +0 -1
- package/lib/unpackUsedRoutes.d.mts.map +0 -1
- package/lib/unpackUsedRoutes.mjs.map +0 -1
- package/lib/utils.d.mts +0 -20
- package/lib/utils.d.mts.map +0 -1
- package/lib/utils.mjs +0 -17
- package/lib/utils.mjs.map +0 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { strict as assert } from "assert";
|
|
6
|
+
import { IsoBuffer, stringToBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
7
|
+
import { BlobTreeEntry, TreeTreeEntry } from "@fluidframework/driver-utils";
|
|
8
|
+
import { SummaryType, } from "@fluidframework/protocol-definitions";
|
|
9
|
+
import { convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, convertToSummaryTree, TelemetryContext, utf8ByteLength, } from "../summaryUtils.js";
|
|
10
|
+
describe("Summary Utils", () => {
|
|
11
|
+
function assertSummaryTree(obj) {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
13
|
+
if (obj && obj.type === SummaryType.Tree) {
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
assert.fail("Object should be summary tree");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function assertSummaryBlob(obj) {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
22
|
+
if (obj && obj.type === SummaryType.Blob) {
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
assert.fail("Object should be summary blob");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function assertSummaryHandle(obj) {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
31
|
+
if (obj && obj.type === SummaryType.Handle) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
assert.fail("Object should be summary handle");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
describe("ITree <-> ISummaryTree", () => {
|
|
39
|
+
let tree;
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
const base64Content = IsoBuffer.from("test-b64").toString("base64");
|
|
42
|
+
tree = {
|
|
43
|
+
entries: [
|
|
44
|
+
new TreeTreeEntry("t", {
|
|
45
|
+
entries: [
|
|
46
|
+
new BlobTreeEntry("bu8", "test-u8"),
|
|
47
|
+
new BlobTreeEntry("b64", base64Content, "base64"),
|
|
48
|
+
new TreeTreeEntry("tu", {
|
|
49
|
+
entries: [],
|
|
50
|
+
unreferenced: true,
|
|
51
|
+
groupId: undefined,
|
|
52
|
+
}),
|
|
53
|
+
],
|
|
54
|
+
unreferenced: undefined,
|
|
55
|
+
groupId: undefined,
|
|
56
|
+
}),
|
|
57
|
+
new BlobTreeEntry("b", "test-blob"),
|
|
58
|
+
new TreeTreeEntry("h", {
|
|
59
|
+
id: "test-handle",
|
|
60
|
+
entries: [new BlobTreeEntry("ignore", "this-should-be-ignored")],
|
|
61
|
+
}),
|
|
62
|
+
new TreeTreeEntry("unref", {
|
|
63
|
+
entries: [],
|
|
64
|
+
unreferenced: true,
|
|
65
|
+
groupId: undefined,
|
|
66
|
+
}),
|
|
67
|
+
new TreeTreeEntry("groupId", {
|
|
68
|
+
entries: [],
|
|
69
|
+
unreferenced: undefined,
|
|
70
|
+
groupId: "group-id",
|
|
71
|
+
}),
|
|
72
|
+
],
|
|
73
|
+
unreferenced: undefined,
|
|
74
|
+
groupId: undefined,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
it("Should convert ITree to ISummaryTree correctly", () => {
|
|
78
|
+
const summaryResults = convertToSummaryTree(tree);
|
|
79
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
80
|
+
// blobs should parse
|
|
81
|
+
const blob = assertSummaryBlob(summaryTree.tree.b);
|
|
82
|
+
assert.strictEqual(blob.content, "test-blob");
|
|
83
|
+
// trees with ids should become handles
|
|
84
|
+
const handle = assertSummaryHandle(summaryTree.tree.h);
|
|
85
|
+
assert.strictEqual(handle.handleType, SummaryType.Tree);
|
|
86
|
+
assert.strictEqual(handle.handle, "test-handle");
|
|
87
|
+
// subtrees should recurse
|
|
88
|
+
const subTree = assertSummaryTree(summaryTree.tree.t);
|
|
89
|
+
const subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);
|
|
90
|
+
assert.strictEqual(subBlobUtf8.content, "test-u8");
|
|
91
|
+
const subBlobBase64 = assertSummaryBlob(subTree.tree.b64);
|
|
92
|
+
assert.strictEqual(Uint8ArrayToString(subBlobBase64.content), "test-b64");
|
|
93
|
+
const subTreeUnref = assertSummaryTree(subTree.tree.tu);
|
|
94
|
+
assert.strictEqual(Object.keys(subTreeUnref.tree).length, 0, "There should be no entries in tu subtree");
|
|
95
|
+
});
|
|
96
|
+
it("Should convert ITree to ISummaryTree correctly with fullTree enabled", () => {
|
|
97
|
+
const summaryResults = convertToSummaryTree(tree, true);
|
|
98
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
99
|
+
// blobs should parse
|
|
100
|
+
const blob = assertSummaryBlob(summaryTree.tree.b);
|
|
101
|
+
assert.strictEqual(blob.content, "test-blob");
|
|
102
|
+
// trees with ids should not become handles
|
|
103
|
+
const usuallyIgnoredSubtree = assertSummaryTree(summaryTree.tree.h);
|
|
104
|
+
const usuallyIgnoredBlob = assertSummaryBlob(usuallyIgnoredSubtree.tree.ignore);
|
|
105
|
+
assert.strictEqual(usuallyIgnoredBlob.content, "this-should-be-ignored");
|
|
106
|
+
// subtrees should recurse
|
|
107
|
+
const subTree = assertSummaryTree(summaryTree.tree.t);
|
|
108
|
+
const subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);
|
|
109
|
+
assert.strictEqual(subBlobUtf8.content, "test-u8");
|
|
110
|
+
const subBlobBase64 = assertSummaryBlob(subTree.tree.b64);
|
|
111
|
+
assert.strictEqual(Uint8ArrayToString(subBlobBase64.content), "test-b64");
|
|
112
|
+
const subUnrefTree = assertSummaryTree(subTree.tree.tu);
|
|
113
|
+
assert.strictEqual(Object.keys(subUnrefTree.tree).length, 0, "There should be no entries in tu subtree");
|
|
114
|
+
});
|
|
115
|
+
it("Should calculate summary data correctly", () => {
|
|
116
|
+
const summaryResults = convertToSummaryTree(tree);
|
|
117
|
+
// nodes should count
|
|
118
|
+
assert.strictEqual(summaryResults.stats.blobNodeCount, 3);
|
|
119
|
+
assert.strictEqual(summaryResults.stats.handleNodeCount, 1);
|
|
120
|
+
assert.strictEqual(summaryResults.stats.treeNodeCount, 5);
|
|
121
|
+
const bufferLength = IsoBuffer.from("test-b64").byteLength +
|
|
122
|
+
IsoBuffer.from("test-blob").byteLength +
|
|
123
|
+
IsoBuffer.from("test-u8").byteLength;
|
|
124
|
+
assert.strictEqual(summaryResults.stats.totalBlobSize, bufferLength);
|
|
125
|
+
});
|
|
126
|
+
it("should convert unreferenced state correctly", () => {
|
|
127
|
+
const summaryResults = convertToSummaryTree(tree);
|
|
128
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
129
|
+
assert.strictEqual(summaryTree.unreferenced, undefined, "The root summary tree should be referenced");
|
|
130
|
+
const subTreeT = assertSummaryTree(summaryTree.tree.t);
|
|
131
|
+
assert.strictEqual(subTreeT.unreferenced, undefined, "The t subtree should be referenced");
|
|
132
|
+
const subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);
|
|
133
|
+
assert.strictEqual(subTreeTUnrefTree.unreferenced, true, "The tu subtree of t should be referenced");
|
|
134
|
+
const subTreeUnref = assertSummaryTree(summaryTree.tree.unref);
|
|
135
|
+
assert.strictEqual(subTreeUnref.unreferenced, true, "The unref subtree should be unreferenced");
|
|
136
|
+
});
|
|
137
|
+
it("should convert ISummaryTree to ITree correctly", () => {
|
|
138
|
+
// convertSummaryTreeToITree API does not accept a tree with handles. So, remove handles from the ITree.
|
|
139
|
+
const treeWithoutHandles = {
|
|
140
|
+
entries: tree.entries.filter((treeEntry) => {
|
|
141
|
+
return treeEntry.path !== "h";
|
|
142
|
+
}),
|
|
143
|
+
unreferenced: undefined,
|
|
144
|
+
groupId: undefined,
|
|
145
|
+
};
|
|
146
|
+
const summaryResults = convertToSummaryTree(treeWithoutHandles);
|
|
147
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
148
|
+
// Covert the ISummaryTree back to ITree and validate that it matches with the original tree.
|
|
149
|
+
const iTree = convertSummaryTreeToITree(summaryTree);
|
|
150
|
+
assert.deepStrictEqual(treeWithoutHandles, iTree, "Could not covert back to ITree correctly");
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe("ISnapshotTree -> ISummaryTree", () => {
|
|
154
|
+
let snapshotTree;
|
|
155
|
+
beforeEach(() => {
|
|
156
|
+
snapshotTree = {
|
|
157
|
+
blobs: {
|
|
158
|
+
"b": "blob-b",
|
|
159
|
+
"blob-b": IsoBuffer.from("test-blob").toString("base64"),
|
|
160
|
+
},
|
|
161
|
+
trees: {
|
|
162
|
+
t: {
|
|
163
|
+
blobs: {
|
|
164
|
+
"bu8": "blob-bu8",
|
|
165
|
+
"blob-bu8": IsoBuffer.from("test-u8").toString("base64"),
|
|
166
|
+
"b64": "blob-b64",
|
|
167
|
+
"blob-b64": IsoBuffer.from("test-b64").toString("base64"),
|
|
168
|
+
},
|
|
169
|
+
trees: {
|
|
170
|
+
tu: {
|
|
171
|
+
blobs: {},
|
|
172
|
+
trees: {},
|
|
173
|
+
unreferenced: true,
|
|
174
|
+
groupId: undefined,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
unref: {
|
|
179
|
+
blobs: {},
|
|
180
|
+
trees: {},
|
|
181
|
+
unreferenced: true,
|
|
182
|
+
groupId: undefined,
|
|
183
|
+
},
|
|
184
|
+
groupId: {
|
|
185
|
+
blobs: {},
|
|
186
|
+
trees: {},
|
|
187
|
+
unreferenced: true,
|
|
188
|
+
groupId: "group-id",
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
it("Should convert correctly", () => {
|
|
194
|
+
const summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);
|
|
195
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
196
|
+
// blobs should parse
|
|
197
|
+
const blob = assertSummaryBlob(summaryTree.tree.b);
|
|
198
|
+
assert.strictEqual(blob.content, "test-blob");
|
|
199
|
+
// subtrees should recurse
|
|
200
|
+
const subTree = assertSummaryTree(summaryTree.tree.t);
|
|
201
|
+
const subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);
|
|
202
|
+
assert.strictEqual(subBlobUtf8.content, "test-u8");
|
|
203
|
+
const subBlobBase64 = assertSummaryBlob(subTree.tree.b64);
|
|
204
|
+
assert.strictEqual(Uint8ArrayToString(subBlobBase64.content), "test-b64");
|
|
205
|
+
const subTreeUnref = assertSummaryTree(subTree.tree.tu);
|
|
206
|
+
assert.strictEqual(Object.keys(subTreeUnref.tree).length, 0, "There should be no entries in tu subtree");
|
|
207
|
+
});
|
|
208
|
+
it("Should calculate summary data correctly", () => {
|
|
209
|
+
const summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);
|
|
210
|
+
// nodes should count
|
|
211
|
+
assert.strictEqual(summaryResults.stats.blobNodeCount, 3);
|
|
212
|
+
assert.strictEqual(summaryResults.stats.handleNodeCount, 0);
|
|
213
|
+
assert.strictEqual(summaryResults.stats.treeNodeCount, 5);
|
|
214
|
+
const bufferLength = IsoBuffer.from("test-b64").byteLength +
|
|
215
|
+
IsoBuffer.from("test-blob").byteLength +
|
|
216
|
+
IsoBuffer.from("test-u8").byteLength;
|
|
217
|
+
assert.strictEqual(summaryResults.stats.totalBlobSize, bufferLength);
|
|
218
|
+
});
|
|
219
|
+
it("should convert unreferenced state correctly", () => {
|
|
220
|
+
const summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);
|
|
221
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
222
|
+
assert.strictEqual(summaryTree.unreferenced, undefined, "The root summary tree should be referenced");
|
|
223
|
+
const subTreeT = assertSummaryTree(summaryTree.tree.t);
|
|
224
|
+
assert.strictEqual(subTreeT.unreferenced, undefined, "The t subtree should be referenced");
|
|
225
|
+
const subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);
|
|
226
|
+
assert.strictEqual(subTreeTUnrefTree.unreferenced, true, "The tu subtree of t should be referenced");
|
|
227
|
+
const subTreeUnref = assertSummaryTree(summaryTree.tree.unref);
|
|
228
|
+
assert.strictEqual(subTreeUnref.unreferenced, true, "The unref subtree should be unreferenced");
|
|
229
|
+
});
|
|
230
|
+
it("should convert groupId state correctly", () => {
|
|
231
|
+
const summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);
|
|
232
|
+
const summaryTree = assertSummaryTree(summaryResults.summary);
|
|
233
|
+
assert.strictEqual(summaryTree.groupId, undefined, "The root summary tree should not have groupId");
|
|
234
|
+
const subTreeT = assertSummaryTree(summaryTree.tree.t);
|
|
235
|
+
assert.strictEqual(subTreeT.groupId, undefined, "The t subtree not have groupId");
|
|
236
|
+
const subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);
|
|
237
|
+
assert.strictEqual(subTreeTUnrefTree.groupId, undefined, "The tu subtree of t not have groupId");
|
|
238
|
+
const subTreeUnref = assertSummaryTree(summaryTree.tree.unref);
|
|
239
|
+
assert.strictEqual(subTreeUnref.groupId, undefined, "The groupId should not be set");
|
|
240
|
+
const subTreeGroupId = assertSummaryTree(summaryTree.tree.groupId);
|
|
241
|
+
assert.strictEqual(subTreeGroupId.groupId, "group-id", "The groupId should be set");
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
describe("utf8ByteLength()", () => {
|
|
245
|
+
it("gives correct utf8 byte length", () => {
|
|
246
|
+
const a = [
|
|
247
|
+
"prague is a city in europe",
|
|
248
|
+
"ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ",
|
|
249
|
+
"Τὴ γλῶσσα μοῦ ἔδωσαν ἑλληνικὴ",
|
|
250
|
+
"На берегу пустынных волн",
|
|
251
|
+
"⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑",
|
|
252
|
+
"أنا قادر على أكل الزجاج و هذا لا يؤلمني.",
|
|
253
|
+
" 我能吞下玻璃而不傷身體。",
|
|
254
|
+
"ᐊᓕᒍᖅ ᓂᕆᔭᕌᖓᒃᑯ ᓱᕋᙱᑦᑐᓐᓇᖅᑐᖓ",
|
|
255
|
+
"🤦🏼♂️",
|
|
256
|
+
"🏴",
|
|
257
|
+
"���",
|
|
258
|
+
"������",
|
|
259
|
+
];
|
|
260
|
+
a.map((s) => assert.strictEqual(utf8ByteLength(s), stringToBuffer(s, "utf8").byteLength, s));
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
describe("TelemetryContext", () => {
|
|
264
|
+
it("Should serialize properly", () => {
|
|
265
|
+
const telemetryContext = new TelemetryContext();
|
|
266
|
+
telemetryContext.set("pre1_", "prop1", 10);
|
|
267
|
+
telemetryContext.set("pre2_", "prop1", "10");
|
|
268
|
+
telemetryContext.set("pre2_", "prop2", true);
|
|
269
|
+
telemetryContext.set("pre1_", "prop2", undefined);
|
|
270
|
+
telemetryContext.setMultiple("pre3_", "obj1", { prop1: "1", prop2: 2, prop3: true });
|
|
271
|
+
const serialized = telemetryContext.serialize();
|
|
272
|
+
const obj = JSON.parse(serialized);
|
|
273
|
+
assert.strictEqual(obj.pre1_prop1, 10);
|
|
274
|
+
assert.strictEqual(obj.pre1_prop2, undefined);
|
|
275
|
+
assert.strictEqual(obj.pre2_prop1, "10");
|
|
276
|
+
assert.strictEqual(obj.pre2_prop2, true);
|
|
277
|
+
assert.strictEqual(obj.pre3_obj1_prop1, "1");
|
|
278
|
+
assert.strictEqual(obj.pre3_obj1_prop2, 2);
|
|
279
|
+
assert.strictEqual(obj.pre3_obj1_prop3, true);
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
//# sourceMappingURL=summaryUtils.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summaryUtils.spec.js","sourceRoot":"","sources":["../../src/test/summaryUtils.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAKN,WAAW,GAGX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAE5B,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,SAAS,iBAAiB,CAAC,GAAkB;QAC5C,yEAAyE;QACzE,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE;YACzC,OAAO,GAAG,CAAC;SACX;aAAM;YACN,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;SAC7C;IACF,CAAC;IACD,SAAS,iBAAiB,CAAC,GAAkB;QAC5C,yEAAyE;QACzE,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE;YACzC,OAAO,GAAG,CAAC;SACX;aAAM;YACN,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;SAC7C;IACF,CAAC;IAC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CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;YAC3C,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAC7C,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAC7C,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;YAClD,gBAAgB,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAErF,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAEhD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAEnC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACvC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YAC9C,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YACzC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;YAC7C,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { IsoBuffer, stringToBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { BlobTreeEntry, TreeTreeEntry } from \"@fluidframework/driver-utils\";\nimport {\n\tSummaryObject,\n\tISummaryTree,\n\tISummaryBlob,\n\tISummaryHandle,\n\tSummaryType,\n\tISnapshotTree,\n\tITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"../summaryUtils.js\";\n\ndescribe(\"Summary Utils\", () => {\n\tfunction assertSummaryTree(obj: SummaryObject): ISummaryTree {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (obj && obj.type === SummaryType.Tree) {\n\t\t\treturn obj;\n\t\t} else {\n\t\t\tassert.fail(\"Object should be summary tree\");\n\t\t}\n\t}\n\tfunction assertSummaryBlob(obj: SummaryObject): ISummaryBlob {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (obj && obj.type === SummaryType.Blob) {\n\t\t\treturn obj;\n\t\t} else {\n\t\t\tassert.fail(\"Object should be summary blob\");\n\t\t}\n\t}\n\tfunction assertSummaryHandle(obj: SummaryObject): ISummaryHandle {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (obj && obj.type === SummaryType.Handle) {\n\t\t\treturn obj;\n\t\t} else {\n\t\t\tassert.fail(\"Object should be summary handle\");\n\t\t}\n\t}\n\n\tdescribe(\"ITree <-> ISummaryTree\", () => {\n\t\tlet tree: ITree;\n\n\t\tbeforeEach(() => {\n\t\t\tconst base64Content = IsoBuffer.from(\"test-b64\").toString(\"base64\");\n\t\t\ttree = {\n\t\t\t\tentries: [\n\t\t\t\t\tnew TreeTreeEntry(\"t\", {\n\t\t\t\t\t\tentries: [\n\t\t\t\t\t\t\tnew BlobTreeEntry(\"bu8\", \"test-u8\"),\n\t\t\t\t\t\t\tnew BlobTreeEntry(\"b64\", base64Content, \"base64\"),\n\t\t\t\t\t\t\tnew TreeTreeEntry(\"tu\", {\n\t\t\t\t\t\t\t\tentries: [],\n\t\t\t\t\t\t\t\tunreferenced: true,\n\t\t\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t],\n\t\t\t\t\t\tunreferenced: undefined,\n\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t}),\n\t\t\t\t\tnew BlobTreeEntry(\"b\", \"test-blob\"),\n\t\t\t\t\tnew TreeTreeEntry(\"h\", {\n\t\t\t\t\t\tid: \"test-handle\",\n\t\t\t\t\t\tentries: [new BlobTreeEntry(\"ignore\", \"this-should-be-ignored\")],\n\t\t\t\t\t}),\n\t\t\t\t\tnew TreeTreeEntry(\"unref\", {\n\t\t\t\t\t\tentries: [],\n\t\t\t\t\t\tunreferenced: true,\n\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t}),\n\t\t\t\t\tnew TreeTreeEntry(\"groupId\", {\n\t\t\t\t\t\tentries: [],\n\t\t\t\t\t\tunreferenced: undefined,\n\t\t\t\t\t\tgroupId: \"group-id\",\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t\tunreferenced: undefined,\n\t\t\t\tgroupId: undefined,\n\t\t\t};\n\t\t});\n\n\t\tit(\"Should convert ITree to ISummaryTree correctly\", () => {\n\t\t\tconst summaryResults = convertToSummaryTree(tree);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\n\t\t\t// blobs should parse\n\t\t\tconst blob = assertSummaryBlob(summaryTree.tree.b);\n\t\t\tassert.strictEqual(blob.content, \"test-blob\");\n\n\t\t\t// trees with ids should become handles\n\t\t\tconst handle = assertSummaryHandle(summaryTree.tree.h);\n\t\t\tassert.strictEqual(handle.handleType, SummaryType.Tree);\n\t\t\tassert.strictEqual(handle.handle, \"test-handle\");\n\n\t\t\t// subtrees should recurse\n\t\t\tconst subTree = assertSummaryTree(summaryTree.tree.t);\n\t\t\tconst subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);\n\t\t\tassert.strictEqual(subBlobUtf8.content, \"test-u8\");\n\t\t\tconst subBlobBase64 = assertSummaryBlob(subTree.tree.b64);\n\t\t\tassert.strictEqual(Uint8ArrayToString(subBlobBase64.content as Uint8Array), \"test-b64\");\n\t\t\tconst subTreeUnref = assertSummaryTree(subTree.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tObject.keys(subTreeUnref.tree).length,\n\t\t\t\t0,\n\t\t\t\t\"There should be no entries in tu subtree\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"Should convert ITree to ISummaryTree correctly with fullTree enabled\", () => {\n\t\t\tconst summaryResults = convertToSummaryTree(tree, true);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\n\t\t\t// blobs should parse\n\t\t\tconst blob = assertSummaryBlob(summaryTree.tree.b);\n\t\t\tassert.strictEqual(blob.content, \"test-blob\");\n\n\t\t\t// trees with ids should not become handles\n\t\t\tconst usuallyIgnoredSubtree = assertSummaryTree(summaryTree.tree.h);\n\t\t\tconst usuallyIgnoredBlob = assertSummaryBlob(usuallyIgnoredSubtree.tree.ignore);\n\t\t\tassert.strictEqual(usuallyIgnoredBlob.content, \"this-should-be-ignored\");\n\n\t\t\t// subtrees should recurse\n\t\t\tconst subTree = assertSummaryTree(summaryTree.tree.t);\n\t\t\tconst subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);\n\t\t\tassert.strictEqual(subBlobUtf8.content, \"test-u8\");\n\t\t\tconst subBlobBase64 = assertSummaryBlob(subTree.tree.b64);\n\t\t\tassert.strictEqual(Uint8ArrayToString(subBlobBase64.content as Uint8Array), \"test-b64\");\n\t\t\tconst subUnrefTree = assertSummaryTree(subTree.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tObject.keys(subUnrefTree.tree).length,\n\t\t\t\t0,\n\t\t\t\t\"There should be no entries in tu subtree\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"Should calculate summary data correctly\", () => {\n\t\t\tconst summaryResults = convertToSummaryTree(tree);\n\t\t\t// nodes should count\n\t\t\tassert.strictEqual(summaryResults.stats.blobNodeCount, 3);\n\t\t\tassert.strictEqual(summaryResults.stats.handleNodeCount, 1);\n\t\t\tassert.strictEqual(summaryResults.stats.treeNodeCount, 5);\n\n\t\t\tconst bufferLength =\n\t\t\t\tIsoBuffer.from(\"test-b64\").byteLength +\n\t\t\t\tIsoBuffer.from(\"test-blob\").byteLength +\n\t\t\t\tIsoBuffer.from(\"test-u8\").byteLength;\n\t\t\tassert.strictEqual(summaryResults.stats.totalBlobSize, bufferLength);\n\t\t});\n\n\t\tit(\"should convert unreferenced state correctly\", () => {\n\t\t\tconst summaryResults = convertToSummaryTree(tree);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\t\t\tassert.strictEqual(\n\t\t\t\tsummaryTree.unreferenced,\n\t\t\t\tundefined,\n\t\t\t\t\"The root summary tree should be referenced\",\n\t\t\t);\n\n\t\t\tconst subTreeT = assertSummaryTree(summaryTree.tree.t);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeT.unreferenced,\n\t\t\t\tundefined,\n\t\t\t\t\"The t subtree should be referenced\",\n\t\t\t);\n\t\t\tconst subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeTUnrefTree.unreferenced,\n\t\t\t\ttrue,\n\t\t\t\t\"The tu subtree of t should be referenced\",\n\t\t\t);\n\n\t\t\tconst subTreeUnref = assertSummaryTree(summaryTree.tree.unref);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeUnref.unreferenced,\n\t\t\t\ttrue,\n\t\t\t\t\"The unref subtree should be unreferenced\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"should convert ISummaryTree to ITree correctly\", () => {\n\t\t\t// convertSummaryTreeToITree API does not accept a tree with handles. So, remove handles from the ITree.\n\t\t\tconst treeWithoutHandles: ITree = {\n\t\t\t\tentries: tree.entries.filter((treeEntry) => {\n\t\t\t\t\treturn treeEntry.path !== \"h\";\n\t\t\t\t}),\n\t\t\t\tunreferenced: undefined,\n\t\t\t\tgroupId: undefined,\n\t\t\t};\n\t\t\tconst summaryResults = convertToSummaryTree(treeWithoutHandles);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\n\t\t\t// Covert the ISummaryTree back to ITree and validate that it matches with the original tree.\n\t\t\tconst iTree = convertSummaryTreeToITree(summaryTree);\n\t\t\tassert.deepStrictEqual(\n\t\t\t\ttreeWithoutHandles,\n\t\t\t\tiTree,\n\t\t\t\t\"Could not covert back to ITree correctly\",\n\t\t\t);\n\t\t});\n\t});\n\n\tdescribe(\"ISnapshotTree -> ISummaryTree\", () => {\n\t\tlet snapshotTree: ISnapshotTree;\n\n\t\tbeforeEach(() => {\n\t\t\tsnapshotTree = {\n\t\t\t\tblobs: {\n\t\t\t\t\t\"b\": \"blob-b\",\n\t\t\t\t\t\"blob-b\": IsoBuffer.from(\"test-blob\").toString(\"base64\"),\n\t\t\t\t},\n\t\t\t\ttrees: {\n\t\t\t\t\tt: {\n\t\t\t\t\t\tblobs: {\n\t\t\t\t\t\t\t\"bu8\": \"blob-bu8\",\n\t\t\t\t\t\t\t\"blob-bu8\": IsoBuffer.from(\"test-u8\").toString(\"base64\"),\n\t\t\t\t\t\t\t\"b64\": \"blob-b64\",\n\t\t\t\t\t\t\t\"blob-b64\": IsoBuffer.from(\"test-b64\").toString(\"base64\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttrees: {\n\t\t\t\t\t\t\ttu: {\n\t\t\t\t\t\t\t\tblobs: {},\n\t\t\t\t\t\t\t\ttrees: {},\n\t\t\t\t\t\t\t\tunreferenced: true,\n\t\t\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tunref: {\n\t\t\t\t\t\tblobs: {},\n\t\t\t\t\t\ttrees: {},\n\t\t\t\t\t\tunreferenced: true,\n\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tgroupId: {\n\t\t\t\t\t\tblobs: {},\n\t\t\t\t\t\ttrees: {},\n\t\t\t\t\t\tunreferenced: true,\n\t\t\t\t\t\tgroupId: \"group-id\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t});\n\t\tit(\"Should convert correctly\", () => {\n\t\t\tconst summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\n\t\t\t// blobs should parse\n\t\t\tconst blob = assertSummaryBlob(summaryTree.tree.b);\n\t\t\tassert.strictEqual(blob.content, \"test-blob\");\n\n\t\t\t// subtrees should recurse\n\t\t\tconst subTree = assertSummaryTree(summaryTree.tree.t);\n\t\t\tconst subBlobUtf8 = assertSummaryBlob(subTree.tree.bu8);\n\t\t\tassert.strictEqual(subBlobUtf8.content, \"test-u8\");\n\t\t\tconst subBlobBase64 = assertSummaryBlob(subTree.tree.b64);\n\t\t\tassert.strictEqual(Uint8ArrayToString(subBlobBase64.content as Uint8Array), \"test-b64\");\n\t\t\tconst subTreeUnref = assertSummaryTree(subTree.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tObject.keys(subTreeUnref.tree).length,\n\t\t\t\t0,\n\t\t\t\t\"There should be no entries in tu subtree\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"Should calculate summary data correctly\", () => {\n\t\t\tconst summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);\n\t\t\t// nodes should count\n\t\t\tassert.strictEqual(summaryResults.stats.blobNodeCount, 3);\n\t\t\tassert.strictEqual(summaryResults.stats.handleNodeCount, 0);\n\t\t\tassert.strictEqual(summaryResults.stats.treeNodeCount, 5);\n\n\t\t\tconst bufferLength =\n\t\t\t\tIsoBuffer.from(\"test-b64\").byteLength +\n\t\t\t\tIsoBuffer.from(\"test-blob\").byteLength +\n\t\t\t\tIsoBuffer.from(\"test-u8\").byteLength;\n\t\t\tassert.strictEqual(summaryResults.stats.totalBlobSize, bufferLength);\n\t\t});\n\n\t\tit(\"should convert unreferenced state correctly\", () => {\n\t\t\tconst summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\t\t\tassert.strictEqual(\n\t\t\t\tsummaryTree.unreferenced,\n\t\t\t\tundefined,\n\t\t\t\t\"The root summary tree should be referenced\",\n\t\t\t);\n\n\t\t\tconst subTreeT = assertSummaryTree(summaryTree.tree.t);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeT.unreferenced,\n\t\t\t\tundefined,\n\t\t\t\t\"The t subtree should be referenced\",\n\t\t\t);\n\t\t\tconst subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeTUnrefTree.unreferenced,\n\t\t\t\ttrue,\n\t\t\t\t\"The tu subtree of t should be referenced\",\n\t\t\t);\n\n\t\t\tconst subTreeUnref = assertSummaryTree(summaryTree.tree.unref);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeUnref.unreferenced,\n\t\t\t\ttrue,\n\t\t\t\t\"The unref subtree should be unreferenced\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"should convert groupId state correctly\", () => {\n\t\t\tconst summaryResults = convertSnapshotTreeToSummaryTree(snapshotTree);\n\t\t\tconst summaryTree = assertSummaryTree(summaryResults.summary);\n\t\t\tassert.strictEqual(\n\t\t\t\tsummaryTree.groupId,\n\t\t\t\tundefined,\n\t\t\t\t\"The root summary tree should not have groupId\",\n\t\t\t);\n\n\t\t\tconst subTreeT = assertSummaryTree(summaryTree.tree.t);\n\t\t\tassert.strictEqual(subTreeT.groupId, undefined, \"The t subtree not have groupId\");\n\t\t\tconst subTreeTUnrefTree = assertSummaryTree(subTreeT.tree.tu);\n\t\t\tassert.strictEqual(\n\t\t\t\tsubTreeTUnrefTree.groupId,\n\t\t\t\tundefined,\n\t\t\t\t\"The tu subtree of t not have groupId\",\n\t\t\t);\n\n\t\t\tconst subTreeUnref = assertSummaryTree(summaryTree.tree.unref);\n\t\t\tassert.strictEqual(subTreeUnref.groupId, undefined, \"The groupId should not be set\");\n\n\t\t\tconst subTreeGroupId = assertSummaryTree(summaryTree.tree.groupId);\n\t\t\tassert.strictEqual(subTreeGroupId.groupId, \"group-id\", \"The groupId should be set\");\n\t\t});\n\t});\n\n\tdescribe(\"utf8ByteLength()\", () => {\n\t\tit(\"gives correct utf8 byte length\", () => {\n\t\t\tconst a = [\n\t\t\t\t\"prague is a city in europe\",\n\t\t\t\t\"ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ\",\n\t\t\t\t\"Τὴ γλῶσσα μοῦ ἔδωσαν ἑλληνικὴ\",\n\t\t\t\t\"На берегу пустынных волн\",\n\t\t\t\t\"⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑\",\n\t\t\t\t\"أنا قادر على أكل الزجاج و هذا لا يؤلمني.\",\n\t\t\t\t\" 我能吞下玻璃而不傷身體。\",\n\t\t\t\t\"ᐊᓕᒍᖅ ᓂᕆᔭᕌᖓᒃᑯ ᓱᕋᙱᑦᑐᓐᓇᖅᑐᖓ\",\n\t\t\t\t\"🤦🏼♂️\",\n\t\t\t\t\"🏴\", // the flag of wales\n\t\t\t\t\"���\",\n\t\t\t\t\"������\",\n\t\t\t];\n\t\t\ta.map((s) =>\n\t\t\t\tassert.strictEqual(utf8ByteLength(s), stringToBuffer(s, \"utf8\").byteLength, s),\n\t\t\t);\n\t\t});\n\t});\n\n\tdescribe(\"TelemetryContext\", () => {\n\t\tit(\"Should serialize properly\", () => {\n\t\t\tconst telemetryContext = new TelemetryContext();\n\n\t\t\ttelemetryContext.set(\"pre1_\", \"prop1\", 10);\n\t\t\ttelemetryContext.set(\"pre2_\", \"prop1\", \"10\");\n\t\t\ttelemetryContext.set(\"pre2_\", \"prop2\", true);\n\t\t\ttelemetryContext.set(\"pre1_\", \"prop2\", undefined);\n\t\t\ttelemetryContext.setMultiple(\"pre3_\", \"obj1\", { prop1: \"1\", prop2: 2, prop3: true });\n\n\t\t\tconst serialized = telemetryContext.serialize();\n\n\t\t\tconst obj = JSON.parse(serialized);\n\n\t\t\tassert.strictEqual(obj.pre1_prop1, 10);\n\t\t\tassert.strictEqual(obj.pre1_prop2, undefined);\n\t\t\tassert.strictEqual(obj.pre2_prop1, \"10\");\n\t\t\tassert.strictEqual(obj.pre2_prop2, true);\n\t\t\tassert.strictEqual(obj.pre3_obj1_prop1, \"1\");\n\t\t\tassert.strictEqual(obj.pre3_obj1_prop2, 2);\n\t\t\tassert.strictEqual(obj.pre3_obj1_prop3, true);\n\t\t});\n\t});\n});\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
use_current_TypeAliasDeclaration_Factory(get_old_TypeAliasDeclaration_Factory());
|
|
2
|
+
use_old_TypeAliasDeclaration_Factory(get_current_TypeAliasDeclaration_Factory());
|
|
3
|
+
use_current_ClassDeclaration_GCDataBuilder(get_old_ClassDeclaration_GCDataBuilder());
|
|
4
|
+
use_old_ClassDeclaration_GCDataBuilder(get_current_ClassDeclaration_GCDataBuilder());
|
|
5
|
+
use_current_ClassDeclaration_ObjectStoragePartition(get_old_ClassDeclaration_ObjectStoragePartition());
|
|
6
|
+
use_old_ClassDeclaration_ObjectStoragePartition(get_current_ClassDeclaration_ObjectStoragePartition());
|
|
7
|
+
use_current_TypeAliasDeclaration_ReadAndParseBlob(get_old_TypeAliasDeclaration_ReadAndParseBlob());
|
|
8
|
+
use_old_TypeAliasDeclaration_ReadAndParseBlob(get_current_TypeAliasDeclaration_ReadAndParseBlob());
|
|
9
|
+
use_current_ClassDeclaration_RequestParser(get_old_ClassDeclaration_RequestParser());
|
|
10
|
+
use_old_ClassDeclaration_RequestParser(get_current_ClassDeclaration_RequestParser());
|
|
11
|
+
use_current_ClassDeclaration_RuntimeFactoryHelper(get_old_ClassDeclaration_RuntimeFactoryHelper());
|
|
12
|
+
use_old_ClassDeclaration_RuntimeFactoryHelper(get_current_ClassDeclaration_RuntimeFactoryHelper());
|
|
13
|
+
use_current_ClassDeclaration_SummaryTreeBuilder(get_old_ClassDeclaration_SummaryTreeBuilder());
|
|
14
|
+
use_old_ClassDeclaration_SummaryTreeBuilder(get_current_ClassDeclaration_SummaryTreeBuilder());
|
|
15
|
+
use_current_ClassDeclaration_TelemetryContext(get_old_ClassDeclaration_TelemetryContext());
|
|
16
|
+
use_old_ClassDeclaration_TelemetryContext(get_current_ClassDeclaration_TelemetryContext());
|
|
17
|
+
use_current_FunctionDeclaration_addBlobToSummary(get_old_FunctionDeclaration_addBlobToSummary());
|
|
18
|
+
use_old_FunctionDeclaration_addBlobToSummary(get_current_FunctionDeclaration_addBlobToSummary());
|
|
19
|
+
use_current_FunctionDeclaration_addSummarizeResultToSummary(get_old_FunctionDeclaration_addSummarizeResultToSummary());
|
|
20
|
+
use_old_FunctionDeclaration_addSummarizeResultToSummary(get_current_FunctionDeclaration_addSummarizeResultToSummary());
|
|
21
|
+
use_current_FunctionDeclaration_calculateStats(get_old_FunctionDeclaration_calculateStats());
|
|
22
|
+
use_old_FunctionDeclaration_calculateStats(get_current_FunctionDeclaration_calculateStats());
|
|
23
|
+
use_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree(get_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree());
|
|
24
|
+
use_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree(get_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree());
|
|
25
|
+
use_current_FunctionDeclaration_convertSummaryTreeToITree(get_old_FunctionDeclaration_convertSummaryTreeToITree());
|
|
26
|
+
use_old_FunctionDeclaration_convertSummaryTreeToITree(get_current_FunctionDeclaration_convertSummaryTreeToITree());
|
|
27
|
+
use_current_FunctionDeclaration_convertToSummaryTree(get_old_FunctionDeclaration_convertToSummaryTree());
|
|
28
|
+
use_old_FunctionDeclaration_convertToSummaryTree(get_current_FunctionDeclaration_convertToSummaryTree());
|
|
29
|
+
use_current_FunctionDeclaration_convertToSummaryTreeWithStats(get_old_FunctionDeclaration_convertToSummaryTreeWithStats());
|
|
30
|
+
use_old_FunctionDeclaration_convertToSummaryTreeWithStats(get_current_FunctionDeclaration_convertToSummaryTreeWithStats());
|
|
31
|
+
use_current_VariableDeclaration_create404Response(get_old_VariableDeclaration_create404Response());
|
|
32
|
+
use_old_VariableDeclaration_create404Response(get_current_VariableDeclaration_create404Response());
|
|
33
|
+
use_current_FunctionDeclaration_createDataStoreFactory(get_old_FunctionDeclaration_createDataStoreFactory());
|
|
34
|
+
use_old_FunctionDeclaration_createDataStoreFactory(get_current_FunctionDeclaration_createDataStoreFactory());
|
|
35
|
+
use_current_FunctionDeclaration_createResponseError(get_old_FunctionDeclaration_createResponseError());
|
|
36
|
+
use_old_FunctionDeclaration_createResponseError(get_current_FunctionDeclaration_createResponseError());
|
|
37
|
+
use_current_FunctionDeclaration_exceptionToResponse(get_old_FunctionDeclaration_exceptionToResponse());
|
|
38
|
+
use_old_FunctionDeclaration_exceptionToResponse(get_current_FunctionDeclaration_exceptionToResponse());
|
|
39
|
+
use_current_FunctionDeclaration_generateHandleContextPath(get_old_FunctionDeclaration_generateHandleContextPath());
|
|
40
|
+
use_old_FunctionDeclaration_generateHandleContextPath(get_current_FunctionDeclaration_generateHandleContextPath());
|
|
41
|
+
use_current_FunctionDeclaration_getBlobSize(get_old_FunctionDeclaration_getBlobSize());
|
|
42
|
+
use_old_FunctionDeclaration_getBlobSize(get_current_FunctionDeclaration_getBlobSize());
|
|
43
|
+
use_current_FunctionDeclaration_getNormalizedObjectStoragePathParts(get_old_FunctionDeclaration_getNormalizedObjectStoragePathParts());
|
|
44
|
+
use_old_FunctionDeclaration_getNormalizedObjectStoragePathParts(get_current_FunctionDeclaration_getNormalizedObjectStoragePathParts());
|
|
45
|
+
use_current_FunctionDeclaration_listBlobsAtTreePath(get_old_FunctionDeclaration_listBlobsAtTreePath());
|
|
46
|
+
use_old_FunctionDeclaration_listBlobsAtTreePath(get_current_FunctionDeclaration_listBlobsAtTreePath());
|
|
47
|
+
use_current_FunctionDeclaration_mergeStats(get_old_FunctionDeclaration_mergeStats());
|
|
48
|
+
use_old_FunctionDeclaration_mergeStats(get_current_FunctionDeclaration_mergeStats());
|
|
49
|
+
use_current_FunctionDeclaration_responseToException(get_old_FunctionDeclaration_responseToException());
|
|
50
|
+
use_old_FunctionDeclaration_responseToException(get_current_FunctionDeclaration_responseToException());
|
|
51
|
+
use_current_FunctionDeclaration_seqFromTree(get_old_FunctionDeclaration_seqFromTree());
|
|
52
|
+
use_old_FunctionDeclaration_seqFromTree(get_current_FunctionDeclaration_seqFromTree());
|
|
53
|
+
use_current_FunctionDeclaration_unpackChildNodesUsedRoutes(get_old_FunctionDeclaration_unpackChildNodesUsedRoutes());
|
|
54
|
+
use_old_FunctionDeclaration_unpackChildNodesUsedRoutes(get_current_FunctionDeclaration_unpackChildNodesUsedRoutes());
|
|
55
|
+
use_current_FunctionDeclaration_utf8ByteLength(get_old_FunctionDeclaration_utf8ByteLength());
|
|
56
|
+
use_old_FunctionDeclaration_utf8ByteLength(get_current_FunctionDeclaration_utf8ByteLength());
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=validateRuntimeUtilsPrevious.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateRuntimeUtilsPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateRuntimeUtilsPrevious.generated.ts"],"names":[],"mappings":"AAgCA,wCAAwC,CACpC,oCAAoC,EAAE,CAAC,CAAC;AAW5C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AAC,CAAC;AAWnD,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/runtime-utils-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_Factory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_Factory():\n TypeOnly<old.Factory>;\ndeclare function use_current_TypeAliasDeclaration_Factory(\n use: TypeOnly<current.Factory>): void;\nuse_current_TypeAliasDeclaration_Factory(\n get_old_TypeAliasDeclaration_Factory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_Factory\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_Factory():\n TypeOnly<current.Factory>;\ndeclare function use_old_TypeAliasDeclaration_Factory(\n use: TypeOnly<old.Factory>): void;\nuse_old_TypeAliasDeclaration_Factory(\n get_current_TypeAliasDeclaration_Factory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_GCDataBuilder\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_GCDataBuilder():\n TypeOnly<old.GCDataBuilder>;\ndeclare function use_current_ClassDeclaration_GCDataBuilder(\n use: TypeOnly<current.GCDataBuilder>): void;\nuse_current_ClassDeclaration_GCDataBuilder(\n get_old_ClassDeclaration_GCDataBuilder());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_GCDataBuilder\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_GCDataBuilder():\n TypeOnly<current.GCDataBuilder>;\ndeclare function use_old_ClassDeclaration_GCDataBuilder(\n use: TypeOnly<old.GCDataBuilder>): void;\nuse_old_ClassDeclaration_GCDataBuilder(\n get_current_ClassDeclaration_GCDataBuilder());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ObjectStoragePartition\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ObjectStoragePartition():\n TypeOnly<old.ObjectStoragePartition>;\ndeclare function use_current_ClassDeclaration_ObjectStoragePartition(\n use: TypeOnly<current.ObjectStoragePartition>): void;\nuse_current_ClassDeclaration_ObjectStoragePartition(\n get_old_ClassDeclaration_ObjectStoragePartition());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ObjectStoragePartition\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ObjectStoragePartition():\n TypeOnly<current.ObjectStoragePartition>;\ndeclare function use_old_ClassDeclaration_ObjectStoragePartition(\n use: TypeOnly<old.ObjectStoragePartition>): void;\nuse_old_ClassDeclaration_ObjectStoragePartition(\n get_current_ClassDeclaration_ObjectStoragePartition());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReadAndParseBlob\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_ReadAndParseBlob():\n TypeOnly<old.ReadAndParseBlob>;\ndeclare function use_current_TypeAliasDeclaration_ReadAndParseBlob(\n use: TypeOnly<current.ReadAndParseBlob>): void;\nuse_current_TypeAliasDeclaration_ReadAndParseBlob(\n get_old_TypeAliasDeclaration_ReadAndParseBlob());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReadAndParseBlob\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_ReadAndParseBlob():\n TypeOnly<current.ReadAndParseBlob>;\ndeclare function use_old_TypeAliasDeclaration_ReadAndParseBlob(\n use: TypeOnly<old.ReadAndParseBlob>): void;\nuse_old_TypeAliasDeclaration_ReadAndParseBlob(\n get_current_TypeAliasDeclaration_ReadAndParseBlob());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RequestParser\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_RequestParser():\n TypeOnly<old.RequestParser>;\ndeclare function use_current_ClassDeclaration_RequestParser(\n use: TypeOnly<current.RequestParser>): void;\nuse_current_ClassDeclaration_RequestParser(\n get_old_ClassDeclaration_RequestParser());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RequestParser\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_RequestParser():\n TypeOnly<current.RequestParser>;\ndeclare function use_old_ClassDeclaration_RequestParser(\n use: TypeOnly<old.RequestParser>): void;\nuse_old_ClassDeclaration_RequestParser(\n get_current_ClassDeclaration_RequestParser());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RuntimeFactoryHelper\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_RuntimeFactoryHelper():\n TypeOnly<old.RuntimeFactoryHelper>;\ndeclare function use_current_ClassDeclaration_RuntimeFactoryHelper(\n use: TypeOnly<current.RuntimeFactoryHelper>): void;\nuse_current_ClassDeclaration_RuntimeFactoryHelper(\n get_old_ClassDeclaration_RuntimeFactoryHelper());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RuntimeFactoryHelper\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_RuntimeFactoryHelper():\n TypeOnly<current.RuntimeFactoryHelper>;\ndeclare function use_old_ClassDeclaration_RuntimeFactoryHelper(\n use: TypeOnly<old.RuntimeFactoryHelper>): void;\nuse_old_ClassDeclaration_RuntimeFactoryHelper(\n get_current_ClassDeclaration_RuntimeFactoryHelper());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SummaryTreeBuilder\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SummaryTreeBuilder():\n TypeOnly<old.SummaryTreeBuilder>;\ndeclare function use_current_ClassDeclaration_SummaryTreeBuilder(\n use: TypeOnly<current.SummaryTreeBuilder>): void;\nuse_current_ClassDeclaration_SummaryTreeBuilder(\n get_old_ClassDeclaration_SummaryTreeBuilder());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SummaryTreeBuilder\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SummaryTreeBuilder():\n TypeOnly<current.SummaryTreeBuilder>;\ndeclare function use_old_ClassDeclaration_SummaryTreeBuilder(\n use: TypeOnly<old.SummaryTreeBuilder>): void;\nuse_old_ClassDeclaration_SummaryTreeBuilder(\n get_current_ClassDeclaration_SummaryTreeBuilder());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_TelemetryContext\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_TelemetryContext():\n TypeOnly<old.TelemetryContext>;\ndeclare function use_current_ClassDeclaration_TelemetryContext(\n use: TypeOnly<current.TelemetryContext>): void;\nuse_current_ClassDeclaration_TelemetryContext(\n get_old_ClassDeclaration_TelemetryContext());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_TelemetryContext\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_TelemetryContext():\n TypeOnly<current.TelemetryContext>;\ndeclare function use_old_ClassDeclaration_TelemetryContext(\n use: TypeOnly<old.TelemetryContext>): void;\nuse_old_ClassDeclaration_TelemetryContext(\n get_current_ClassDeclaration_TelemetryContext());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addBlobToSummary\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_addBlobToSummary():\n TypeOnly<typeof old.addBlobToSummary>;\ndeclare function use_current_FunctionDeclaration_addBlobToSummary(\n use: TypeOnly<typeof current.addBlobToSummary>): void;\nuse_current_FunctionDeclaration_addBlobToSummary(\n get_old_FunctionDeclaration_addBlobToSummary());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addBlobToSummary\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_addBlobToSummary():\n TypeOnly<typeof current.addBlobToSummary>;\ndeclare function use_old_FunctionDeclaration_addBlobToSummary(\n use: TypeOnly<typeof old.addBlobToSummary>): void;\nuse_old_FunctionDeclaration_addBlobToSummary(\n get_current_FunctionDeclaration_addBlobToSummary());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addSummarizeResultToSummary\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_addSummarizeResultToSummary():\n TypeOnly<typeof old.addSummarizeResultToSummary>;\ndeclare function use_current_FunctionDeclaration_addSummarizeResultToSummary(\n use: TypeOnly<typeof current.addSummarizeResultToSummary>): void;\nuse_current_FunctionDeclaration_addSummarizeResultToSummary(\n get_old_FunctionDeclaration_addSummarizeResultToSummary());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addSummarizeResultToSummary\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_addSummarizeResultToSummary():\n TypeOnly<typeof current.addSummarizeResultToSummary>;\ndeclare function use_old_FunctionDeclaration_addSummarizeResultToSummary(\n use: TypeOnly<typeof old.addSummarizeResultToSummary>): void;\nuse_old_FunctionDeclaration_addSummarizeResultToSummary(\n get_current_FunctionDeclaration_addSummarizeResultToSummary());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedFunctionDeclaration_addTreeToSummary\": {\"forwardCompat\": false}\n*/\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedFunctionDeclaration_addTreeToSummary\": {\"backCompat\": false}\n*/\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_calculateStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_calculateStats():\n TypeOnly<typeof old.calculateStats>;\ndeclare function use_current_FunctionDeclaration_calculateStats(\n use: TypeOnly<typeof current.calculateStats>): void;\nuse_current_FunctionDeclaration_calculateStats(\n get_old_FunctionDeclaration_calculateStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_calculateStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_calculateStats():\n TypeOnly<typeof current.calculateStats>;\ndeclare function use_old_FunctionDeclaration_calculateStats(\n use: TypeOnly<typeof old.calculateStats>): void;\nuse_old_FunctionDeclaration_calculateStats(\n get_current_FunctionDeclaration_calculateStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSnapshotTreeToSummaryTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree():\n TypeOnly<typeof old.convertSnapshotTreeToSummaryTree>;\ndeclare function use_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n use: TypeOnly<typeof current.convertSnapshotTreeToSummaryTree>): void;\nuse_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n get_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSnapshotTreeToSummaryTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree():\n TypeOnly<typeof current.convertSnapshotTreeToSummaryTree>;\ndeclare function use_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n use: TypeOnly<typeof old.convertSnapshotTreeToSummaryTree>): void;\nuse_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n get_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSummaryTreeToITree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertSummaryTreeToITree():\n TypeOnly<typeof old.convertSummaryTreeToITree>;\ndeclare function use_current_FunctionDeclaration_convertSummaryTreeToITree(\n use: TypeOnly<typeof current.convertSummaryTreeToITree>): void;\nuse_current_FunctionDeclaration_convertSummaryTreeToITree(\n get_old_FunctionDeclaration_convertSummaryTreeToITree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSummaryTreeToITree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertSummaryTreeToITree():\n TypeOnly<typeof current.convertSummaryTreeToITree>;\ndeclare function use_old_FunctionDeclaration_convertSummaryTreeToITree(\n use: TypeOnly<typeof old.convertSummaryTreeToITree>): void;\nuse_old_FunctionDeclaration_convertSummaryTreeToITree(\n get_current_FunctionDeclaration_convertSummaryTreeToITree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertToSummaryTree():\n TypeOnly<typeof old.convertToSummaryTree>;\ndeclare function use_current_FunctionDeclaration_convertToSummaryTree(\n use: TypeOnly<typeof current.convertToSummaryTree>): void;\nuse_current_FunctionDeclaration_convertToSummaryTree(\n get_old_FunctionDeclaration_convertToSummaryTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertToSummaryTree():\n TypeOnly<typeof current.convertToSummaryTree>;\ndeclare function use_old_FunctionDeclaration_convertToSummaryTree(\n use: TypeOnly<typeof old.convertToSummaryTree>): void;\nuse_old_FunctionDeclaration_convertToSummaryTree(\n get_current_FunctionDeclaration_convertToSummaryTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTreeWithStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertToSummaryTreeWithStats():\n TypeOnly<typeof old.convertToSummaryTreeWithStats>;\ndeclare function use_current_FunctionDeclaration_convertToSummaryTreeWithStats(\n use: TypeOnly<typeof current.convertToSummaryTreeWithStats>): void;\nuse_current_FunctionDeclaration_convertToSummaryTreeWithStats(\n get_old_FunctionDeclaration_convertToSummaryTreeWithStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTreeWithStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertToSummaryTreeWithStats():\n TypeOnly<typeof current.convertToSummaryTreeWithStats>;\ndeclare function use_old_FunctionDeclaration_convertToSummaryTreeWithStats(\n use: TypeOnly<typeof old.convertToSummaryTreeWithStats>): void;\nuse_old_FunctionDeclaration_convertToSummaryTreeWithStats(\n get_current_FunctionDeclaration_convertToSummaryTreeWithStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_create404Response\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_create404Response():\n TypeOnly<typeof old.create404Response>;\ndeclare function use_current_VariableDeclaration_create404Response(\n use: TypeOnly<typeof current.create404Response>): void;\nuse_current_VariableDeclaration_create404Response(\n get_old_VariableDeclaration_create404Response());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_create404Response\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_create404Response():\n TypeOnly<typeof current.create404Response>;\ndeclare function use_old_VariableDeclaration_create404Response(\n use: TypeOnly<typeof old.create404Response>): void;\nuse_old_VariableDeclaration_create404Response(\n get_current_VariableDeclaration_create404Response());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createDataStoreFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createDataStoreFactory():\n TypeOnly<typeof old.createDataStoreFactory>;\ndeclare function use_current_FunctionDeclaration_createDataStoreFactory(\n use: TypeOnly<typeof current.createDataStoreFactory>): void;\nuse_current_FunctionDeclaration_createDataStoreFactory(\n get_old_FunctionDeclaration_createDataStoreFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createDataStoreFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createDataStoreFactory():\n TypeOnly<typeof current.createDataStoreFactory>;\ndeclare function use_old_FunctionDeclaration_createDataStoreFactory(\n use: TypeOnly<typeof old.createDataStoreFactory>): void;\nuse_old_FunctionDeclaration_createDataStoreFactory(\n get_current_FunctionDeclaration_createDataStoreFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createResponseError\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createResponseError():\n TypeOnly<typeof old.createResponseError>;\ndeclare function use_current_FunctionDeclaration_createResponseError(\n use: TypeOnly<typeof current.createResponseError>): void;\nuse_current_FunctionDeclaration_createResponseError(\n get_old_FunctionDeclaration_createResponseError());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createResponseError\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createResponseError():\n TypeOnly<typeof current.createResponseError>;\ndeclare function use_old_FunctionDeclaration_createResponseError(\n use: TypeOnly<typeof old.createResponseError>): void;\nuse_old_FunctionDeclaration_createResponseError(\n get_current_FunctionDeclaration_createResponseError());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_exceptionToResponse\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_exceptionToResponse():\n TypeOnly<typeof old.exceptionToResponse>;\ndeclare function use_current_FunctionDeclaration_exceptionToResponse(\n use: TypeOnly<typeof current.exceptionToResponse>): void;\nuse_current_FunctionDeclaration_exceptionToResponse(\n get_old_FunctionDeclaration_exceptionToResponse());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_exceptionToResponse\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_exceptionToResponse():\n TypeOnly<typeof current.exceptionToResponse>;\ndeclare function use_old_FunctionDeclaration_exceptionToResponse(\n use: TypeOnly<typeof old.exceptionToResponse>): void;\nuse_old_FunctionDeclaration_exceptionToResponse(\n get_current_FunctionDeclaration_exceptionToResponse());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_generateHandleContextPath\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_generateHandleContextPath():\n TypeOnly<typeof old.generateHandleContextPath>;\ndeclare function use_current_FunctionDeclaration_generateHandleContextPath(\n use: TypeOnly<typeof current.generateHandleContextPath>): void;\nuse_current_FunctionDeclaration_generateHandleContextPath(\n get_old_FunctionDeclaration_generateHandleContextPath());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_generateHandleContextPath\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_generateHandleContextPath():\n TypeOnly<typeof current.generateHandleContextPath>;\ndeclare function use_old_FunctionDeclaration_generateHandleContextPath(\n use: TypeOnly<typeof old.generateHandleContextPath>): void;\nuse_old_FunctionDeclaration_generateHandleContextPath(\n get_current_FunctionDeclaration_generateHandleContextPath());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getBlobSize\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getBlobSize():\n TypeOnly<typeof old.getBlobSize>;\ndeclare function use_current_FunctionDeclaration_getBlobSize(\n use: TypeOnly<typeof current.getBlobSize>): void;\nuse_current_FunctionDeclaration_getBlobSize(\n get_old_FunctionDeclaration_getBlobSize());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getBlobSize\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getBlobSize():\n TypeOnly<typeof current.getBlobSize>;\ndeclare function use_old_FunctionDeclaration_getBlobSize(\n use: TypeOnly<typeof old.getBlobSize>): void;\nuse_old_FunctionDeclaration_getBlobSize(\n get_current_FunctionDeclaration_getBlobSize());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedObjectStoragePathParts\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getNormalizedObjectStoragePathParts():\n TypeOnly<typeof old.getNormalizedObjectStoragePathParts>;\ndeclare function use_current_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n use: TypeOnly<typeof current.getNormalizedObjectStoragePathParts>): void;\nuse_current_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n get_old_FunctionDeclaration_getNormalizedObjectStoragePathParts());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedObjectStoragePathParts\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getNormalizedObjectStoragePathParts():\n TypeOnly<typeof current.getNormalizedObjectStoragePathParts>;\ndeclare function use_old_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n use: TypeOnly<typeof old.getNormalizedObjectStoragePathParts>): void;\nuse_old_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n get_current_FunctionDeclaration_getNormalizedObjectStoragePathParts());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_listBlobsAtTreePath\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_listBlobsAtTreePath():\n TypeOnly<typeof old.listBlobsAtTreePath>;\ndeclare function use_current_FunctionDeclaration_listBlobsAtTreePath(\n use: TypeOnly<typeof current.listBlobsAtTreePath>): void;\nuse_current_FunctionDeclaration_listBlobsAtTreePath(\n get_old_FunctionDeclaration_listBlobsAtTreePath());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_listBlobsAtTreePath\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_listBlobsAtTreePath():\n TypeOnly<typeof current.listBlobsAtTreePath>;\ndeclare function use_old_FunctionDeclaration_listBlobsAtTreePath(\n use: TypeOnly<typeof old.listBlobsAtTreePath>): void;\nuse_old_FunctionDeclaration_listBlobsAtTreePath(\n get_current_FunctionDeclaration_listBlobsAtTreePath());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_mergeStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_mergeStats():\n TypeOnly<typeof old.mergeStats>;\ndeclare function use_current_FunctionDeclaration_mergeStats(\n use: TypeOnly<typeof current.mergeStats>): void;\nuse_current_FunctionDeclaration_mergeStats(\n get_old_FunctionDeclaration_mergeStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_mergeStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_mergeStats():\n TypeOnly<typeof current.mergeStats>;\ndeclare function use_old_FunctionDeclaration_mergeStats(\n use: TypeOnly<typeof old.mergeStats>): void;\nuse_old_FunctionDeclaration_mergeStats(\n get_current_FunctionDeclaration_mergeStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_responseToException\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_responseToException():\n TypeOnly<typeof old.responseToException>;\ndeclare function use_current_FunctionDeclaration_responseToException(\n use: TypeOnly<typeof current.responseToException>): void;\nuse_current_FunctionDeclaration_responseToException(\n get_old_FunctionDeclaration_responseToException());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_responseToException\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_responseToException():\n TypeOnly<typeof current.responseToException>;\ndeclare function use_old_FunctionDeclaration_responseToException(\n use: TypeOnly<typeof old.responseToException>): void;\nuse_old_FunctionDeclaration_responseToException(\n get_current_FunctionDeclaration_responseToException());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_seqFromTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_seqFromTree():\n TypeOnly<typeof old.seqFromTree>;\ndeclare function use_current_FunctionDeclaration_seqFromTree(\n use: TypeOnly<typeof current.seqFromTree>): void;\nuse_current_FunctionDeclaration_seqFromTree(\n get_old_FunctionDeclaration_seqFromTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_seqFromTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_seqFromTree():\n TypeOnly<typeof current.seqFromTree>;\ndeclare function use_old_FunctionDeclaration_seqFromTree(\n use: TypeOnly<typeof old.seqFromTree>): void;\nuse_old_FunctionDeclaration_seqFromTree(\n get_current_FunctionDeclaration_seqFromTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_unpackChildNodesUsedRoutes\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_unpackChildNodesUsedRoutes():\n TypeOnly<typeof old.unpackChildNodesUsedRoutes>;\ndeclare function use_current_FunctionDeclaration_unpackChildNodesUsedRoutes(\n use: TypeOnly<typeof current.unpackChildNodesUsedRoutes>): void;\nuse_current_FunctionDeclaration_unpackChildNodesUsedRoutes(\n get_old_FunctionDeclaration_unpackChildNodesUsedRoutes());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_unpackChildNodesUsedRoutes\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_unpackChildNodesUsedRoutes():\n TypeOnly<typeof current.unpackChildNodesUsedRoutes>;\ndeclare function use_old_FunctionDeclaration_unpackChildNodesUsedRoutes(\n use: TypeOnly<typeof old.unpackChildNodesUsedRoutes>): void;\nuse_old_FunctionDeclaration_unpackChildNodesUsedRoutes(\n get_current_FunctionDeclaration_unpackChildNodesUsedRoutes());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_utf8ByteLength\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_utf8ByteLength():\n TypeOnly<typeof old.utf8ByteLength>;\ndeclare function use_current_FunctionDeclaration_utf8ByteLength(\n use: TypeOnly<typeof current.utf8ByteLength>): void;\nuse_current_FunctionDeclaration_utf8ByteLength(\n get_old_FunctionDeclaration_utf8ByteLength());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_utf8ByteLength\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_utf8ByteLength():\n TypeOnly<typeof current.utf8ByteLength>;\ndeclare function use_old_FunctionDeclaration_utf8ByteLength(\n use: TypeOnly<typeof old.utf8ByteLength>): void;\nuse_old_FunctionDeclaration_utf8ByteLength(\n get_current_FunctionDeclaration_utf8ByteLength());\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { strict as assert } from "assert";
|
|
6
|
+
import { encodeCompactIdToString } from "../utils.js";
|
|
7
|
+
describe("Utils", () => {
|
|
8
|
+
beforeEach(() => { });
|
|
9
|
+
it("encodeCompactIdToString() with strings", () => {
|
|
10
|
+
assert(encodeCompactIdToString("a-b-c") === "a-b-c", "text");
|
|
11
|
+
assert(encodeCompactIdToString("_abcdefghijklmn") === "_abcdefghijklmn", "text");
|
|
12
|
+
});
|
|
13
|
+
it("encodeCompactIdToString() has base of 64 (sort of)", () => {
|
|
14
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ[abcdefghijklmnopqrstuvwxyz{01234567890";
|
|
15
|
+
for (let i = 0; i < 64; i++) {
|
|
16
|
+
const value = encodeCompactIdToString(i);
|
|
17
|
+
assert(value.length === 1, "length");
|
|
18
|
+
assert(chars[i] === value, "value");
|
|
19
|
+
}
|
|
20
|
+
for (let i = 64; i < 65 * 64 - 1; i++) {
|
|
21
|
+
const value = encodeCompactIdToString(i);
|
|
22
|
+
assert(value.length === 2, "length");
|
|
23
|
+
assert(chars.includes(value[0]), "value");
|
|
24
|
+
assert(chars.includes(value[1]), "value");
|
|
25
|
+
}
|
|
26
|
+
// This is a bit weird, as it does not work as our intuition suggests.
|
|
27
|
+
// That's because in base10 system we do not use "01" form - leading 0 is not used.
|
|
28
|
+
// Here, because we use forms like 01, 001, 011, we can put more numbers into less chars.
|
|
29
|
+
assert(encodeCompactIdToString(64) === "AA", "AA");
|
|
30
|
+
assert(encodeCompactIdToString(64 * 64) === "9A", "9A");
|
|
31
|
+
assert(encodeCompactIdToString(64 * 64 * 64) === "89A", "89A");
|
|
32
|
+
assert(encodeCompactIdToString(64 * 64 * 64 * 64) === "889A", "889A"); // 16M!
|
|
33
|
+
assert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64) === "8889A", "8889A"); // 1G (~10^9)
|
|
34
|
+
assert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64 * 64) === "88889A", "88889A");
|
|
35
|
+
});
|
|
36
|
+
it("encodeCompactIdToString() generates Unique values", () => {
|
|
37
|
+
const result = new Set();
|
|
38
|
+
const len = 10000;
|
|
39
|
+
for (let i = 0; i < len; i++) {
|
|
40
|
+
const value = encodeCompactIdToString(i);
|
|
41
|
+
result.add(value);
|
|
42
|
+
// Strong rules:
|
|
43
|
+
assert(!value.includes("/"), "no slashses");
|
|
44
|
+
assert(value.length > 0, "length");
|
|
45
|
+
// Soft rules: these rules can be broken, but they are great to have for efficiency
|
|
46
|
+
// as such IDs are encoded as JSON, and some symbols require escaping
|
|
47
|
+
assert(!value.includes('"'), "no quotes");
|
|
48
|
+
assert(!value.includes("\\"), "no backslashes");
|
|
49
|
+
}
|
|
50
|
+
assert(result.size === len, "collision detected!");
|
|
51
|
+
});
|
|
52
|
+
it("encodeCompactIdToString() with prefix", () => {
|
|
53
|
+
const result = new Set();
|
|
54
|
+
const len = 1000;
|
|
55
|
+
for (let i = 0; i < len; i++) {
|
|
56
|
+
const value = encodeCompactIdToString(i, "_");
|
|
57
|
+
result.add(value);
|
|
58
|
+
assert(!value.includes("/"), "no slashses");
|
|
59
|
+
assert(value.startsWith("_"), "prefix");
|
|
60
|
+
assert(value.length > 1, "length");
|
|
61
|
+
}
|
|
62
|
+
assert(result.size === len, "collision detected!");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../src/test/utils.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,UAAU,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAErB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,KAAK,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7D,MAAM,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,KAAK,iBAAiB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EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,uBAAuB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9C,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAElB,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;SACnC;QACD,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { encodeCompactIdToString } from \"../utils.js\";\n\ndescribe(\"Utils\", () => {\n\tbeforeEach(() => {});\n\n\tit(\"encodeCompactIdToString() with strings\", () => {\n\t\tassert(encodeCompactIdToString(\"a-b-c\") === \"a-b-c\", \"text\");\n\t\tassert(encodeCompactIdToString(\"_abcdefghijklmn\") === \"_abcdefghijklmn\", \"text\");\n\t});\n\n\tit(\"encodeCompactIdToString() has base of 64 (sort of)\", () => {\n\t\tconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ[abcdefghijklmnopqrstuvwxyz{01234567890\";\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tassert(value.length === 1, \"length\");\n\t\t\tassert(chars[i] === value, \"value\");\n\t\t}\n\n\t\tfor (let i = 64; i < 65 * 64 - 1; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tassert(value.length === 2, \"length\");\n\t\t\tassert(chars.includes(value[0]), \"value\");\n\t\t\tassert(chars.includes(value[1]), \"value\");\n\t\t}\n\n\t\t// This is a bit weird, as it does not work as our intuition suggests.\n\t\t// That's because in base10 system we do not use \"01\" form - leading 0 is not used.\n\t\t// Here, because we use forms like 01, 001, 011, we can put more numbers into less chars.\n\t\tassert(encodeCompactIdToString(64) === \"AA\", \"AA\");\n\t\tassert(encodeCompactIdToString(64 * 64) === \"9A\", \"9A\");\n\t\tassert(encodeCompactIdToString(64 * 64 * 64) === \"89A\", \"89A\");\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64) === \"889A\", \"889A\"); // 16M!\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64) === \"8889A\", \"8889A\"); // 1G (~10^9)\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64 * 64) === \"88889A\", \"88889A\");\n\t});\n\n\tit(\"encodeCompactIdToString() generates Unique values\", () => {\n\t\tconst result: Set<string> = new Set();\n\t\tconst len = 10000;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tresult.add(value);\n\n\t\t\t// Strong rules:\n\t\t\tassert(!value.includes(\"/\"), \"no slashses\");\n\t\t\tassert(value.length > 0, \"length\");\n\n\t\t\t// Soft rules: these rules can be broken, but they are great to have for efficiency\n\t\t\t// as such IDs are encoded as JSON, and some symbols require escaping\n\t\t\tassert(!value.includes('\"'), \"no quotes\");\n\t\t\tassert(!value.includes(\"\\\\\"), \"no backslashes\");\n\t\t}\n\t\tassert(result.size === len, \"collision detected!\");\n\t});\n\n\tit(\"encodeCompactIdToString() with prefix\", () => {\n\t\tconst result: Set<string> = new Set();\n\t\tconst len = 1000;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst value = encodeCompactIdToString(i, \"_\");\n\t\t\tresult.add(value);\n\n\t\t\tassert(!value.includes(\"/\"), \"no slashses\");\n\t\t\tassert(value.startsWith(\"_\"), \"prefix\");\n\t\t\tassert(value.length > 1, \"length\");\n\t\t}\n\t\tassert(result.size === len, \"collision detected!\");\n\t});\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpackUsedRoutes.d.ts","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,yBAiBvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpackUsedRoutes.js","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAA6B;IACvE,oFAAoF;IACpF,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;IACvF,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE;QACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACrC;aAAM;YACN,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;SAClD;KACD;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Helper function that unpacks the used routes of children from a given node's used routes.\n * @param usedRoutes - The used routes of a node.\n * @returns A map of used routes of each children of the the given node.\n * @internal\n */\nexport function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]) {\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst filteredUsedRoutes = usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tconst childUsedRoutesMap: Map<string, string[]> = new Map();\n\tfor (const route of filteredUsedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5e0 /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childUsedRoutes = childUsedRoutesMap.get(childId);\n\t\tif (childUsedRoutes !== undefined) {\n\t\t\tchildUsedRoutes.push(childUsedRoute);\n\t\t} else {\n\t\t\tchildUsedRoutesMap.set(childId, [childUsedRoute]);\n\t\t}\n\t}\n\treturn childUsedRoutesMap;\n}\n"]}
|