@fedify/vocab-runtime 2.4.0-pr.936.41 → 2.4.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/deno.json +4 -2
- package/dist/{tests/docloader-Ck8bcBir.mjs → contexts-B09jb9Pi.cjs} +173 -274
- package/dist/{tests/docloader-S_gQZ2tt.cjs → contexts-DWrj4AGR.js} +169 -293
- package/dist/{docloader-C_dir7Xb.d.ts → docloader-BMHljyYb.d.cts} +68 -2
- package/dist/{docloader-D2DTRiyA.d.cts → docloader-BMHljyYb.d.ts} +68 -2
- package/dist/internal/jsonld-cache.cjs +70 -1
- package/dist/internal/jsonld-cache.d.cts +35 -2
- package/dist/internal/jsonld-cache.d.ts +35 -2
- package/dist/internal/jsonld-cache.js +67 -2
- package/dist/internal/portable-dereference.cjs +721 -0
- package/dist/internal/portable-dereference.d.cts +349 -0
- package/dist/internal/portable-dereference.d.ts +349 -0
- package/dist/internal/portable-dereference.js +702 -0
- package/dist/internal/signed-representation.cjs +378 -0
- package/dist/internal/signed-representation.d.cts +144 -0
- package/dist/internal/signed-representation.d.ts +144 -0
- package/dist/internal/signed-representation.js +371 -0
- package/dist/jsonld.cjs +2 -2
- package/dist/mod.cjs +762 -4529
- package/dist/mod.d.cts +427 -9
- package/dist/mod.d.ts +427 -10
- package/dist/mod.js +742 -4524
- package/dist/portable-6Aj-7dZJ.d.cts +160 -0
- package/dist/portable-nkTiqH0w.d.ts +160 -0
- package/dist/tests/body-DpC9p-iG.mjs +130 -0
- package/dist/tests/body-cKLBprYm.cjs +153 -0
- package/dist/tests/body.test.cjs +89 -0
- package/dist/tests/body.test.d.cts +1 -0
- package/dist/tests/body.test.d.mts +1 -0
- package/dist/tests/body.test.mjs +90 -0
- package/dist/tests/contexts-C9Lj11SC.cjs +4533 -0
- package/dist/tests/contexts-duRA_dDC.mjs +4522 -0
- package/dist/tests/decimal.test.cjs +9 -7
- package/dist/tests/decimal.test.mjs +9 -6
- package/dist/tests/digest-3FeH2Y-Q.cjs +176 -0
- package/dist/tests/digest-COC7xDiQ.mjs +141 -0
- package/dist/tests/digest.test.cjs +102 -0
- package/dist/tests/digest.test.d.cts +1 -0
- package/dist/tests/digest.test.d.mts +1 -0
- package/dist/tests/digest.test.mjs +103 -0
- package/dist/tests/docloader-DyZ1JGIl.cjs +398 -0
- package/dist/tests/docloader-tUmMeXjU.mjs +375 -0
- package/dist/tests/docloader.test.cjs +816 -39
- package/dist/tests/docloader.test.mjs +810 -34
- package/dist/tests/internal/multicodec.test.cjs +2 -3
- package/dist/tests/internal/multicodec.test.mjs +2 -2
- package/dist/tests/internal/portable-dereference.test.cjs +172 -0
- package/dist/tests/internal/portable-dereference.test.d.cts +1 -0
- package/dist/tests/internal/portable-dereference.test.d.mts +1 -0
- package/dist/tests/internal/portable-dereference.test.mjs +173 -0
- package/dist/tests/jsonld-CmDhHNTx.cjs +12 -0
- package/dist/tests/jsonld-DweIJ07b.mjs +5 -0
- package/dist/tests/jsonld-cache-BEXiiM-V.cjs +386 -0
- package/dist/tests/jsonld-cache-DFnWsLuZ.mjs +339 -0
- package/dist/tests/jsonld-cache.test.cjs +102 -298
- package/dist/tests/jsonld-cache.test.mjs +95 -289
- package/dist/tests/{key-_wXwomh_.cjs → key-C-AYkdJJ.cjs} +11 -4
- package/dist/tests/{key-CDGDH_vC.mjs → key-C2Db_TAJ.mjs} +11 -3
- package/dist/tests/key.test.cjs +6 -5
- package/dist/tests/key.test.mjs +6 -4
- package/dist/tests/{langstr-Di5AvKpB.mjs → langstr-DYRmJqFn.mjs} +5 -2
- package/dist/tests/{langstr-CbAxaeEZ.cjs → langstr-_PqsL1ae.cjs} +5 -2
- package/dist/tests/langstr.test.cjs +11 -4
- package/dist/tests/langstr.test.mjs +9 -2
- package/dist/tests/langtag-CUppHs_s.mjs +45 -0
- package/dist/tests/langtag-Czjvxfzx.cjs +50 -0
- package/dist/tests/langtag.test.cjs +45 -0
- package/dist/tests/langtag.test.d.cts +1 -0
- package/dist/tests/langtag.test.d.mts +1 -0
- package/dist/tests/langtag.test.mjs +46 -0
- package/dist/tests/link.test.cjs +2 -3
- package/dist/tests/link.test.mjs +2 -2
- package/dist/tests/multibase/multibase.test.cjs +8 -9
- package/dist/tests/multibase/multibase.test.mjs +6 -6
- package/dist/tests/{multibase-Bz_UUDtL.cjs → multibase-B5Mea7Ip.cjs} +19 -2
- package/dist/tests/{multibase-B4bvakyA.mjs → multibase-BPnF_L4e.mjs} +12 -1
- package/dist/tests/portable-dereference-DmTYDy2p.mjs +250 -0
- package/dist/tests/portable-dereference-qTLMqe2_.cjs +279 -0
- package/dist/tests/portable-media-5p8azal0.cjs +153 -0
- package/dist/tests/portable-media-B_lt9MMA.mjs +148 -0
- package/dist/tests/portable-media.test.cjs +222 -0
- package/dist/tests/portable-media.test.d.cts +1 -0
- package/dist/tests/portable-media.test.d.mts +1 -0
- package/dist/tests/portable-media.test.mjs +223 -0
- package/dist/tests/portable-workers.test.cjs +36 -0
- package/dist/tests/portable-workers.test.d.cts +2 -0
- package/dist/tests/portable-workers.test.d.mts +2 -0
- package/dist/tests/portable-workers.test.mjs +35 -0
- package/dist/tests/{request-uk51rkhO.cjs → request-BgjA9wyl.cjs} +10 -4
- package/dist/tests/{request-C8CaGwtt.mjs → request-DodZNukP.mjs} +8 -2
- package/dist/tests/request.test.cjs +7 -4
- package/dist/tests/request.test.mjs +5 -2
- package/dist/tests/signed-representation.test.cjs +588 -0
- package/dist/tests/signed-representation.test.d.cts +1 -0
- package/dist/tests/signed-representation.test.d.mts +1 -0
- package/dist/tests/signed-representation.test.mjs +589 -0
- package/dist/tests/temporal.test.cjs +1 -2
- package/dist/tests/temporal.test.mjs +1 -1
- package/dist/tests/url-BNakuZ8k.cjs +998 -0
- package/dist/tests/url-DMxmp7ZG.mjs +859 -0
- package/dist/tests/url.test.cjs +489 -6
- package/dist/tests/url.test.mjs +489 -5
- package/dist/url-DrGTR8yv.cjs +993 -0
- package/dist/url-Dzyp-NsC.js +860 -0
- package/package.json +27 -4
- package/scripts/test-bun.mjs +17 -0
- package/src/body.test.ts +125 -0
- package/src/body.ts +152 -0
- package/src/contexts/cid-v1.json +114 -0
- package/src/contexts/fep-22cd.json +21 -0
- package/src/contexts/fep-6757.json +12 -0
- package/src/contexts/joinmastodon.json +1 -1
- package/src/contexts/miscellany.json +17 -0
- package/src/contexts.ts +47 -1
- package/src/digest.test.ts +220 -0
- package/src/digest.ts +229 -0
- package/src/docloader.test.ts +1066 -27
- package/src/docloader.ts +322 -105
- package/src/internal/jsonld-cache.ts +97 -1
- package/src/internal/portable-dereference.test.ts +254 -0
- package/src/internal/portable-dereference.ts +1000 -0
- package/src/internal/signed-representation.ts +565 -0
- package/src/jsonld-cache.test.ts +89 -0
- package/src/key.test.ts +9 -0
- package/src/key.ts +11 -1
- package/src/langstr.test.ts +18 -1
- package/src/langstr.ts +6 -2
- package/src/langtag.test.ts +53 -0
- package/src/langtag.ts +76 -0
- package/src/mod.ts +29 -0
- package/src/multibase/multibase.test.ts +5 -5
- package/src/portable-media.test.ts +293 -0
- package/src/portable-media.ts +264 -0
- package/src/portable-workers.test.ts +81 -0
- package/src/portable.ts +180 -0
- package/src/preprocessor.ts +7 -0
- package/src/request.test.ts +10 -1
- package/src/request.ts +9 -1
- package/src/signed-representation.test.ts +338 -0
- package/src/url.test.ts +823 -3
- package/src/url.ts +700 -23
- package/tsdown.config.ts +2 -0
- package/dist/tests/url-CsOV_B_P.cjs +0 -482
- package/dist/tests/url-Du7RQQgP.mjs +0 -392
- package/dist/url-DD4F0ULf.cjs +0 -483
- package/dist/url-DGVbSVVi.js +0 -393
- /package/dist/{chunk-M78iaK0I.cjs → rolldown-runtime-B7lfambq.cjs} +0 -0
- /package/dist/tests/{link-NUUWCdnK.mjs → link-Cevmc87v.mjs} +0 -0
- /package/dist/tests/{link-FguCydMA.cjs → link-DlKm8bEr.cjs} +0 -0
- /package/dist/tests/{multicodec-CxGVGa91.cjs → multicodec-CLRPeW4N.cjs} +0 -0
- /package/dist/tests/{multicodec-CyFp54fI.mjs → multicodec-CRIj_05H.mjs} +0 -0
- /package/dist/tests/{chunk-C2EiDwsr.cjs → rolldown-runtime-emK7D4bc.cjs} +0 -0
|
@@ -1,305 +1,109 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const require_url = require("./url-BNakuZ8k.cjs");
|
|
2
|
+
const require_jsonld = require("./jsonld-CmDhHNTx.cjs");
|
|
3
|
+
const require_jsonld_cache = require("./jsonld-cache-BEXiiM-V.cjs");
|
|
4
4
|
let node_test = require("node:test");
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
function normalizeJsonLdIris(value, iriKeys, iriPattern = /^ap(?:\+ef61)?:\/\//i) {
|
|
30
|
-
return normalize(value, void 0, 0, void 0);
|
|
31
|
-
function isIriPosition(key, parentKey) {
|
|
32
|
-
return iriKeys.has(key) || (key === "@value" || key === "@list" || key === "@set") && parentKey != null && iriKeys.has(parentKey);
|
|
33
|
-
}
|
|
34
|
-
function arrayItemParentKey(key, parentKey) {
|
|
35
|
-
return key === "@list" || key === "@set" ? parentKey : key;
|
|
36
|
-
}
|
|
37
|
-
function entryParentKey(entryKey, key, parentKey) {
|
|
38
|
-
if (entryKey === "@list" || entryKey === "@set") return parentKey ?? key;
|
|
39
|
-
return key === "@list" || key === "@set" ? parentKey : key;
|
|
40
|
-
}
|
|
41
|
-
function normalize(value, key, depth = 0, parentKey) {
|
|
42
|
-
if (depth > 32 || key === "@context") return value;
|
|
43
|
-
if (typeof value === "string") {
|
|
44
|
-
if (key != null && isIriPosition(key, parentKey) && iriPattern.test(value)) try {
|
|
45
|
-
return require_url.formatIri(value);
|
|
46
|
-
} catch {
|
|
47
|
-
return value;
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
if (Array.isArray(value)) {
|
|
52
|
-
let clone;
|
|
53
|
-
const itemParentKey = arrayItemParentKey(key, parentKey);
|
|
54
|
-
for (let i = 0; i < value.length; i++) {
|
|
55
|
-
const result = normalize(value[i], key, depth + 1, itemParentKey);
|
|
56
|
-
if (result !== value[i]) {
|
|
57
|
-
clone ??= value.slice(0, i);
|
|
58
|
-
clone.push(result);
|
|
59
|
-
} else if (clone != null) clone.push(value[i]);
|
|
60
|
-
}
|
|
61
|
-
return clone ?? value;
|
|
62
|
-
}
|
|
63
|
-
if (value == null || typeof value !== "object") return value;
|
|
64
|
-
const object = value;
|
|
65
|
-
let clone;
|
|
66
|
-
for (const entryKey of globalThis.Object.keys(object)) {
|
|
67
|
-
const result = normalize(object[entryKey], entryKey, depth + 1, entryParentKey(entryKey, key, parentKey));
|
|
68
|
-
if (result !== object[entryKey]) {
|
|
69
|
-
clone ??= { ...object };
|
|
70
|
-
defineJsonLdProperty(clone, entryKey, result);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return clone ?? object;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Finds the first JSON-LD context in a value.
|
|
78
|
-
*
|
|
79
|
-
* @internal Technically exported for generated vocabulary classes, but not
|
|
80
|
-
* part of the public API contract. This is not considered public API for
|
|
81
|
-
* Semantic Versioning decisions.
|
|
82
|
-
*/
|
|
83
|
-
function getJsonLdContext(value, depth = 0) {
|
|
84
|
-
if (depth > 32) return void 0;
|
|
85
|
-
if (Array.isArray(value)) {
|
|
86
|
-
for (const item of value) {
|
|
87
|
-
const context = getJsonLdContext(item, depth + 1);
|
|
88
|
-
if (context !== void 0) return context;
|
|
89
|
-
}
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (value == null || typeof value !== "object" || !("@context" in value)) return;
|
|
93
|
-
return value["@context"];
|
|
94
|
-
}
|
|
95
|
-
function getOwnJsonLdContext(value) {
|
|
96
|
-
if (value == null || typeof value !== "object" || Array.isArray(value) || !("@context" in value)) return noJsonLdContext;
|
|
97
|
-
return value["@context"];
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Recompacts normalized JSON-LD cache data against the original context.
|
|
101
|
-
*
|
|
102
|
-
* @internal Technically exported for generated vocabulary classes, but not
|
|
103
|
-
* part of the public API contract. This is not considered public API for
|
|
104
|
-
* Semantic Versioning decisions.
|
|
105
|
-
*/
|
|
106
|
-
async function compactJsonLdCache(normalized, original, documentLoader, depth = 0, inheritedContext) {
|
|
107
|
-
if (depth > 32) return normalized;
|
|
108
|
-
if (Array.isArray(original)) {
|
|
109
|
-
const normalizedArray = Array.isArray(normalized) ? normalized : normalized != null && typeof normalized === "object" && "@graph" in normalized && Array.isArray(normalized["@graph"]) ? normalized["@graph"] : void 0;
|
|
110
|
-
if (normalizedArray == null) return normalized;
|
|
111
|
-
let clone;
|
|
112
|
-
for (let i = 0; i < normalizedArray.length; i++) {
|
|
113
|
-
const item = await compactJsonLdCache(normalizedArray[i], original[i], documentLoader, depth + 1, inheritedContext);
|
|
114
|
-
if (item !== normalizedArray[i]) {
|
|
115
|
-
clone ??= normalizedArray.slice(0, i);
|
|
116
|
-
clone.push(item);
|
|
117
|
-
} else if (clone != null) clone.push(normalizedArray[i]);
|
|
118
|
-
}
|
|
119
|
-
return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray);
|
|
120
|
-
}
|
|
121
|
-
const ownContext = getOwnJsonLdContext(original);
|
|
122
|
-
const context = ownContext === noJsonLdContext ? inheritedContext : ownContext;
|
|
123
|
-
if (context == null) return preserveNoContextJsonLdShape(normalized, original, depth);
|
|
124
|
-
return await preserveJsonLdShape(await mergeUnmappedTerms(await jsonld_default.compact(Array.isArray(normalized) && normalized.length === 1 ? normalized[0] : normalized, context, { documentLoader }), original, context, documentLoader), original, context, documentLoader, depth);
|
|
125
|
-
}
|
|
126
|
-
function preserveNoContextJsonLdShape(normalized, original, depth = 0) {
|
|
127
|
-
if (depth > 32) return normalized;
|
|
128
|
-
if (original == null || typeof original !== "object" || Array.isArray(original)) return normalized;
|
|
129
|
-
const normalizedObject = Array.isArray(normalized) && normalized.length === 1 ? normalized[0] : normalized;
|
|
130
|
-
if (normalizedObject == null || typeof normalizedObject !== "object" || Array.isArray(normalizedObject)) return normalized;
|
|
131
|
-
const source = normalizedObject;
|
|
132
|
-
const originalObject = original;
|
|
133
|
-
let clone;
|
|
134
|
-
for (const key of globalThis.Object.keys(originalObject)) {
|
|
135
|
-
if (!globalThis.Object.prototype.hasOwnProperty.call(source, key)) continue;
|
|
136
|
-
const value = preserveNoContextValue(source[key], originalObject[key], depth + 1);
|
|
137
|
-
if (value !== originalObject[key]) {
|
|
138
|
-
clone ??= { ...originalObject };
|
|
139
|
-
defineJsonLdProperty(clone, key, value);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return clone ?? original;
|
|
143
|
-
}
|
|
144
|
-
function preserveNoContextValue(normalized, original, depth) {
|
|
145
|
-
if (depth > 32) return normalized;
|
|
146
|
-
if (Array.isArray(original)) {
|
|
147
|
-
const normalizedArray = Array.isArray(normalized) ? normalized : [normalized];
|
|
148
|
-
let clone;
|
|
149
|
-
for (let i = 0; i < original.length; i++) {
|
|
150
|
-
const value = preserveNoContextValue(normalizedArray[i], original[i], depth + 1);
|
|
151
|
-
if (value !== original[i]) {
|
|
152
|
-
clone ??= original.slice(0, i);
|
|
153
|
-
clone.push(value);
|
|
154
|
-
} else if (clone != null) clone.push(original[i]);
|
|
155
|
-
}
|
|
156
|
-
return clone ?? original;
|
|
157
|
-
}
|
|
158
|
-
const normalizedValue = Array.isArray(normalized) ? normalized[0] : normalized;
|
|
159
|
-
if (normalizedValue == null || typeof normalizedValue !== "object" || Array.isArray(normalizedValue)) return normalizedValue;
|
|
160
|
-
const normalizedObject = normalizedValue;
|
|
161
|
-
if (original != null && typeof original === "object" && !Array.isArray(original)) return preserveNoContextJsonLdShape(normalizedObject, original, depth + 1);
|
|
162
|
-
if (typeof normalizedObject["@id"] === "string") return normalizedObject["@id"];
|
|
163
|
-
if ("@value" in normalizedObject) return normalizedObject["@value"];
|
|
164
|
-
return normalizedValue;
|
|
165
|
-
}
|
|
166
|
-
function getTopLevelTerms(value) {
|
|
167
|
-
const terms = /* @__PURE__ */ new Set();
|
|
168
|
-
const nodes = Array.isArray(value) ? value : [value];
|
|
169
|
-
for (const node of nodes) {
|
|
170
|
-
if (node == null || typeof node !== "object" || Array.isArray(node)) continue;
|
|
171
|
-
for (const key of globalThis.Object.keys(node)) {
|
|
172
|
-
if (key.startsWith("@")) continue;
|
|
173
|
-
terms.add(key);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return terms;
|
|
177
|
-
}
|
|
178
|
-
async function mergeUnmappedTerms(compacted, original, context, documentLoader) {
|
|
179
|
-
if (original == null || typeof original !== "object" || Array.isArray(original) || compacted == null || typeof compacted !== "object" || Array.isArray(compacted)) return compacted;
|
|
180
|
-
const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== "@context" && !globalThis.Object.prototype.hasOwnProperty.call(compacted, key));
|
|
181
|
-
if (unmappedKeys.length < 1) return compacted;
|
|
182
|
-
const result = { ...compacted };
|
|
183
|
-
const compactedWithContext = compacted != null && typeof compacted === "object" && !Array.isArray(compacted) && !("@context" in compacted) ? {
|
|
184
|
-
"@context": context,
|
|
185
|
-
...compacted
|
|
186
|
-
} : compacted;
|
|
187
|
-
const compactedTerms = getTopLevelTerms(await jsonld_default.expand(compactedWithContext, { documentLoader }));
|
|
188
|
-
const dummyPrefix = "urn:fedify:dummy:";
|
|
189
|
-
const dummy = { "@context": context };
|
|
190
|
-
for (let i = 0; i < unmappedKeys.length; i++) defineJsonLdProperty(dummy, unmappedKeys[i], `${dummyPrefix}${i}`);
|
|
191
|
-
const expanded = await jsonld_default.expand(dummy, { documentLoader });
|
|
192
|
-
const representedKeys = /* @__PURE__ */ new Set();
|
|
193
|
-
const nodes = Array.isArray(expanded) ? expanded : [expanded];
|
|
194
|
-
for (const node of nodes) {
|
|
195
|
-
if (node == null || typeof node !== "object" || Array.isArray(node)) continue;
|
|
196
|
-
for (const [term, termValue] of globalThis.Object.entries(node)) {
|
|
197
|
-
if (!compactedTerms.has(term)) continue;
|
|
198
|
-
for (let i = 0; i < unmappedKeys.length; i++) if (containsValue(termValue, `${dummyPrefix}${i}`)) representedKeys.add(unmappedKeys[i]);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
for (const key of unmappedKeys) if (!representedKeys.has(key)) defineJsonLdProperty(result, key, original[key]);
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
|
-
function defineJsonLdProperty(object, key, value) {
|
|
205
|
-
globalThis.Object.defineProperty(object, key, {
|
|
206
|
-
value,
|
|
207
|
-
enumerable: true,
|
|
208
|
-
configurable: true,
|
|
209
|
-
writable: true
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function containsValue(value, expected, depth = 0) {
|
|
213
|
-
if (depth > 32) return false;
|
|
214
|
-
if (value === expected) return true;
|
|
215
|
-
if (Array.isArray(value)) return value.some((item) => containsValue(item, expected, depth + 1));
|
|
216
|
-
if (value == null || typeof value !== "object") return false;
|
|
217
|
-
return globalThis.Object.entries(value).some(([key, item]) => key !== "@context" && containsValue(item, expected, depth + 1));
|
|
218
|
-
}
|
|
219
|
-
async function preserveJsonLdShape(compacted, original, context, documentLoader, depth = 0) {
|
|
220
|
-
if (depth > 32) return compacted;
|
|
221
|
-
if (compacted === original) return compacted;
|
|
222
|
-
if (original == null || typeof original !== "object" || compacted == null || typeof compacted !== "object") return compacted;
|
|
223
|
-
if (Array.isArray(original)) {
|
|
224
|
-
const compactedArray = Array.isArray(compacted) ? compacted : "@graph" in compacted && Array.isArray(compacted["@graph"]) ? compacted["@graph"] : void 0;
|
|
225
|
-
if (compactedArray == null) return compacted;
|
|
226
|
-
let clone;
|
|
227
|
-
for (let i = 0; i < compactedArray.length; i++) {
|
|
228
|
-
const value = await preserveJsonLdShape(compactedArray[i], original[i], context, documentLoader, depth + 1);
|
|
229
|
-
const originalContext = original[i] != null && typeof original[i] === "object" && !Array.isArray(original[i]) && "@context" in original[i] ? original[i]["@context"] : void 0;
|
|
230
|
-
const shaped = originalContext !== void 0 && value != null && typeof value === "object" && !Array.isArray(value) && !("@context" in value) ? {
|
|
231
|
-
"@context": originalContext,
|
|
232
|
-
...value
|
|
233
|
-
} : value;
|
|
234
|
-
if (shaped !== compactedArray[i]) {
|
|
235
|
-
clone ??= compactedArray.slice(0, i);
|
|
236
|
-
clone.push(shaped);
|
|
237
|
-
} else if (clone != null) clone.push(compactedArray[i]);
|
|
238
|
-
}
|
|
239
|
-
return clone ?? (Array.isArray(compacted) ? compacted : compactedArray);
|
|
5
|
+
let node_assert = require("node:assert");
|
|
6
|
+
//#region src/jsonld-cache.test.ts
|
|
7
|
+
(0, node_test.test)("getPortableActorGateways() preserves unmapped portable actor gateways", () => {
|
|
8
|
+
const gateways = [
|
|
9
|
+
{ "@value": "https://second.example" },
|
|
10
|
+
{ "@value": "https://first.example" },
|
|
11
|
+
{ "@value": "not a valid gateway" }
|
|
12
|
+
];
|
|
13
|
+
for (const id of [
|
|
14
|
+
"ap://did:key:z6Mkabc/actor",
|
|
15
|
+
"ap+ef61://did:key:z6Mkabc/actor",
|
|
16
|
+
"https://gateway.example/.well-known/apgateway/did:key:z6Mkabc/actor"
|
|
17
|
+
]) {
|
|
18
|
+
const node = {
|
|
19
|
+
"@id": id,
|
|
20
|
+
"http://www.w3.org/ns/ldp#inbox": [{ "@id": `${id}/inbox` }],
|
|
21
|
+
"https://www.w3.org/ns/activitystreams#outbox": [{ "@id": `${id}/outbox` }],
|
|
22
|
+
"_:gateways": gateways
|
|
23
|
+
};
|
|
24
|
+
const original = structuredClone(node);
|
|
25
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(node), gateways, id);
|
|
26
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(node, false), void 0, id);
|
|
27
|
+
(0, node_assert.deepStrictEqual)(node, original);
|
|
240
28
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
29
|
+
});
|
|
30
|
+
(0, node_test.test)("getPortableActorGateways() gives mapped gateways precedence", () => {
|
|
31
|
+
const canonical = "https://w3id.org/fep/ef61/gateways";
|
|
32
|
+
const gateways = [{ "@list": [{ "@id": "https://gateway.example" }] }];
|
|
33
|
+
const node = {
|
|
34
|
+
"@id": "ap://did:key:z6Mkabc/actor",
|
|
35
|
+
"http://www.w3.org/ns/ldp#inbox": [],
|
|
36
|
+
"https://www.w3.org/ns/activitystreams#outbox": [],
|
|
37
|
+
"_:gateways": [{ "@value": "https://other.example" }],
|
|
38
|
+
[canonical]: gateways
|
|
39
|
+
};
|
|
40
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(node), gateways);
|
|
41
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(node, false), gateways);
|
|
42
|
+
for (const value of [
|
|
43
|
+
void 0,
|
|
44
|
+
null,
|
|
45
|
+
{},
|
|
46
|
+
"https://gateway.example",
|
|
47
|
+
[]
|
|
48
|
+
]) {
|
|
49
|
+
node[canonical] = value;
|
|
50
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(node), Array.isArray(value) ? value : void 0);
|
|
256
51
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
52
|
+
});
|
|
53
|
+
(0, node_test.test)("getPortableActorGateways() limits unmapped terms to portable actors", () => {
|
|
54
|
+
const node = {
|
|
55
|
+
"@id": "ap://did:key:z6Mkabc/actor",
|
|
56
|
+
"http://www.w3.org/ns/ldp#inbox": [],
|
|
57
|
+
"https://www.w3.org/ns/activitystreams#outbox": [],
|
|
58
|
+
"_:gateways": [{ "@value": "https://gateway.example" }]
|
|
59
|
+
};
|
|
60
|
+
for (const id of [
|
|
61
|
+
void 0,
|
|
62
|
+
1,
|
|
63
|
+
"not an IRI",
|
|
64
|
+
"https://ordinary.example/actor",
|
|
65
|
+
"https://gateway.example/.well-known/apgateway/not-a-did/actor",
|
|
66
|
+
"https://user@gateway.example/.well-known/apgateway/did:key:z6Mkabc/actor"
|
|
67
|
+
]) (0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways({
|
|
68
|
+
...node,
|
|
69
|
+
"@id": id
|
|
70
|
+
}), void 0);
|
|
71
|
+
for (const property of ["http://www.w3.org/ns/ldp#inbox", "https://www.w3.org/ns/activitystreams#outbox"]) {
|
|
72
|
+
const nonActor = { ...node };
|
|
73
|
+
delete nonActor[property];
|
|
74
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways(nonActor), void 0);
|
|
262
75
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
function combineContexts(inheritedContext, ownContext) {
|
|
274
|
-
if (ownContext === noJsonLdContext || ownContext === inheritedContext) return inheritedContext;
|
|
275
|
-
if (ownContext == null) return ownContext;
|
|
276
|
-
const inherited = Array.isArray(inheritedContext) ? inheritedContext : [inheritedContext];
|
|
277
|
-
const own = Array.isArray(ownContext) ? ownContext : [ownContext];
|
|
278
|
-
return [...inherited, ...own];
|
|
279
|
-
}
|
|
280
|
-
//#endregion
|
|
281
|
-
//#region src/jsonld-cache.test.ts
|
|
76
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways({
|
|
77
|
+
...node,
|
|
78
|
+
"_:gateways": null
|
|
79
|
+
}), void 0);
|
|
80
|
+
const empty = [];
|
|
81
|
+
(0, node_assert.strictEqual)(require_jsonld_cache.getPortableActorGateways({
|
|
82
|
+
...node,
|
|
83
|
+
"_:gateways": empty
|
|
84
|
+
}), empty);
|
|
85
|
+
});
|
|
282
86
|
(0, node_test.test)("isTrustedIriOrigin() trusts same portable IRI origins", () => {
|
|
283
|
-
(0, node_assert.ok)(isTrustedIriOrigin({}, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap+ef61://did:key:z6Mkabc/outbox")));
|
|
284
|
-
(0, node_assert.ok)(!isTrustedIriOrigin({}, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap://did:key:z6Mkdef/outbox")));
|
|
285
|
-
(0, node_assert.ok)(isTrustedIriOrigin({ crossOrigin: "trust" }, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap://did:key:z6Mkdef/outbox")));
|
|
87
|
+
(0, node_assert.ok)(require_jsonld_cache.isTrustedIriOrigin({}, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap+ef61://did:key:z6Mkabc/outbox")));
|
|
88
|
+
(0, node_assert.ok)(!require_jsonld_cache.isTrustedIriOrigin({}, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap://did:key:z6Mkdef/outbox")));
|
|
89
|
+
(0, node_assert.ok)(require_jsonld_cache.isTrustedIriOrigin({ crossOrigin: "trust" }, require_url.parseIri("ap://did:key:z6Mkabc/actor"), require_url.parseIri("ap://did:key:z6Mkdef/outbox")));
|
|
286
90
|
});
|
|
287
91
|
(0, node_test.test)("normalizeJsonLdIris() normalizes selected JSON-LD IRI positions", () => {
|
|
288
|
-
(0, node_assert.deepStrictEqual)(normalizeJsonLdIris({
|
|
92
|
+
(0, node_assert.deepStrictEqual)(require_jsonld_cache.normalizeJsonLdIris({
|
|
289
93
|
"@id": "ap://did:key:z6Mkabc/object",
|
|
290
94
|
"https://example.com/ns#ref": [{ "@value": "ap://did:key:z6Mkabc/ref" }],
|
|
291
95
|
"https://example.com/ns#text": [{ "@value": "ap://did:key:z6Mkabc/not-an-iri-position" }]
|
|
292
|
-
}, new Set(["@id", "https://example.com/ns#ref"])), {
|
|
96
|
+
}, /* @__PURE__ */ new Set(["@id", "https://example.com/ns#ref"])), {
|
|
293
97
|
"@id": "ap+ef61://did:key:z6Mkabc/object",
|
|
294
98
|
"https://example.com/ns#ref": [{ "@value": "ap+ef61://did:key:z6Mkabc/ref" }],
|
|
295
99
|
"https://example.com/ns#text": [{ "@value": "ap://did:key:z6Mkabc/not-an-iri-position" }]
|
|
296
100
|
});
|
|
297
101
|
});
|
|
298
102
|
(0, node_test.test)("normalizeJsonLdIris() preserves IRI context in list/set wrappers", () => {
|
|
299
|
-
(0, node_assert.deepStrictEqual)(normalizeJsonLdIris({ "https://example.com/ns#ref": [{ "@list": [{ "@value": "ap://did:key:z6Mkabc/listed" }] }, { "@set": [{ "@value": "ap://did:key:z6Mkabc/set" }] }] }, new Set(["https://example.com/ns#ref"])), { "https://example.com/ns#ref": [{ "@list": [{ "@value": "ap+ef61://did:key:z6Mkabc/listed" }] }, { "@set": [{ "@value": "ap+ef61://did:key:z6Mkabc/set" }] }] });
|
|
103
|
+
(0, node_assert.deepStrictEqual)(require_jsonld_cache.normalizeJsonLdIris({ "https://example.com/ns#ref": [{ "@list": [{ "@value": "ap://did:key:z6Mkabc/listed" }] }, { "@set": [{ "@value": "ap://did:key:z6Mkabc/set" }] }] }, /* @__PURE__ */ new Set(["https://example.com/ns#ref"])), { "https://example.com/ns#ref": [{ "@list": [{ "@value": "ap+ef61://did:key:z6Mkabc/listed" }] }, { "@set": [{ "@value": "ap+ef61://did:key:z6Mkabc/set" }] }] });
|
|
300
104
|
});
|
|
301
105
|
(0, node_test.test)("normalizeJsonLdIris() defines prototype-like keys safely", () => {
|
|
302
|
-
const iriKeys = new Set(["__proto__"]);
|
|
106
|
+
const iriKeys = /* @__PURE__ */ new Set(["__proto__"]);
|
|
303
107
|
const value = {};
|
|
304
108
|
globalThis.Object.defineProperty(value, "__proto__", {
|
|
305
109
|
value: "ap://did:key:z6Mkabc/object",
|
|
@@ -307,13 +111,13 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
307
111
|
configurable: true,
|
|
308
112
|
writable: true
|
|
309
113
|
});
|
|
310
|
-
const normalized = normalizeJsonLdIris(value, iriKeys);
|
|
114
|
+
const normalized = require_jsonld_cache.normalizeJsonLdIris(value, iriKeys);
|
|
311
115
|
(0, node_assert.strictEqual)(globalThis.Object.getOwnPropertyDescriptor(normalized, "__proto__")?.value, "ap+ef61://did:key:z6Mkabc/object");
|
|
312
116
|
(0, node_assert.strictEqual)(globalThis.Object.getPrototypeOf(normalized), Object.prototype);
|
|
313
117
|
});
|
|
314
118
|
(0, node_test.test)("getJsonLdContext() finds nested contexts", () => {
|
|
315
119
|
const context = { name: "https://example.com/ns#name" };
|
|
316
|
-
(0, node_assert.deepStrictEqual)(getJsonLdContext([{ type: "Note" }, { "@context": context }]), context);
|
|
120
|
+
(0, node_assert.deepStrictEqual)(require_jsonld_cache.getJsonLdContext([{ type: "Note" }, { "@context": context }]), context);
|
|
317
121
|
});
|
|
318
122
|
(0, node_test.test)("compactJsonLdCache() preserves no-context object shape", async () => {
|
|
319
123
|
const original = {
|
|
@@ -322,7 +126,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
322
126
|
"https://www.w3.org/ns/activitystreams#attributedTo": [{ "@id": "ap://did:key:z6Mkabc/actor" }],
|
|
323
127
|
"https://www.w3.org/ns/activitystreams#content": [{ "@value": "No-context object shape should stay cached." }]
|
|
324
128
|
};
|
|
325
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id", "https://www.w3.org/ns/activitystreams#attributedTo"])), original), {
|
|
129
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id", "https://www.w3.org/ns/activitystreams#attributedTo"])), original), {
|
|
326
130
|
"@id": "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
327
131
|
"@type": ["https://www.w3.org/ns/activitystreams#Note"],
|
|
328
132
|
"https://www.w3.org/ns/activitystreams#attributedTo": [{ "@id": "ap+ef61://did:key:z6Mkabc/actor" }],
|
|
@@ -343,7 +147,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
343
147
|
name: "Nested object"
|
|
344
148
|
}]
|
|
345
149
|
};
|
|
346
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
150
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
347
151
|
"@id": "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
348
152
|
"@type": ["https://www.w3.org/ns/activitystreams#Note"],
|
|
349
153
|
"https://www.w3.org/ns/activitystreams#attachment": [{
|
|
@@ -368,7 +172,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
368
172
|
configurable: true,
|
|
369
173
|
writable: true
|
|
370
174
|
});
|
|
371
|
-
const compacted = await compactJsonLdCache([normalized], original);
|
|
175
|
+
const compacted = await require_jsonld_cache.compactJsonLdCache([normalized], original);
|
|
372
176
|
(0, node_assert.strictEqual)(globalThis.Object.getOwnPropertyDescriptor(compacted, "__proto__")?.value, "ap+ef61://did:key:z6Mkabc/proto");
|
|
373
177
|
(0, node_assert.strictEqual)(globalThis.Object.getPrototypeOf(compacted), Object.prototype);
|
|
374
178
|
});
|
|
@@ -390,7 +194,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
390
194
|
extra: "This nested unmapped property should stay cached."
|
|
391
195
|
}
|
|
392
196
|
};
|
|
393
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
197
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
394
198
|
"@context": context,
|
|
395
199
|
type: "as:Note",
|
|
396
200
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
@@ -422,7 +226,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
422
226
|
extra
|
|
423
227
|
}
|
|
424
228
|
};
|
|
425
|
-
const compacted = await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original);
|
|
229
|
+
const compacted = await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original);
|
|
426
230
|
(0, node_assert.strictEqual)(compacted.rootExtra, rootExtra);
|
|
427
231
|
(0, node_assert.strictEqual)(compacted.attachment.extra, extra);
|
|
428
232
|
});
|
|
@@ -443,7 +247,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
443
247
|
configurable: true,
|
|
444
248
|
writable: true
|
|
445
249
|
});
|
|
446
|
-
const compacted = await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original);
|
|
250
|
+
const compacted = await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original);
|
|
447
251
|
(0, node_assert.strictEqual)(globalThis.Object.getOwnPropertyDescriptor(compacted, "__proto__")?.value, protoValue);
|
|
448
252
|
(0, node_assert.strictEqual)(globalThis.Object.getPrototypeOf(compacted), Object.prototype);
|
|
449
253
|
});
|
|
@@ -470,7 +274,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
470
274
|
configurable: true,
|
|
471
275
|
writable: true
|
|
472
276
|
});
|
|
473
|
-
const compacted = await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original);
|
|
277
|
+
const compacted = await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original);
|
|
474
278
|
const protoDescriptor = globalThis.Object.getOwnPropertyDescriptor(compacted, "__proto__");
|
|
475
279
|
(0, node_assert.ok)(protoDescriptor?.value === "Alias represented by the compacted term." || Array.isArray(protoDescriptor?.value) && protoDescriptor.value.includes("Alias represented by the compacted term."));
|
|
476
280
|
(0, node_assert.strictEqual)(protoDescriptor?.enumerable, true);
|
|
@@ -500,7 +304,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
500
304
|
title: "Nested title."
|
|
501
305
|
}
|
|
502
306
|
};
|
|
503
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
307
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
504
308
|
"@context": context,
|
|
505
309
|
type: "as:Note",
|
|
506
310
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
@@ -532,7 +336,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
532
336
|
title: "Nested title."
|
|
533
337
|
}
|
|
534
338
|
};
|
|
535
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
339
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
536
340
|
"@context": context,
|
|
537
341
|
type: "as:Note",
|
|
538
342
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
@@ -560,7 +364,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
560
364
|
"https://example.com/ns#title": "Absolute title."
|
|
561
365
|
}
|
|
562
366
|
};
|
|
563
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
367
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
564
368
|
"@context": context,
|
|
565
369
|
type: "as:Note",
|
|
566
370
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
@@ -599,7 +403,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
599
403
|
actorRef: "ap://did:key:z6Mkabc/actor"
|
|
600
404
|
}
|
|
601
405
|
};
|
|
602
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id", "https://www.w3.org/ns/activitystreams#actor"])), original), {
|
|
406
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id", "https://www.w3.org/ns/activitystreams#actor"])), original), {
|
|
603
407
|
"@context": context,
|
|
604
408
|
type: "as:Note",
|
|
605
409
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
@@ -633,7 +437,7 @@ function combineContexts(inheritedContext, ownContext) {
|
|
|
633
437
|
key9: "Extension 9",
|
|
634
438
|
key10: "Alias represented by the compacted term."
|
|
635
439
|
};
|
|
636
|
-
(0, node_assert.deepStrictEqual)(await compactJsonLdCache(normalizeJsonLdIris(await jsonld_default.expand(original), new Set(["@id"])), original), {
|
|
440
|
+
(0, node_assert.deepStrictEqual)(await require_jsonld_cache.compactJsonLdCache(require_jsonld_cache.normalizeJsonLdIris(await require_jsonld.jsonld_default.expand(original), /* @__PURE__ */ new Set(["@id"])), original), {
|
|
637
441
|
"@context": context,
|
|
638
442
|
id: "ap+ef61://did:key:z6Mkabc/objects/1",
|
|
639
443
|
key0: "Extension 0",
|