@fedify/vocab 2.0.0-dev.279 → 2.0.0-pr.559.4

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-pr.559.4+6357309b",
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-DBPY77CM.js";
7
+ import { deno_default, esm_default } from "./deno-WgPwii8-.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-pr.559.4+6357309b";
1244
1244
  var license = "MIT";
1245
1245
  var exports = { ".": "./src/mod.ts" };
1246
1246
  var description = "Vocabularies library for @fedify/fedify";
@@ -2,8 +2,8 @@
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, getDocumentLoader, mockDocumentLoader, test } from "./vocab-DBPY77CM.js";
6
+ import { deno_default, esm_default } from "./deno-WgPwii8-.js";
7
7
  import { getTypeId } from "./type-Dnf0m2yO.js";
8
8
  import { assertInstanceOf } from "./utils-Dm0Onkcz.js";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -214,15 +214,13 @@ async function lookupObjectInternal(identifier, options = {}) {
214
214
  * @since 1.1.0
215
215
  */
216
216
  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
- }
217
+ const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
218
+ let page = await collection.getFirst(options);
219
+ if (page == null) for await (const item of collection.getItems(options)) yield item;
220
+ else while (page != null) {
221
+ for await (const item of page.getItems(options)) yield item;
222
+ if (interval > 0) await delay(interval);
223
+ page = await page.getNext(options);
226
224
  }
227
225
  }
228
226
 
@@ -412,6 +410,9 @@ test("traverseCollection()", {
412
410
  new Note({ content: "This is another simple note" }),
413
411
  new Note({ content: "This is a third simple note" })
414
412
  ]);
413
+ const inlinePagedCollection = await lookupObject("https://example.com/inline-paged-collection", options);
414
+ assertInstanceOf(inlinePagedCollection, Collection);
415
+ deepStrictEqual(await Array.fromAsync(traverseCollection(inlinePagedCollection, options)), [new Note({ content: "Inline first note" }), new Note({ content: "Inline second note" })]);
415
416
  });
416
417
  test("FEP-fe34: lookupObject() cross-origin security", {
417
418
  sanitizeResources: false,