@fedify/vocab 2.0.0-dev.279 → 2.0.0-dev.323
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 +1 -1
- package/dist/actor.test.js +2 -2
- package/dist/{deno-y1THYur-.js → deno-CpsTU8-l.js} +1 -1
- package/dist/lookup.test.js +13 -11
- package/dist/mod.cjs +1366 -6616
- package/dist/mod.d.cts +1724 -1724
- package/dist/mod.d.ts +1724 -1724
- package/dist/mod.js +681 -5937
- package/dist/type.test.js +1 -1
- package/dist/{vocab-fPKUeh35.js → vocab-B4nUNXTL.js} +668 -5922
- package/dist/vocab.test.js +2 -1
- package/package.json +5 -5
- package/src/lookup.test.ts +15 -0
- package/src/lookup.ts +4 -4
- package/src/mod.ts +6 -0
package/deno.json
CHANGED
package/dist/actor.test.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
|
|
5
5
|
import { __export } from "./chunk-BeeFIeNn.js";
|
|
6
|
-
import { Application, Group, Organization, Person, Service, test } from "./vocab-
|
|
7
|
-
import { deno_default, esm_default } from "./deno-
|
|
6
|
+
import { Application, Group, Organization, Person, Service, test } from "./vocab-B4nUNXTL.js";
|
|
7
|
+
import { deno_default, esm_default } from "./deno-CpsTU8-l.js";
|
|
8
8
|
import { getTypeId } from "./type-Dnf0m2yO.js";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
@@ -1240,7 +1240,7 @@ var esm_default = FetchMock_default;
|
|
|
1240
1240
|
//#endregion
|
|
1241
1241
|
//#region deno.json
|
|
1242
1242
|
var name = "@fedify/vocab";
|
|
1243
|
-
var version = "2.0.0-dev.
|
|
1243
|
+
var version = "2.0.0-dev.323+1d796545";
|
|
1244
1244
|
var license = "MIT";
|
|
1245
1245
|
var exports = { ".": "./src/mod.ts" };
|
|
1246
1246
|
var description = "Vocabularies library for @fedify/fedify";
|
package/dist/lookup.test.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
|
|
5
|
-
import { Collection, Note, Object as Object$1, Person, createTestTracerProvider,
|
|
6
|
-
import { deno_default, esm_default } from "./deno-
|
|
5
|
+
import { Collection, Note, Object as Object$1, Person, createTestTracerProvider, mockDocumentLoader, test } from "./vocab-B4nUNXTL.js";
|
|
6
|
+
import { deno_default, esm_default } from "./deno-CpsTU8-l.js";
|
|
7
7
|
import { getTypeId } from "./type-Dnf0m2yO.js";
|
|
8
8
|
import { assertInstanceOf } from "./utils-Dm0Onkcz.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
11
|
import { deepStrictEqual, equal, ok, rejects } from "node:assert/strict";
|
|
12
12
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
13
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
13
14
|
import { delay } from "es-toolkit";
|
|
14
15
|
|
|
15
16
|
//#region src/handle.ts
|
|
@@ -214,15 +215,13 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
|
214
215
|
* @since 1.1.0
|
|
215
216
|
*/
|
|
216
217
|
async function* traverseCollection(collection, options = {}) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
page = await page.getNext(options);
|
|
225
|
-
}
|
|
218
|
+
const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
|
|
219
|
+
let page = await collection.getFirst(options);
|
|
220
|
+
if (page == null) for await (const item of collection.getItems(options)) yield item;
|
|
221
|
+
else while (page != null) {
|
|
222
|
+
for await (const item of page.getItems(options)) yield item;
|
|
223
|
+
if (interval > 0) await delay(interval);
|
|
224
|
+
page = await page.getNext(options);
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
227
|
|
|
@@ -412,6 +411,9 @@ test("traverseCollection()", {
|
|
|
412
411
|
new Note({ content: "This is another simple note" }),
|
|
413
412
|
new Note({ content: "This is a third simple note" })
|
|
414
413
|
]);
|
|
414
|
+
const inlinePagedCollection = await lookupObject("https://example.com/inline-paged-collection", options);
|
|
415
|
+
assertInstanceOf(inlinePagedCollection, Collection);
|
|
416
|
+
deepStrictEqual(await Array.fromAsync(traverseCollection(inlinePagedCollection, options)), [new Note({ content: "Inline first note" }), new Note({ content: "Inline second note" })]);
|
|
415
417
|
});
|
|
416
418
|
test("FEP-fe34: lookupObject() cross-origin security", {
|
|
417
419
|
sanitizeResources: false,
|