@fedify/vocab 2.0.17-dev.1080 → 2.0.17
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/mod.cjs +19 -18
- package/dist/mod.d.cts +1 -0
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +19 -18
- package/dist-tests/actor.test.mjs +2 -2
- package/dist-tests/{deno-BRyEZKAP.mjs → deno-DquIBXY4.mjs} +2 -2
- package/dist-tests/lookup.test.mjs +2 -2
- package/dist-tests/type.test.mjs +1 -1
- package/dist-tests/{vocab-CtC1HS1N.mjs → vocab-BFNiYemZ.mjs} +18 -17
- package/dist-tests/vocab.test.mjs +17 -1
- package/package.json +5 -5
- package/src/vocab.test.ts +37 -0
- package/tsdown.config.ts +8 -11
package/deno.json
CHANGED
package/dist/mod.cjs
CHANGED
|
@@ -29,10 +29,11 @@ let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
|
|
|
29
29
|
_fedify_vocab_runtime_jsonld = __toESM(_fedify_vocab_runtime_jsonld);
|
|
30
30
|
let _logtape_logtape = require("@logtape/logtape");
|
|
31
31
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
32
|
+
let _fedify_vocab_runtime_temporal = require("@fedify/vocab-runtime/temporal");
|
|
32
33
|
let es_toolkit = require("es-toolkit");
|
|
33
34
|
//#region deno.json
|
|
34
35
|
var name = "@fedify/vocab";
|
|
35
|
-
var version = "2.0.17
|
|
36
|
+
var version = "2.0.17";
|
|
36
37
|
//#endregion
|
|
37
38
|
//#region src/type.ts
|
|
38
39
|
function getTypeId(object) {
|
|
@@ -186,7 +187,7 @@ var Object$1 = class Object$1 {
|
|
|
186
187
|
if (Array.isArray(values.names) && values.names.every((v) => typeof v === "string" || v instanceof _fedify_vocab_runtime.LanguageString)) this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names;
|
|
187
188
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
188
189
|
}
|
|
189
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
190
|
+
if ("endTime" in values && values.endTime != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.endTime)) this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
190
191
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
191
192
|
if ("generators" in values && values.generators != null) if (Array.isArray(values.generators) && values.generators.every((v) => v instanceof Object$1 || v instanceof Link || v instanceof URL)) {
|
|
192
193
|
this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators;
|
|
@@ -247,7 +248,7 @@ var Object$1 = class Object$1 {
|
|
|
247
248
|
for (let i = 0; i < values.previews.length; i++) this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i);
|
|
248
249
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
249
250
|
}
|
|
250
|
-
if ("published" in values && values.published != null) if (values.published
|
|
251
|
+
if ("published" in values && values.published != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.published)) this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
251
252
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
252
253
|
if ("replies" in values && values.replies != null) if (values.replies instanceof Collection || values.replies instanceof URL) {
|
|
253
254
|
this.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies];
|
|
@@ -265,7 +266,7 @@ var Object$1 = class Object$1 {
|
|
|
265
266
|
this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions];
|
|
266
267
|
this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.add(0);
|
|
267
268
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
268
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
269
|
+
if ("startTime" in values && values.startTime != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.startTime)) this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
269
270
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
270
271
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof _fedify_vocab_runtime.LanguageString) this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
271
272
|
else throw new TypeError("The summary must be of type string | LanguageString.");
|
|
@@ -278,7 +279,7 @@ var Object$1 = class Object$1 {
|
|
|
278
279
|
this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags;
|
|
279
280
|
for (let i = 0; i < values.tags.length; i++) this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
280
281
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
281
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
282
|
+
if ("updated" in values && values.updated != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.updated)) this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
282
283
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
283
284
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
284
285
|
else throw new TypeError("The url must be of type URL | Link.");
|
|
@@ -333,7 +334,7 @@ var Object$1 = class Object$1 {
|
|
|
333
334
|
}
|
|
334
335
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
335
336
|
else throw new TypeError("The mediaType must be of type string.");
|
|
336
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
337
|
+
if ("duration" in values && values.duration != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalDuration)(values.duration)) this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
337
338
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
338
339
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
339
340
|
else throw new TypeError("The sensitive must be of type boolean.");
|
|
@@ -425,7 +426,7 @@ var Object$1 = class Object$1 {
|
|
|
425
426
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
426
427
|
}
|
|
427
428
|
clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime;
|
|
428
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
429
|
+
if ("endTime" in values && values.endTime != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.endTime)) clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
429
430
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
430
431
|
clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator;
|
|
431
432
|
clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator);
|
|
@@ -505,7 +506,7 @@ var Object$1 = class Object$1 {
|
|
|
505
506
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
506
507
|
}
|
|
507
508
|
clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published;
|
|
508
|
-
if ("published" in values && values.published != null) if (values.published
|
|
509
|
+
if ("published" in values && values.published != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.published)) clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
509
510
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
510
511
|
clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies;
|
|
511
512
|
clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies);
|
|
@@ -532,7 +533,7 @@ var Object$1 = class Object$1 {
|
|
|
532
533
|
clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]);
|
|
533
534
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
534
535
|
clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime;
|
|
535
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
536
|
+
if ("startTime" in values && values.startTime != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.startTime)) clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
536
537
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
537
538
|
clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary;
|
|
538
539
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof _fedify_vocab_runtime.LanguageString) clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
@@ -550,7 +551,7 @@ var Object$1 = class Object$1 {
|
|
|
550
551
|
for (let i = 0; i < values.tags.length; i++) clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
551
552
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
552
553
|
clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated;
|
|
553
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
554
|
+
if ("updated" in values && values.updated != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.updated)) clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
554
555
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
555
556
|
clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url;
|
|
556
557
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
@@ -620,7 +621,7 @@ var Object$1 = class Object$1 {
|
|
|
620
621
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
621
622
|
else throw new TypeError("The mediaType must be of type string.");
|
|
622
623
|
clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration;
|
|
623
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
624
|
+
if ("duration" in values && values.duration != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalDuration)(values.duration)) clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
624
625
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
625
626
|
clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive;
|
|
626
627
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
@@ -8467,7 +8468,7 @@ var DataIntegrityProof = class {
|
|
|
8467
8468
|
else throw new TypeError("The proofPurpose must be of type \"assertionMethod\" | \"authentication\" | \"capabilityInvocation\" | \"capabilityDelegation\" | \"keyAgreement\".");
|
|
8468
8469
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8469
8470
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8470
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8471
|
+
if ("created" in values && values.created != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.created)) this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8471
8472
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8472
8473
|
}
|
|
8473
8474
|
/**
|
|
@@ -8501,7 +8502,7 @@ var DataIntegrityProof = class {
|
|
|
8501
8502
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8502
8503
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8503
8504
|
clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac;
|
|
8504
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8505
|
+
if ("created" in values && values.created != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.created)) clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8505
8506
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8506
8507
|
return clone;
|
|
8507
8508
|
}
|
|
@@ -33333,7 +33334,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33333
33334
|
this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions;
|
|
33334
33335
|
for (let i = 0; i < values.inclusiveOptions.length; i++) this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33335
33336
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33336
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33337
|
+
if ("closed" in values && values.closed != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.closed) || typeof values.closed === "boolean") this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33337
33338
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33338
33339
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
33339
33340
|
else throw new TypeError("The voters must be of type number.");
|
|
@@ -33370,7 +33371,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33370
33371
|
for (let i = 0; i < values.inclusiveOptions.length; i++) clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33371
33372
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33372
33373
|
clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed;
|
|
33373
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33374
|
+
if ("closed" in values && values.closed != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.closed) || typeof values.closed === "boolean") clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33374
33375
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33375
33376
|
clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount;
|
|
33376
33377
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
@@ -33693,7 +33694,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33693
33694
|
if (array.length > 0) values["https://www.w3.org/ns/activitystreams#anyOf"] = array;
|
|
33694
33695
|
array = [];
|
|
33695
33696
|
for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) {
|
|
33696
|
-
const element =
|
|
33697
|
+
const element = (0, _fedify_vocab_runtime_temporal.isTemporalInstant)(v) ? {
|
|
33697
33698
|
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
|
|
33698
33699
|
"@value": v.toString()
|
|
33699
33700
|
} : { "@value": v };
|
|
@@ -38998,7 +38999,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
38998
38999
|
*/
|
|
38999
39000
|
constructor(values, options = {}) {
|
|
39000
39001
|
super(values, options);
|
|
39001
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
39002
|
+
if ("deleted" in values && values.deleted != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.deleted)) this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
39002
39003
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
39003
39004
|
}
|
|
39004
39005
|
/**
|
|
@@ -39017,7 +39018,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
39017
39018
|
}
|
|
39018
39019
|
const clone = super.clone(values, options);
|
|
39019
39020
|
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted;
|
|
39020
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
39021
|
+
if ("deleted" in values && values.deleted != null) if ((0, _fedify_vocab_runtime_temporal.isTemporalInstant)(values.deleted)) clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
39021
39022
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
39022
39023
|
return clone;
|
|
39023
39024
|
}
|
package/dist/mod.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
1
2
|
import { DocumentLoader, DocumentLoader as DocumentLoader$1, GetUserAgentOptions, GetUserAgentOptions as GetUserAgentOptions$1, LanguageString, LanguageString as LanguageString$1, RemoteDocument } from "@fedify/vocab-runtime";
|
|
2
3
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
3
4
|
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
3
3
|
import { DocumentLoader, DocumentLoader as DocumentLoader$1, GetUserAgentOptions, GetUserAgentOptions as GetUserAgentOptions$1, LanguageString, LanguageString as LanguageString$1, RemoteDocument } from "@fedify/vocab-runtime";
|
|
4
4
|
|
package/dist/mod.js
CHANGED
|
@@ -5,10 +5,11 @@ import { domainToASCII, domainToUnicode } from "node:url";
|
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { LanguageString, LanguageString as LanguageString$1, decodeMultibase, encodeMultibase, exportMultibaseKey, exportSpki, getDocumentLoader, importMultibaseKey, importPem } from "@fedify/vocab-runtime";
|
|
8
|
+
import { isTemporalDuration, isTemporalInstant } from "@fedify/vocab-runtime/temporal";
|
|
8
9
|
import { delay } from "es-toolkit";
|
|
9
10
|
//#region deno.json
|
|
10
11
|
var name = "@fedify/vocab";
|
|
11
|
-
var version = "2.0.17
|
|
12
|
+
var version = "2.0.17";
|
|
12
13
|
//#endregion
|
|
13
14
|
//#region src/type.ts
|
|
14
15
|
function getTypeId(object) {
|
|
@@ -162,7 +163,7 @@ var Object$1 = class Object$1 {
|
|
|
162
163
|
if (Array.isArray(values.names) && values.names.every((v) => typeof v === "string" || v instanceof LanguageString$1)) this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names;
|
|
163
164
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
164
165
|
}
|
|
165
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
166
|
+
if ("endTime" in values && values.endTime != null) if (isTemporalInstant(values.endTime)) this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
166
167
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
167
168
|
if ("generators" in values && values.generators != null) if (Array.isArray(values.generators) && values.generators.every((v) => v instanceof Object$1 || v instanceof Link || v instanceof URL)) {
|
|
168
169
|
this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators;
|
|
@@ -223,7 +224,7 @@ var Object$1 = class Object$1 {
|
|
|
223
224
|
for (let i = 0; i < values.previews.length; i++) this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i);
|
|
224
225
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
225
226
|
}
|
|
226
|
-
if ("published" in values && values.published != null) if (values.published
|
|
227
|
+
if ("published" in values && values.published != null) if (isTemporalInstant(values.published)) this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
227
228
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
228
229
|
if ("replies" in values && values.replies != null) if (values.replies instanceof Collection || values.replies instanceof URL) {
|
|
229
230
|
this.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies];
|
|
@@ -241,7 +242,7 @@ var Object$1 = class Object$1 {
|
|
|
241
242
|
this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions];
|
|
242
243
|
this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.add(0);
|
|
243
244
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
244
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
245
|
+
if ("startTime" in values && values.startTime != null) if (isTemporalInstant(values.startTime)) this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
245
246
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
246
247
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof LanguageString$1) this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
247
248
|
else throw new TypeError("The summary must be of type string | LanguageString.");
|
|
@@ -254,7 +255,7 @@ var Object$1 = class Object$1 {
|
|
|
254
255
|
this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags;
|
|
255
256
|
for (let i = 0; i < values.tags.length; i++) this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
256
257
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
257
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
258
|
+
if ("updated" in values && values.updated != null) if (isTemporalInstant(values.updated)) this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
258
259
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
259
260
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
260
261
|
else throw new TypeError("The url must be of type URL | Link.");
|
|
@@ -309,7 +310,7 @@ var Object$1 = class Object$1 {
|
|
|
309
310
|
}
|
|
310
311
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
311
312
|
else throw new TypeError("The mediaType must be of type string.");
|
|
312
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
313
|
+
if ("duration" in values && values.duration != null) if (isTemporalDuration(values.duration)) this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
313
314
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
314
315
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
315
316
|
else throw new TypeError("The sensitive must be of type boolean.");
|
|
@@ -401,7 +402,7 @@ var Object$1 = class Object$1 {
|
|
|
401
402
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
402
403
|
}
|
|
403
404
|
clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime;
|
|
404
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
405
|
+
if ("endTime" in values && values.endTime != null) if (isTemporalInstant(values.endTime)) clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
405
406
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
406
407
|
clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator;
|
|
407
408
|
clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator);
|
|
@@ -481,7 +482,7 @@ var Object$1 = class Object$1 {
|
|
|
481
482
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
482
483
|
}
|
|
483
484
|
clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published;
|
|
484
|
-
if ("published" in values && values.published != null) if (values.published
|
|
485
|
+
if ("published" in values && values.published != null) if (isTemporalInstant(values.published)) clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
485
486
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
486
487
|
clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies;
|
|
487
488
|
clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies);
|
|
@@ -508,7 +509,7 @@ var Object$1 = class Object$1 {
|
|
|
508
509
|
clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]);
|
|
509
510
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
510
511
|
clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime;
|
|
511
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
512
|
+
if ("startTime" in values && values.startTime != null) if (isTemporalInstant(values.startTime)) clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
512
513
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
513
514
|
clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary;
|
|
514
515
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof LanguageString$1) clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
@@ -526,7 +527,7 @@ var Object$1 = class Object$1 {
|
|
|
526
527
|
for (let i = 0; i < values.tags.length; i++) clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
527
528
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
528
529
|
clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated;
|
|
529
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
530
|
+
if ("updated" in values && values.updated != null) if (isTemporalInstant(values.updated)) clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
530
531
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
531
532
|
clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url;
|
|
532
533
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
@@ -596,7 +597,7 @@ var Object$1 = class Object$1 {
|
|
|
596
597
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
597
598
|
else throw new TypeError("The mediaType must be of type string.");
|
|
598
599
|
clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration;
|
|
599
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
600
|
+
if ("duration" in values && values.duration != null) if (isTemporalDuration(values.duration)) clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
600
601
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
601
602
|
clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive;
|
|
602
603
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
@@ -8443,7 +8444,7 @@ var DataIntegrityProof = class {
|
|
|
8443
8444
|
else throw new TypeError("The proofPurpose must be of type \"assertionMethod\" | \"authentication\" | \"capabilityInvocation\" | \"capabilityDelegation\" | \"keyAgreement\".");
|
|
8444
8445
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8445
8446
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8446
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8447
|
+
if ("created" in values && values.created != null) if (isTemporalInstant(values.created)) this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8447
8448
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8448
8449
|
}
|
|
8449
8450
|
/**
|
|
@@ -8477,7 +8478,7 @@ var DataIntegrityProof = class {
|
|
|
8477
8478
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8478
8479
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8479
8480
|
clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac;
|
|
8480
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8481
|
+
if ("created" in values && values.created != null) if (isTemporalInstant(values.created)) clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8481
8482
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8482
8483
|
return clone;
|
|
8483
8484
|
}
|
|
@@ -33309,7 +33310,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33309
33310
|
this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions;
|
|
33310
33311
|
for (let i = 0; i < values.inclusiveOptions.length; i++) this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33311
33312
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33312
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33313
|
+
if ("closed" in values && values.closed != null) if (isTemporalInstant(values.closed) || typeof values.closed === "boolean") this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33313
33314
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33314
33315
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
33315
33316
|
else throw new TypeError("The voters must be of type number.");
|
|
@@ -33346,7 +33347,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33346
33347
|
for (let i = 0; i < values.inclusiveOptions.length; i++) clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33347
33348
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33348
33349
|
clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed;
|
|
33349
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33350
|
+
if ("closed" in values && values.closed != null) if (isTemporalInstant(values.closed) || typeof values.closed === "boolean") clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33350
33351
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33351
33352
|
clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount;
|
|
33352
33353
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
@@ -33669,7 +33670,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33669
33670
|
if (array.length > 0) values["https://www.w3.org/ns/activitystreams#anyOf"] = array;
|
|
33670
33671
|
array = [];
|
|
33671
33672
|
for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) {
|
|
33672
|
-
const element = v
|
|
33673
|
+
const element = isTemporalInstant(v) ? {
|
|
33673
33674
|
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
|
|
33674
33675
|
"@value": v.toString()
|
|
33675
33676
|
} : { "@value": v };
|
|
@@ -38974,7 +38975,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
38974
38975
|
*/
|
|
38975
38976
|
constructor(values, options = {}) {
|
|
38976
38977
|
super(values, options);
|
|
38977
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
38978
|
+
if ("deleted" in values && values.deleted != null) if (isTemporalInstant(values.deleted)) this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
38978
38979
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
38979
38980
|
}
|
|
38980
38981
|
/**
|
|
@@ -38993,7 +38994,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
38993
38994
|
}
|
|
38994
38995
|
const clone = super.clone(values, options);
|
|
38995
38996
|
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted;
|
|
38996
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
38997
|
+
if ("deleted" in values && values.deleted != null) if (isTemporalInstant(values.deleted)) clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
38997
38998
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
38998
38999
|
return clone;
|
|
38999
39000
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { S as __exportAll, c as Group, h as Person, m as Organization, r as Application, v as Service } from "./vocab-
|
|
4
|
-
import { n as version, r as esm_default, t as name } from "./deno-
|
|
3
|
+
import { S as __exportAll, c as Group, h as Person, m as Organization, r as Application, v as Service } from "./vocab-BFNiYemZ.mjs";
|
|
4
|
+
import { n as version, r as esm_default, t as name } from "./deno-DquIBXY4.mjs";
|
|
5
5
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
6
6
|
import { test } from "@fedify/fixture";
|
|
7
7
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { C as __toESM, x as __commonJSMin } from "./vocab-
|
|
3
|
+
import { C as __toESM, x as __commonJSMin } from "./vocab-BFNiYemZ.mjs";
|
|
4
4
|
//#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
|
|
5
5
|
var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
6
|
module.exports = function(glob, opts) {
|
|
@@ -1204,6 +1204,6 @@ var esm_default = new class FetchMock {
|
|
|
1204
1204
|
//#endregion
|
|
1205
1205
|
//#region deno.json
|
|
1206
1206
|
var name = "@fedify/vocab";
|
|
1207
|
-
var version = "2.0.17
|
|
1207
|
+
var version = "2.0.17";
|
|
1208
1208
|
//#endregion
|
|
1209
1209
|
export { version as n, esm_default as r, name as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { d as Note, f as Object$1, h as Person, i as Collection } from "./vocab-
|
|
4
|
-
import { n as version, r as esm_default, t as name } from "./deno-
|
|
3
|
+
import { d as Note, f as Object$1, h as Person, i as Collection } from "./vocab-BFNiYemZ.mjs";
|
|
4
|
+
import { n as version, r as esm_default, t as name } from "./deno-DquIBXY4.mjs";
|
|
5
5
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "./utils-CE8Dk5hm.mjs";
|
|
7
7
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
package/dist-tests/type.test.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { h as Person } from "./vocab-
|
|
3
|
+
import { h as Person } from "./vocab-BFNiYemZ.mjs";
|
|
4
4
|
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
5
5
|
import { test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual } from "node:assert/strict";
|
|
@@ -4,6 +4,7 @@ import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
|
4
4
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { LanguageString, decodeMultibase, encodeMultibase, exportMultibaseKey, exportSpki, getDocumentLoader, importMultibaseKey, importPem } from "@fedify/vocab-runtime";
|
|
7
|
+
import { isTemporalDuration, isTemporalInstant } from "@fedify/vocab-runtime/temporal";
|
|
7
8
|
//#region \0rolldown/runtime.js
|
|
8
9
|
var __create = Object.create;
|
|
9
10
|
var __defProp = Object.defineProperty;
|
|
@@ -250,7 +251,7 @@ var Object$1 = class Object$1 {
|
|
|
250
251
|
if (Array.isArray(values.names) && values.names.every((v) => typeof v === "string" || v instanceof LanguageString)) this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names;
|
|
251
252
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
252
253
|
}
|
|
253
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
254
|
+
if ("endTime" in values && values.endTime != null) if (isTemporalInstant(values.endTime)) this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
254
255
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
255
256
|
if ("generators" in values && values.generators != null) if (Array.isArray(values.generators) && values.generators.every((v) => v instanceof Object$1 || v instanceof Link || v instanceof URL)) {
|
|
256
257
|
this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators;
|
|
@@ -311,7 +312,7 @@ var Object$1 = class Object$1 {
|
|
|
311
312
|
for (let i = 0; i < values.previews.length; i++) this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i);
|
|
312
313
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
313
314
|
}
|
|
314
|
-
if ("published" in values && values.published != null) if (values.published
|
|
315
|
+
if ("published" in values && values.published != null) if (isTemporalInstant(values.published)) this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
315
316
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
316
317
|
if ("replies" in values && values.replies != null) if (values.replies instanceof Collection || values.replies instanceof URL) {
|
|
317
318
|
this.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies];
|
|
@@ -329,7 +330,7 @@ var Object$1 = class Object$1 {
|
|
|
329
330
|
this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions];
|
|
330
331
|
this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.add(0);
|
|
331
332
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
332
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
333
|
+
if ("startTime" in values && values.startTime != null) if (isTemporalInstant(values.startTime)) this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
333
334
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
334
335
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof LanguageString) this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
335
336
|
else throw new TypeError("The summary must be of type string | LanguageString.");
|
|
@@ -342,7 +343,7 @@ var Object$1 = class Object$1 {
|
|
|
342
343
|
this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags;
|
|
343
344
|
for (let i = 0; i < values.tags.length; i++) this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
344
345
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
345
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
346
|
+
if ("updated" in values && values.updated != null) if (isTemporalInstant(values.updated)) this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
346
347
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
347
348
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
348
349
|
else throw new TypeError("The url must be of type URL | Link.");
|
|
@@ -397,7 +398,7 @@ var Object$1 = class Object$1 {
|
|
|
397
398
|
}
|
|
398
399
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
399
400
|
else throw new TypeError("The mediaType must be of type string.");
|
|
400
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
401
|
+
if ("duration" in values && values.duration != null) if (isTemporalDuration(values.duration)) this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
401
402
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
402
403
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
403
404
|
else throw new TypeError("The sensitive must be of type boolean.");
|
|
@@ -489,7 +490,7 @@ var Object$1 = class Object$1 {
|
|
|
489
490
|
else throw new TypeError("The names must be an array of type string | LanguageString.");
|
|
490
491
|
}
|
|
491
492
|
clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime;
|
|
492
|
-
if ("endTime" in values && values.endTime != null) if (values.endTime
|
|
493
|
+
if ("endTime" in values && values.endTime != null) if (isTemporalInstant(values.endTime)) clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = [values.endTime];
|
|
493
494
|
else throw new TypeError("The endTime must be of type Temporal.Instant.");
|
|
494
495
|
clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator;
|
|
495
496
|
clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator);
|
|
@@ -569,7 +570,7 @@ var Object$1 = class Object$1 {
|
|
|
569
570
|
} else throw new TypeError("The previews must be an array of type Link | Object | URL.");
|
|
570
571
|
}
|
|
571
572
|
clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published;
|
|
572
|
-
if ("published" in values && values.published != null) if (values.published
|
|
573
|
+
if ("published" in values && values.published != null) if (isTemporalInstant(values.published)) clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = [values.published];
|
|
573
574
|
else throw new TypeError("The published must be of type Temporal.Instant.");
|
|
574
575
|
clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies;
|
|
575
576
|
clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies);
|
|
@@ -596,7 +597,7 @@ var Object$1 = class Object$1 {
|
|
|
596
597
|
clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]);
|
|
597
598
|
} else throw new TypeError("The emojiReactions must be of type Collection | URL.");
|
|
598
599
|
clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime;
|
|
599
|
-
if ("startTime" in values && values.startTime != null) if (values.startTime
|
|
600
|
+
if ("startTime" in values && values.startTime != null) if (isTemporalInstant(values.startTime)) clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = [values.startTime];
|
|
600
601
|
else throw new TypeError("The startTime must be of type Temporal.Instant.");
|
|
601
602
|
clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary;
|
|
602
603
|
if ("summary" in values && values.summary != null) if (typeof values.summary === "string" || values.summary instanceof LanguageString) clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = [values.summary];
|
|
@@ -614,7 +615,7 @@ var Object$1 = class Object$1 {
|
|
|
614
615
|
for (let i = 0; i < values.tags.length; i++) clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i);
|
|
615
616
|
} else throw new TypeError("The tags must be an array of type Object | Link | URL.");
|
|
616
617
|
clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated;
|
|
617
|
-
if ("updated" in values && values.updated != null) if (values.updated
|
|
618
|
+
if ("updated" in values && values.updated != null) if (isTemporalInstant(values.updated)) clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = [values.updated];
|
|
618
619
|
else throw new TypeError("The updated must be of type Temporal.Instant.");
|
|
619
620
|
clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url;
|
|
620
621
|
if ("url" in values && values.url != null) if (values.url instanceof URL || values.url instanceof Link) clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = [values.url];
|
|
@@ -684,7 +685,7 @@ var Object$1 = class Object$1 {
|
|
|
684
685
|
if ("mediaType" in values && values.mediaType != null) if (typeof values.mediaType === "string") clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = [values.mediaType];
|
|
685
686
|
else throw new TypeError("The mediaType must be of type string.");
|
|
686
687
|
clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration;
|
|
687
|
-
if ("duration" in values && values.duration != null) if (values.duration
|
|
688
|
+
if ("duration" in values && values.duration != null) if (isTemporalDuration(values.duration)) clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = [values.duration];
|
|
688
689
|
else throw new TypeError("The duration must be of type Temporal.Duration.");
|
|
689
690
|
clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive;
|
|
690
691
|
if ("sensitive" in values && values.sensitive != null) if (typeof values.sensitive === "boolean") clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = [values.sensitive];
|
|
@@ -8531,7 +8532,7 @@ var DataIntegrityProof = class {
|
|
|
8531
8532
|
else throw new TypeError("The proofPurpose must be of type \"assertionMethod\" | \"authentication\" | \"capabilityInvocation\" | \"capabilityDelegation\" | \"keyAgreement\".");
|
|
8532
8533
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8533
8534
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8534
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8535
|
+
if ("created" in values && values.created != null) if (isTemporalInstant(values.created)) this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8535
8536
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8536
8537
|
}
|
|
8537
8538
|
/**
|
|
@@ -8565,7 +8566,7 @@ var DataIntegrityProof = class {
|
|
|
8565
8566
|
if ("proofValue" in values && values.proofValue != null) if (values.proofValue instanceof Uint8Array) clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = [values.proofValue];
|
|
8566
8567
|
else throw new TypeError("The proofValue must be of type Uint8Array.");
|
|
8567
8568
|
clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac;
|
|
8568
|
-
if ("created" in values && values.created != null) if (values.created
|
|
8569
|
+
if ("created" in values && values.created != null) if (isTemporalInstant(values.created)) clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = [values.created];
|
|
8569
8570
|
else throw new TypeError("The created must be of type Temporal.Instant.");
|
|
8570
8571
|
return clone;
|
|
8571
8572
|
}
|
|
@@ -33397,7 +33398,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33397
33398
|
this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions;
|
|
33398
33399
|
for (let i = 0; i < values.inclusiveOptions.length; i++) this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33399
33400
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33400
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33401
|
+
if ("closed" in values && values.closed != null) if (isTemporalInstant(values.closed) || typeof values.closed === "boolean") this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33401
33402
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33402
33403
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
33403
33404
|
else throw new TypeError("The voters must be of type number.");
|
|
@@ -33434,7 +33435,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33434
33435
|
for (let i = 0; i < values.inclusiveOptions.length; i++) clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i);
|
|
33435
33436
|
} else throw new TypeError("The inclusiveOptions must be an array of type Object | URL.");
|
|
33436
33437
|
clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed;
|
|
33437
|
-
if ("closed" in values && values.closed != null) if (values.closed
|
|
33438
|
+
if ("closed" in values && values.closed != null) if (isTemporalInstant(values.closed) || typeof values.closed === "boolean") clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = [values.closed];
|
|
33438
33439
|
else throw new TypeError("The closed must be of type Temporal.Instant | boolean.");
|
|
33439
33440
|
clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount;
|
|
33440
33441
|
if ("voters" in values && values.voters != null) if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = [values.voters];
|
|
@@ -33757,7 +33758,7 @@ var Question = class Question extends IntransitiveActivity {
|
|
|
33757
33758
|
if (array.length > 0) values["https://www.w3.org/ns/activitystreams#anyOf"] = array;
|
|
33758
33759
|
array = [];
|
|
33759
33760
|
for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed) {
|
|
33760
|
-
const element = v
|
|
33761
|
+
const element = isTemporalInstant(v) ? {
|
|
33761
33762
|
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
|
|
33762
33763
|
"@value": v.toString()
|
|
33763
33764
|
} : { "@value": v };
|
|
@@ -39062,7 +39063,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
39062
39063
|
*/
|
|
39063
39064
|
constructor(values, options = {}) {
|
|
39064
39065
|
super(values, options);
|
|
39065
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
39066
|
+
if ("deleted" in values && values.deleted != null) if (isTemporalInstant(values.deleted)) this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
39066
39067
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
39067
39068
|
}
|
|
39068
39069
|
/**
|
|
@@ -39081,7 +39082,7 @@ var Tombstone = class Tombstone extends Object$1 {
|
|
|
39081
39082
|
}
|
|
39082
39083
|
const clone = super.clone(values, options);
|
|
39083
39084
|
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted;
|
|
39084
|
-
if ("deleted" in values && values.deleted != null) if (values.deleted
|
|
39085
|
+
if ("deleted" in values && values.deleted != null) if (isTemporalInstant(values.deleted)) clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = [values.deleted];
|
|
39085
39086
|
else throw new TypeError("The deleted must be of type Temporal.Instant.");
|
|
39086
39087
|
return clone;
|
|
39087
39088
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { _ as Question, a as Create, b as vocab_exports, d as Note, f as Object$1, g as Place, h as Person, i as Collection, l as Hashtag, n as Announce, o as CryptographicKey, p as OrderedCollectionPage, s as Follow, t as Activity, u as Link, y as Source } from "./vocab-
|
|
3
|
+
import { _ as Question, a as Create, b as vocab_exports, d as Note, f as Object$1, g as Place, h as Person, i as Collection, l as Hashtag, n as Announce, o as CryptographicKey, p as OrderedCollectionPage, s as Follow, t as Activity, u as Link, y as Source } from "./vocab-BFNiYemZ.mjs";
|
|
4
4
|
import { t as assertInstanceOf } from "./utils-CE8Dk5hm.mjs";
|
|
5
5
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual, notDeepStrictEqual, ok, rejects, throws } from "node:assert/strict";
|
|
@@ -25,6 +25,22 @@ test("new Object()", () => {
|
|
|
25
25
|
throws(() => new Object$1({ names: "foo" }), TypeError);
|
|
26
26
|
throws(() => new Object$1({ names: ["foo", 123] }), TypeError);
|
|
27
27
|
});
|
|
28
|
+
test("new Object() accepts foreign Temporal.Instant (issue #767)", () => {
|
|
29
|
+
const foreignInstant = globalThis.Object.create(globalThis.Object.prototype, {
|
|
30
|
+
[Symbol.toStringTag]: { value: "Temporal.Instant" },
|
|
31
|
+
epochNanoseconds: { value: 0n },
|
|
32
|
+
toString: { value: () => "1970-01-01T00:00:00Z" }
|
|
33
|
+
});
|
|
34
|
+
ok(new Object$1({ published: foreignInstant }).published === foreignInstant);
|
|
35
|
+
});
|
|
36
|
+
test("Object.clone() accepts foreign Temporal.Instant (issue #767)", () => {
|
|
37
|
+
const foreignInstant = globalThis.Object.create(globalThis.Object.prototype, {
|
|
38
|
+
[Symbol.toStringTag]: { value: "Temporal.Instant" },
|
|
39
|
+
epochNanoseconds: { value: 0n },
|
|
40
|
+
toString: { value: () => "1970-01-01T00:00:00Z" }
|
|
41
|
+
});
|
|
42
|
+
ok(new Object$1({}).clone({ published: foreignInstant }).published === foreignInstant);
|
|
43
|
+
});
|
|
28
44
|
test("Object.clone()", () => {
|
|
29
45
|
const obj = new Object$1({
|
|
30
46
|
id: new URL("https://example.com/"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/vocab",
|
|
3
|
-
"version": "2.0.17
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"homepage": "https://fedify.dev/",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"es-toolkit": "1.43.0",
|
|
47
47
|
"jsonld": "^9.0.0",
|
|
48
48
|
"pkijs": "^3.3.3",
|
|
49
|
-
"@fedify/vocab-tools": "2.0.17
|
|
50
|
-
"@fedify/webfinger": "2.0.17
|
|
51
|
-
"@fedify/vocab-runtime": "2.0.17
|
|
49
|
+
"@fedify/vocab-tools": "2.0.17",
|
|
50
|
+
"@fedify/webfinger": "2.0.17",
|
|
51
|
+
"@fedify/vocab-runtime": "2.0.17"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^22.17.0",
|
|
55
55
|
"fast-check": "^3.22.0",
|
|
56
56
|
"fetch-mock": "^12.5.4",
|
|
57
57
|
"tsdown": "^0.21.6",
|
|
58
|
-
"typescript": "^
|
|
58
|
+
"typescript": "^6.0.0",
|
|
59
59
|
"@fedify/fixture": "2.0.0"
|
|
60
60
|
},
|
|
61
61
|
"keywords": [
|
package/src/vocab.test.ts
CHANGED
|
@@ -69,6 +69,43 @@ test("new Object()", () => {
|
|
|
69
69
|
);
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
test(
|
|
73
|
+
// Regression test for
|
|
74
|
+
// https://github.com/fedify-dev/fedify/issues/767:
|
|
75
|
+
// values produced by a `Temporal` implementation other than the one bundled
|
|
76
|
+
// with Fedify (e.g. Node.js 26+ native `Temporal`) must be accepted as
|
|
77
|
+
// long as they conform to the spec-mandated `Symbol.toStringTag`.
|
|
78
|
+
"new Object() accepts foreign Temporal.Instant (issue #767)",
|
|
79
|
+
() => {
|
|
80
|
+
const foreignInstant = globalThis.Object.create(
|
|
81
|
+
globalThis.Object.prototype,
|
|
82
|
+
{
|
|
83
|
+
[Symbol.toStringTag]: { value: "Temporal.Instant" },
|
|
84
|
+
epochNanoseconds: { value: 0n },
|
|
85
|
+
toString: { value: () => "1970-01-01T00:00:00Z" },
|
|
86
|
+
},
|
|
87
|
+
) as Temporal.Instant;
|
|
88
|
+
const obj = new Object({ published: foreignInstant });
|
|
89
|
+
ok(obj.published === foreignInstant);
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
test(
|
|
94
|
+
"Object.clone() accepts foreign Temporal.Instant (issue #767)",
|
|
95
|
+
() => {
|
|
96
|
+
const foreignInstant = globalThis.Object.create(
|
|
97
|
+
globalThis.Object.prototype,
|
|
98
|
+
{
|
|
99
|
+
[Symbol.toStringTag]: { value: "Temporal.Instant" },
|
|
100
|
+
epochNanoseconds: { value: 0n },
|
|
101
|
+
toString: { value: () => "1970-01-01T00:00:00Z" },
|
|
102
|
+
},
|
|
103
|
+
) as Temporal.Instant;
|
|
104
|
+
const obj = new Object({}).clone({ published: foreignInstant });
|
|
105
|
+
ok(obj.published === foreignInstant);
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
|
|
72
109
|
test("Object.clone()", () => {
|
|
73
110
|
const obj = new Object({
|
|
74
111
|
id: new URL("https://example.com/"),
|
package/tsdown.config.ts
CHANGED
|
@@ -19,17 +19,14 @@ export default [
|
|
|
19
19
|
format: ["esm", "cjs"],
|
|
20
20
|
platform: "neutral",
|
|
21
21
|
external: [/^node:/],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
return outputOptions;
|
|
22
|
+
banner({ format }) {
|
|
23
|
+
const js = format === "cjs"
|
|
24
|
+
? `const { Temporal } = require("@js-temporal/polyfill");`
|
|
25
|
+
: `import { Temporal } from "@js-temporal/polyfill";`;
|
|
26
|
+
return {
|
|
27
|
+
js,
|
|
28
|
+
dts: `/// <reference lib="esnext.temporal" />`,
|
|
29
|
+
};
|
|
33
30
|
},
|
|
34
31
|
}),
|
|
35
32
|
defineConfig({
|