@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab",
3
- "version": "2.0.0-dev.279+ce1bdc22",
3
+ "version": "2.0.0-dev.323+1d796545",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts"
@@ -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-fPKUeh35.js";
7
- import { deno_default, esm_default } from "./deno-y1THYur-.js";
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.279+ce1bdc22";
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";
@@ -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, getDocumentLoader, mockDocumentLoader, test } from "./vocab-fPKUeh35.js";
6
- import { deno_default, esm_default } from "./deno-y1THYur-.js";
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
- if (collection.firstId == null) for await (const item of collection.getItems(options)) yield item;
218
- else {
219
- const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
220
- let page = await collection.getFirst(options);
221
- 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);
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,