@unhead/schema-org 0.6.0 → 1.3.9

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/dist/index.cjs CHANGED
@@ -1,1943 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const ufo = require('ufo');
3
+ const SchemaOrgUnheadPlugin = require('./shared/schema-org.96234618.cjs');
4
4
  const unhead = require('unhead');
5
-
6
- function defineSchemaOrgResolver(schema) {
7
- return schema;
8
- }
9
-
10
- function idReference(node) {
11
- return {
12
- "@id": typeof node !== "string" ? node["@id"] : node
13
- };
14
- }
15
- function resolvableDateToDate(val) {
16
- try {
17
- const date = val instanceof Date ? val : new Date(Date.parse(val));
18
- return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
19
- } catch (e) {
20
- }
21
- return typeof val === "string" ? val : val.toString();
22
- }
23
- function resolvableDateToIso(val) {
24
- if (!val)
25
- return val;
26
- try {
27
- if (val instanceof Date)
28
- return val.toISOString();
29
- else
30
- return new Date(Date.parse(val)).toISOString();
31
- } catch (e) {
32
- }
33
- return typeof val === "string" ? val : val.toString();
34
- }
35
- const IdentityId = "#identity";
36
- function setIfEmpty(node, field, value) {
37
- if (!node?.[field] && value)
38
- node[field] = value;
39
- }
40
- function asArray(input) {
41
- return Array.isArray(input) ? input : [input];
42
- }
43
- function dedupeMerge(node, field, value) {
44
- const dedupeMerge2 = [];
45
- const input = asArray(node[field]);
46
- dedupeMerge2.push(...input);
47
- const data = new Set(dedupeMerge2);
48
- data.add(value);
49
- node[field] = [...data.values()].filter(Boolean);
50
- }
51
- function prefixId(url, id) {
52
- if (ufo.hasProtocol(id))
53
- return url;
54
- if (!id.startsWith("#"))
55
- id = `#${id}`;
56
- return ufo.joinURL(url, id);
57
- }
58
- function trimLength(val, length) {
59
- if (!val)
60
- return val;
61
- if (val.length > length) {
62
- const trimmedString = val.substring(0, length);
63
- return trimmedString.substring(0, Math.min(trimmedString.length, trimmedString.lastIndexOf(" ")));
64
- }
65
- return val;
66
- }
67
- function resolveDefaultType(node, defaultType) {
68
- const val = node["@type"];
69
- if (val === defaultType)
70
- return;
71
- const types = /* @__PURE__ */ new Set([
72
- ...asArray(defaultType),
73
- ...asArray(val)
74
- ]);
75
- node["@type"] = types.size === 1 ? val : [...types.values()];
76
- }
77
- function resolveWithBase(base, urlOrPath) {
78
- if (!urlOrPath || ufo.hasProtocol(urlOrPath) || !urlOrPath.startsWith("/") && !urlOrPath.startsWith("#"))
79
- return urlOrPath;
80
- return ufo.withBase(urlOrPath, base);
81
- }
82
- function resolveAsGraphKey(key) {
83
- if (!key)
84
- return key;
85
- return key.substring(key.lastIndexOf("#"));
86
- }
87
- function stripEmptyProperties(obj) {
88
- Object.keys(obj).forEach((k) => {
89
- if (obj[k] && typeof obj[k] === "object") {
90
- if (obj[k].__v_isReadonly || obj[k].__v_isRef)
91
- return;
92
- stripEmptyProperties(obj[k]);
93
- return;
94
- }
95
- if (obj[k] === "" || obj[k] === null || typeof obj[k] === "undefined")
96
- delete obj[k];
97
- });
98
- return obj;
99
- }
100
- function hashCode(s) {
101
- let h = 9;
102
- for (let i = 0; i < s.length; )
103
- h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);
104
- return ((h ^ h >>> 9) + 65536).toString(16).substring(1, 8).toLowerCase();
105
- }
106
-
107
- const offerResolver = defineSchemaOrgResolver({
108
- cast(node) {
109
- if (typeof node === "number" || typeof node === "string") {
110
- return {
111
- price: node
112
- };
113
- }
114
- return node;
115
- },
116
- defaults: {
117
- "@type": "Offer",
118
- "availability": "InStock"
119
- },
120
- resolve(node, ctx) {
121
- setIfEmpty(node, "priceCurrency", ctx.meta.currency);
122
- setIfEmpty(node, "priceValidUntil", new Date(Date.UTC((/* @__PURE__ */ new Date()).getFullYear() + 1, 12, -1, 0, 0, 0)));
123
- if (node.url)
124
- resolveWithBase(ctx.meta.host, node.url);
125
- if (node.availability)
126
- node.availability = ufo.withBase(node.availability, "https://schema.org/");
127
- if (node.priceValidUntil)
128
- node.priceValidUntil = resolvableDateToIso(node.priceValidUntil);
129
- return node;
130
- }
131
- });
132
-
133
- const aggregateOfferResolver = defineSchemaOrgResolver({
134
- defaults: {
135
- "@type": "AggregateOffer"
136
- },
137
- inheritMeta: [
138
- { meta: "currency", key: "priceCurrency" }
139
- ],
140
- resolve(node, ctx) {
141
- node.offers = resolveRelation(node.offers, ctx, offerResolver);
142
- if (node.offers)
143
- setIfEmpty(node, "offerCount", asArray(node.offers).length);
144
- return node;
145
- }
146
- });
147
-
148
- const aggregateRatingResolver = defineSchemaOrgResolver({
149
- defaults: {
150
- "@type": "AggregateRating"
151
- }
152
- });
153
-
154
- const searchActionResolver = defineSchemaOrgResolver({
155
- defaults: {
156
- "@type": "SearchAction",
157
- "target": {
158
- "@type": "EntryPoint"
159
- },
160
- "query-input": {
161
- "@type": "PropertyValueSpecification",
162
- "valueRequired": true,
163
- "valueName": "search_term_string"
164
- }
165
- },
166
- resolve(node, ctx) {
167
- if (typeof node.target === "string") {
168
- node.target = {
169
- "@type": "EntryPoint",
170
- "urlTemplate": resolveWithBase(ctx.meta.host, node.target)
171
- };
172
- }
173
- return node;
174
- }
175
- });
176
-
177
- const PrimaryWebSiteId = "#website";
178
- const webSiteResolver = defineSchemaOrgResolver({
179
- defaults: {
180
- "@type": "WebSite"
181
- },
182
- inheritMeta: [
183
- "inLanguage",
184
- { meta: "host", key: "url" }
185
- ],
186
- idPrefix: ["host", PrimaryWebSiteId],
187
- resolve(node, ctx) {
188
- node.potentialAction = resolveRelation(node.potentialAction, ctx, searchActionResolver, {
189
- array: true
190
- });
191
- node.publisher = resolveRelation(node.publisher, ctx);
192
- return node;
193
- },
194
- resolveRootNode(node, { find }) {
195
- if (resolveAsGraphKey(node["@id"]) === PrimaryWebSiteId) {
196
- const identity = find(IdentityId);
197
- if (identity)
198
- setIfEmpty(node, "publisher", idReference(identity));
199
- const webPage = find(PrimaryWebPageId);
200
- if (webPage)
201
- setIfEmpty(webPage, "isPartOf", idReference(node));
202
- }
203
- return node;
204
- }
205
- });
206
-
207
- const listItemResolver = defineSchemaOrgResolver({
208
- cast(node) {
209
- if (typeof node === "string") {
210
- node = {
211
- name: node
212
- };
213
- }
214
- return node;
215
- },
216
- defaults: {
217
- "@type": "ListItem"
218
- },
219
- resolve(node, ctx) {
220
- if (typeof node.item === "string")
221
- node.item = resolveWithBase(ctx.meta.host, node.item);
222
- else if (typeof node.item === "object")
223
- node.item = resolveRelation(node.item, ctx);
224
- return node;
225
- }
226
- });
227
-
228
- const PrimaryBreadcrumbId = "#breadcrumb";
229
- const breadcrumbResolver = defineSchemaOrgResolver({
230
- defaults: {
231
- "@type": "BreadcrumbList"
232
- },
233
- idPrefix: ["url", PrimaryBreadcrumbId],
234
- resolve(breadcrumb, ctx) {
235
- if (breadcrumb.itemListElement) {
236
- let index = 1;
237
- breadcrumb.itemListElement = resolveRelation(breadcrumb.itemListElement, ctx, listItemResolver, {
238
- array: true,
239
- afterResolve(node) {
240
- setIfEmpty(node, "position", index++);
241
- }
242
- });
243
- }
244
- return breadcrumb;
245
- },
246
- resolveRootNode(node, { find }) {
247
- const webPage = find(PrimaryWebPageId);
248
- if (webPage)
249
- setIfEmpty(webPage, "breadcrumb", idReference(node));
250
- }
251
- });
252
-
253
- const imageResolver = defineSchemaOrgResolver({
254
- alias: "image",
255
- cast(input) {
256
- if (typeof input === "string") {
257
- input = {
258
- url: input
259
- };
260
- }
261
- return input;
262
- },
263
- defaults: {
264
- "@type": "ImageObject"
265
- },
266
- inheritMeta: [
267
- // @todo possibly only do if there's a caption
268
- "inLanguage"
269
- ],
270
- idPrefix: "host",
271
- resolve(image, { meta }) {
272
- image.url = resolveWithBase(meta.host, image.url);
273
- setIfEmpty(image, "contentUrl", image.url);
274
- if (image.height && !image.width)
275
- delete image.height;
276
- if (image.width && !image.height)
277
- delete image.width;
278
- return image;
279
- }
280
- });
281
-
282
- const addressResolver = defineSchemaOrgResolver({
283
- defaults: {
284
- "@type": "PostalAddress"
285
- }
286
- });
287
-
288
- const organizationResolver = defineSchemaOrgResolver({
289
- defaults: {
290
- "@type": "Organization"
291
- },
292
- idPrefix: ["host", IdentityId],
293
- inheritMeta: [
294
- { meta: "host", key: "url" }
295
- ],
296
- resolve(node, ctx) {
297
- resolveDefaultType(node, "Organization");
298
- node.address = resolveRelation(node.address, ctx, addressResolver);
299
- return node;
300
- },
301
- resolveRootNode(node, ctx) {
302
- const isIdentity = resolveAsGraphKey(node["@id"]) === IdentityId;
303
- const webPage = ctx.find(PrimaryWebPageId);
304
- if (node.logo) {
305
- node.logo = resolveRelation(node.logo, ctx, imageResolver, {
306
- root: true,
307
- afterResolve(logo) {
308
- if (isIdentity)
309
- logo["@id"] = prefixId(ctx.meta.host, "#logo");
310
- setIfEmpty(logo, "caption", node.name);
311
- }
312
- });
313
- if (webPage)
314
- setIfEmpty(webPage, "primaryImageOfPage", idReference(node.logo));
315
- }
316
- if (isIdentity && webPage)
317
- setIfEmpty(webPage, "about", idReference(node));
318
- const webSite = ctx.find(PrimaryWebSiteId);
319
- if (webSite)
320
- setIfEmpty(webSite, "publisher", idReference(node));
321
- }
322
- });
323
-
324
- const personResolver = defineSchemaOrgResolver({
325
- cast(node) {
326
- if (typeof node === "string") {
327
- return {
328
- name: node
329
- };
330
- }
331
- return node;
332
- },
333
- defaults: {
334
- "@type": "Person"
335
- },
336
- idPrefix: ["host", IdentityId],
337
- resolveRootNode(node, { find, meta }) {
338
- if (resolveAsGraphKey(node["@id"]) === IdentityId) {
339
- setIfEmpty(node, "url", meta.host);
340
- const webPage = find(PrimaryWebPageId);
341
- if (webPage)
342
- setIfEmpty(webPage, "about", idReference(node));
343
- const webSite = find(PrimaryWebSiteId);
344
- if (webSite)
345
- setIfEmpty(webSite, "publisher", idReference(node));
346
- }
347
- const article = find(PrimaryArticleId);
348
- if (article)
349
- setIfEmpty(article, "author", idReference(node));
350
- }
351
- });
352
-
353
- const readActionResolver = defineSchemaOrgResolver({
354
- defaults: {
355
- "@type": "ReadAction"
356
- },
357
- resolve(node, ctx) {
358
- if (!node.target.includes(ctx.meta.url))
359
- node.target.unshift(ctx.meta.url);
360
- return node;
361
- }
362
- });
363
-
364
- const PrimaryWebPageId = "#webpage";
365
- const webPageResolver = defineSchemaOrgResolver({
366
- defaults({ meta }) {
367
- const endPath = ufo.withoutTrailingSlash(meta.url.substring(meta.url.lastIndexOf("/") + 1));
368
- let type = "WebPage";
369
- switch (endPath) {
370
- case "about":
371
- case "about-us":
372
- type = "AboutPage";
373
- break;
374
- case "search":
375
- type = "SearchResultsPage";
376
- break;
377
- case "checkout":
378
- type = "CheckoutPage";
379
- break;
380
- case "contact":
381
- case "get-in-touch":
382
- case "contact-us":
383
- type = "ContactPage";
384
- break;
385
- case "faq":
386
- type = "FAQPage";
387
- break;
388
- }
389
- const defaults = {
390
- "@type": type
391
- };
392
- return defaults;
393
- },
394
- idPrefix: ["url", PrimaryWebPageId],
395
- inheritMeta: [
396
- { meta: "title", key: "name" },
397
- "description",
398
- "datePublished",
399
- "dateModified",
400
- "url"
401
- ],
402
- resolve(node, ctx) {
403
- node.dateModified = resolvableDateToIso(node.dateModified);
404
- node.datePublished = resolvableDateToIso(node.datePublished);
405
- resolveDefaultType(node, "WebPage");
406
- node.about = resolveRelation(node.about, ctx, organizationResolver);
407
- node.breadcrumb = resolveRelation(node.breadcrumb, ctx, breadcrumbResolver);
408
- node.author = resolveRelation(node.author, ctx, personResolver);
409
- node.primaryImageOfPage = resolveRelation(node.primaryImageOfPage, ctx, imageResolver);
410
- node.potentialAction = resolveRelation(node.potentialAction, ctx, readActionResolver);
411
- if (node["@type"] === "WebPage") {
412
- setIfEmpty(node, "potentialAction", [
413
- {
414
- "@type": "ReadAction",
415
- "target": [ctx.meta.url]
416
- }
417
- ]);
418
- }
419
- return node;
420
- },
421
- resolveRootNode(webPage, { find, meta }) {
422
- const identity = find(IdentityId);
423
- const webSite = find(PrimaryWebSiteId);
424
- const logo = find("#logo");
425
- if (identity && meta.url === meta.host)
426
- setIfEmpty(webPage, "about", idReference(identity));
427
- if (logo)
428
- setIfEmpty(webPage, "primaryImageOfPage", idReference(logo));
429
- if (webSite)
430
- setIfEmpty(webPage, "isPartOf", idReference(webSite));
431
- const breadcrumb = find(PrimaryBreadcrumbId);
432
- if (breadcrumb)
433
- setIfEmpty(webPage, "breadcrumb", idReference(breadcrumb));
434
- return webPage;
435
- }
436
- });
437
-
438
- const PrimaryArticleId = "#article";
439
- const articleResolver = defineSchemaOrgResolver({
440
- defaults: {
441
- "@type": "Article"
442
- },
443
- inheritMeta: [
444
- "inLanguage",
445
- "description",
446
- "image",
447
- "dateModified",
448
- "datePublished",
449
- { meta: "title", key: "headline" }
450
- ],
451
- idPrefix: ["url", PrimaryArticleId],
452
- resolve(node, ctx) {
453
- node.author = resolveRelation(node.author, ctx, personResolver, {
454
- root: true
455
- });
456
- node.publisher = resolveRelation(node.publisher, ctx);
457
- node.dateModified = resolvableDateToIso(node.dateModified);
458
- node.datePublished = resolvableDateToIso(node.datePublished);
459
- resolveDefaultType(node, "Article");
460
- node.headline = trimLength(node.headline, 110);
461
- return node;
462
- },
463
- resolveRootNode(node, { find, meta }) {
464
- const webPage = find(PrimaryWebPageId);
465
- const identity = find(IdentityId);
466
- if (node.image && !node.thumbnailUrl) {
467
- const firstImage = asArray(node.image)[0];
468
- if (typeof firstImage === "string")
469
- setIfEmpty(node, "thumbnailUrl", resolveWithBase(meta.host, firstImage));
470
- else if (firstImage?.["@id"])
471
- setIfEmpty(node, "thumbnailUrl", find(firstImage["@id"])?.url);
472
- }
473
- if (identity) {
474
- setIfEmpty(node, "publisher", idReference(identity));
475
- setIfEmpty(node, "author", idReference(identity));
476
- }
477
- if (webPage) {
478
- setIfEmpty(node, "isPartOf", idReference(webPage));
479
- setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
480
- setIfEmpty(webPage, "potentialAction", [
481
- {
482
- "@type": "ReadAction",
483
- "target": [meta.url]
484
- }
485
- ]);
486
- setIfEmpty(webPage, "dateModified", node.dateModified);
487
- setIfEmpty(webPage, "datePublished", node.datePublished);
488
- }
489
- return node;
490
- }
491
- });
492
-
493
- const bookEditionResolver = defineSchemaOrgResolver({
494
- defaults: {
495
- "@type": "Book"
496
- },
497
- inheritMeta: [
498
- "inLanguage"
499
- ],
500
- resolve(node, ctx) {
501
- if (node.bookFormat)
502
- node.bookFormat = ufo.withBase(node.bookFormat, "https://schema.org/");
503
- if (node.datePublished)
504
- node.datePublished = resolvableDateToDate(node.datePublished);
505
- node.author = resolveRelation(node.author, ctx);
506
- return node;
507
- },
508
- resolveRootNode(node, { find }) {
509
- const identity = find(IdentityId);
510
- if (identity)
511
- setIfEmpty(node, "provider", idReference(identity));
512
- return node;
513
- }
514
- });
515
- const PrimaryBookId = "#book";
516
- const bookResolver = defineSchemaOrgResolver({
517
- defaults: {
518
- "@type": "Book"
519
- },
520
- inheritMeta: [
521
- "description",
522
- "url",
523
- { meta: "title", key: "name" }
524
- ],
525
- idPrefix: ["url", PrimaryBookId],
526
- resolve(node, ctx) {
527
- node.workExample = resolveRelation(node.workExample, ctx, bookEditionResolver);
528
- node.author = resolveRelation(node.author, ctx);
529
- if (node.url)
530
- ufo.withBase(node.url, ctx.meta.host);
531
- return node;
532
- },
533
- resolveRootNode(node, { find }) {
534
- const identity = find(IdentityId);
535
- if (identity)
536
- setIfEmpty(node, "author", idReference(identity));
537
- return node;
538
- }
539
- });
540
-
541
- const commentResolver = defineSchemaOrgResolver({
542
- defaults: {
543
- "@type": "Comment"
544
- },
545
- idPrefix: "url",
546
- resolve(node, ctx) {
547
- node.author = resolveRelation(node.author, ctx, personResolver, {
548
- root: true
549
- });
550
- return node;
551
- },
552
- resolveRootNode(node, { find }) {
553
- const article = find(PrimaryArticleId);
554
- if (article)
555
- setIfEmpty(node, "about", idReference(article));
556
- }
557
- });
558
-
559
- const courseResolver = defineSchemaOrgResolver({
560
- defaults: {
561
- "@type": "Course"
562
- },
563
- resolve(node, ctx) {
564
- node.provider = resolveRelation(node.provider, ctx, organizationResolver, {
565
- root: true
566
- });
567
- return node;
568
- },
569
- resolveRootNode(node, { find }) {
570
- const identity = find(IdentityId);
571
- if (identity)
572
- setIfEmpty(node, "provider", idReference(identity));
573
- return node;
574
- }
575
- });
576
-
577
- const placeResolver = defineSchemaOrgResolver({
578
- defaults: {
579
- "@type": "Place"
580
- },
581
- resolve(node, ctx) {
582
- if (typeof node.address !== "string")
583
- node.address = resolveRelation(node.address, ctx, addressResolver);
584
- return node;
585
- }
586
- });
587
-
588
- const virtualLocationResolver = defineSchemaOrgResolver({
589
- cast(node) {
590
- if (typeof node === "string") {
591
- return {
592
- url: node
593
- };
594
- }
595
- return node;
596
- },
597
- defaults: {
598
- "@type": "VirtualLocation"
599
- }
600
- });
601
-
602
- const PrimaryEventId = "#event";
603
- const eventResolver = defineSchemaOrgResolver({
604
- defaults: {
605
- "@type": "Event"
606
- },
607
- inheritMeta: [
608
- "inLanguage",
609
- "description",
610
- "image",
611
- { meta: "title", key: "name" }
612
- ],
613
- idPrefix: ["url", PrimaryEventId],
614
- resolve(node, ctx) {
615
- if (node.location) {
616
- const isVirtual = node.location === "string" || node.location?.url !== "undefined";
617
- node.location = resolveRelation(node.location, ctx, isVirtual ? virtualLocationResolver : placeResolver);
618
- }
619
- node.performer = resolveRelation(node.performer, ctx, personResolver, {
620
- root: true
621
- });
622
- node.organizer = resolveRelation(node.organizer, ctx, organizationResolver, {
623
- root: true
624
- });
625
- node.offers = resolveRelation(node.offers, ctx, offerResolver);
626
- if (node.eventAttendanceMode)
627
- node.eventAttendanceMode = ufo.withBase(node.eventAttendanceMode, "https://schema.org/");
628
- if (node.eventStatus)
629
- node.eventStatus = ufo.withBase(node.eventStatus, "https://schema.org/");
630
- const isOnline = node.eventStatus === "https://schema.org/EventMovedOnline";
631
- const dates = ["startDate", "previousStartDate", "endDate"];
632
- dates.forEach((date) => {
633
- if (!isOnline) {
634
- if (node[date] instanceof Date && node[date].getHours() === 0 && node[date].getMinutes() === 0)
635
- node[date] = resolvableDateToDate(node[date]);
636
- } else {
637
- node[date] = resolvableDateToIso(node[date]);
638
- }
639
- });
640
- setIfEmpty(node, "endDate", node.startDate);
641
- return node;
642
- },
643
- resolveRootNode(node, { find }) {
644
- const identity = find(IdentityId);
645
- if (identity)
646
- setIfEmpty(node, "organizer", idReference(identity));
647
- }
648
- });
649
-
650
- const howToStepDirectionResolver = defineSchemaOrgResolver({
651
- cast(node) {
652
- if (typeof node === "string") {
653
- return {
654
- text: node
655
- };
656
- }
657
- return node;
658
- },
659
- defaults: {
660
- "@type": "HowToDirection"
661
- }
662
- });
663
-
664
- const howToStepResolver = defineSchemaOrgResolver({
665
- cast(node) {
666
- if (typeof node === "string") {
667
- return {
668
- text: node
669
- };
670
- }
671
- return node;
672
- },
673
- defaults: {
674
- "@type": "HowToStep"
675
- },
676
- resolve(step, ctx) {
677
- if (step.url)
678
- step.url = resolveWithBase(ctx.meta.url, step.url);
679
- if (step.image) {
680
- step.image = resolveRelation(step.image, ctx, imageResolver, {
681
- root: true
682
- });
683
- }
684
- if (step.itemListElement)
685
- step.itemListElement = resolveRelation(step.itemListElement, ctx, howToStepDirectionResolver);
686
- return step;
687
- }
688
- });
689
-
690
- const HowToId = "#howto";
691
- const howToResolver = defineSchemaOrgResolver({
692
- defaults: {
693
- "@type": "HowTo"
694
- },
695
- inheritMeta: [
696
- "description",
697
- "image",
698
- "inLanguage",
699
- { meta: "title", key: "name" }
700
- ],
701
- idPrefix: ["url", HowToId],
702
- resolve(node, ctx) {
703
- node.step = resolveRelation(node.step, ctx, howToStepResolver);
704
- return node;
705
- },
706
- resolveRootNode(node, { find }) {
707
- const webPage = find(PrimaryWebPageId);
708
- if (webPage)
709
- setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
710
- }
711
- });
712
-
713
- const itemListResolver = defineSchemaOrgResolver({
714
- defaults: {
715
- "@type": "ItemList"
716
- },
717
- resolve(node, ctx) {
718
- if (node.itemListElement) {
719
- let index = 1;
720
- node.itemListElement = resolveRelation(node.itemListElement, ctx, listItemResolver, {
721
- array: true,
722
- afterResolve(node2) {
723
- setIfEmpty(node2, "position", index++);
724
- }
725
- });
726
- }
727
- return node;
728
- }
729
- });
730
-
731
- const quantitativeValueResolver = defineSchemaOrgResolver({
732
- defaults: {
733
- "@type": "QuantitativeValue"
734
- }
735
- });
736
- const monetaryAmountResolver = defineSchemaOrgResolver({
737
- defaults: {
738
- "@type": "MonetaryAmount"
739
- },
740
- resolve(node, ctx) {
741
- node.value = resolveRelation(node.value, ctx, quantitativeValueResolver);
742
- return node;
743
- }
744
- });
745
-
746
- const jobPostingResolver = defineSchemaOrgResolver({
747
- defaults: {
748
- "@type": "JobPosting"
749
- },
750
- resolve(node, ctx) {
751
- node.datePosted = resolvableDateToIso(node.datePosted);
752
- node.hiringOrganization = resolveRelation(node.hiringOrganization, ctx, organizationResolver);
753
- node.jobLocation = resolveRelation(node.jobLocation, ctx, placeResolver);
754
- node.baseSalary = resolveRelation(node.baseSalary, ctx, monetaryAmountResolver);
755
- node.validThrough = resolvableDateToIso(node.validThrough);
756
- return node;
757
- }
758
- });
759
-
760
- const openingHoursResolver = defineSchemaOrgResolver({
761
- defaults: {
762
- "@type": "OpeningHoursSpecification",
763
- "opens": "00:00",
764
- "closes": "23:59"
765
- }
766
- });
767
-
768
- const localBusinessResolver = defineSchemaOrgResolver({
769
- defaults: {
770
- "@type": ["Organization", "LocalBusiness"]
771
- },
772
- inheritMeta: [
773
- { key: "url", meta: "host" },
774
- { key: "currenciesAccepted", meta: "currency" }
775
- ],
776
- idPrefix: ["host", IdentityId],
777
- resolve(node, ctx) {
778
- resolveDefaultType(node, ["Organization", "LocalBusiness"]);
779
- node.address = resolveRelation(node.address, ctx, addressResolver);
780
- node.openingHoursSpecification = resolveRelation(node.openingHoursSpecification, ctx, openingHoursResolver);
781
- node.logo = resolveRelation(node.logo, ctx, imageResolver, {
782
- afterResolve(logo) {
783
- const hasLogo = !!ctx.find("#logo");
784
- if (!hasLogo)
785
- logo["@id"] = prefixId(ctx.meta.host, "#logo");
786
- setIfEmpty(logo, "caption", node.name);
787
- }
788
- });
789
- return node;
790
- }
791
- });
792
-
793
- const ratingResolver = defineSchemaOrgResolver({
794
- cast(node) {
795
- if (node === "number") {
796
- return {
797
- ratingValue: node
798
- };
799
- }
800
- return node;
801
- },
802
- defaults: {
803
- "@type": "Rating",
804
- "bestRating": 5,
805
- "worstRating": 1
806
- }
807
- });
808
-
809
- const reviewResolver = defineSchemaOrgResolver({
810
- defaults: {
811
- "@type": "Review"
812
- },
813
- inheritMeta: [
814
- "inLanguage"
815
- ],
816
- resolve(review, ctx) {
817
- review.reviewRating = resolveRelation(review.reviewRating, ctx, ratingResolver);
818
- review.author = resolveRelation(review.author, ctx, personResolver);
819
- return review;
820
- }
821
- });
822
-
823
- const videoResolver = defineSchemaOrgResolver({
824
- cast(input) {
825
- if (typeof input === "string") {
826
- input = {
827
- url: input
828
- };
829
- }
830
- return input;
831
- },
832
- alias: "video",
833
- defaults: {
834
- "@type": "VideoObject"
835
- },
836
- inheritMeta: [
837
- { meta: "title", key: "name" },
838
- "description",
839
- "image",
840
- "inLanguage",
841
- { meta: "datePublished", key: "uploadDate" }
842
- ],
843
- idPrefix: "host",
844
- resolve(video, ctx) {
845
- if (video.uploadDate)
846
- video.uploadDate = resolvableDateToIso(video.uploadDate);
847
- video.url = resolveWithBase(ctx.meta.host, video.url);
848
- if (video.caption && !video.description)
849
- video.description = video.caption;
850
- if (!video.description)
851
- video.description = "No description";
852
- if (video.thumbnailUrl)
853
- video.thumbnailUrl = resolveRelation(video.thumbnailUrl, ctx, imageResolver);
854
- return video;
855
- },
856
- resolveRootNode(video, { find }) {
857
- if (video.image && !video.thumbnailUrl) {
858
- const firstImage = asArray(video.image)[0];
859
- setIfEmpty(video, "thumbnailUrl", find(firstImage["@id"])?.url);
860
- }
861
- }
862
- });
863
-
864
- const movieResolver = defineSchemaOrgResolver({
865
- defaults: {
866
- "@type": "Movie"
867
- },
868
- resolve(node, ctx) {
869
- node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
870
- node.review = resolveRelation(node.review, ctx, reviewResolver);
871
- node.director = resolveRelation(node.director, ctx, personResolver);
872
- node.actor = resolveRelation(node.actor, ctx, personResolver);
873
- node.trailer = resolveRelation(node.trailer, ctx, videoResolver);
874
- if (node.dateCreated)
875
- node.dateCreated = resolvableDateToDate(node.dateCreated);
876
- return node;
877
- }
878
- });
879
-
880
- const defaults = {
881
- ignoreUnknown: false,
882
- respectType: false,
883
- respectFunctionNames: false,
884
- respectFunctionProperties: false,
885
- unorderedObjects: true,
886
- unorderedArrays: false,
887
- unorderedSets: false
888
- };
889
- function objectHash(object, options = {}) {
890
- options = { ...defaults, ...options };
891
- const hasher = createHasher(options);
892
- hasher.dispatch(object);
893
- return hasher.toString();
894
- }
895
- function createHasher(options) {
896
- const buff = [];
897
- let context = [];
898
- const write = (str) => {
899
- buff.push(str);
900
- };
901
- return {
902
- toString() {
903
- return buff.join("");
904
- },
905
- getContext() {
906
- return context;
907
- },
908
- dispatch(value) {
909
- if (options.replacer) {
910
- value = options.replacer(value);
911
- }
912
- const type = value === null ? "null" : typeof value;
913
- return this["_" + type](value);
914
- },
915
- _object(object) {
916
- if (object && typeof object.toJSON === "function") {
917
- return this._object(object.toJSON());
918
- }
919
- const pattern = /\[object (.*)]/i;
920
- const objString = Object.prototype.toString.call(object);
921
- const _objType = pattern.exec(objString);
922
- const objType = _objType ? _objType[1].toLowerCase() : "unknown:[" + objString.toLowerCase() + "]";
923
- let objectNumber = null;
924
- if ((objectNumber = context.indexOf(object)) >= 0) {
925
- return this.dispatch("[CIRCULAR:" + objectNumber + "]");
926
- } else {
927
- context.push(object);
928
- }
929
- if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
930
- write("buffer:");
931
- return write(object.toString("utf8"));
932
- }
933
- if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
934
- if (this["_" + objType]) {
935
- this["_" + objType](object);
936
- } else if (!options.ignoreUnknown) {
937
- this._unkown(object, objType);
938
- }
939
- } else {
940
- let keys = Object.keys(object);
941
- if (options.unorderedObjects) {
942
- keys = keys.sort();
943
- }
944
- if (options.respectType !== false && !isNativeFunction(object)) {
945
- keys.splice(0, 0, "prototype", "__proto__", "letructor");
946
- }
947
- if (options.excludeKeys) {
948
- keys = keys.filter(function(key) {
949
- return !options.excludeKeys(key);
950
- });
951
- }
952
- write("object:" + keys.length + ":");
953
- for (const key of keys) {
954
- this.dispatch(key);
955
- write(":");
956
- if (!options.excludeValues) {
957
- this.dispatch(object[key]);
958
- }
959
- write(",");
960
- }
961
- }
962
- },
963
- _array(arr, unordered) {
964
- unordered = typeof unordered !== "undefined" ? unordered : options.unorderedArrays !== false;
965
- write("array:" + arr.length + ":");
966
- if (!unordered || arr.length <= 1) {
967
- for (const entry of arr) {
968
- this.dispatch(entry);
969
- }
970
- return;
971
- }
972
- const contextAdditions = [];
973
- const entries = arr.map((entry) => {
974
- const hasher = createHasher(options);
975
- hasher.dispatch(entry);
976
- contextAdditions.push(hasher.getContext());
977
- return hasher.toString();
978
- });
979
- context = [...context, ...contextAdditions];
980
- entries.sort();
981
- return this._array(entries, false);
982
- },
983
- _date(date) {
984
- return write("date:" + date.toJSON());
985
- },
986
- _symbol(sym) {
987
- return write("symbol:" + sym.toString());
988
- },
989
- _unkown(value, type) {
990
- write(type);
991
- if (!value) {
992
- return;
993
- }
994
- write(":");
995
- if (value && typeof value.entries === "function") {
996
- return this._array(
997
- Array.from(value.entries()),
998
- true
999
- /* ordered */
1000
- );
1001
- }
1002
- },
1003
- _error(err) {
1004
- return write("error:" + err.toString());
1005
- },
1006
- _boolean(bool) {
1007
- return write("bool:" + bool.toString());
1008
- },
1009
- _string(string) {
1010
- write("string:" + string.length + ":");
1011
- write(string.toString());
1012
- },
1013
- _function(fn) {
1014
- write("fn:");
1015
- if (isNativeFunction(fn)) {
1016
- this.dispatch("[native]");
1017
- } else {
1018
- this.dispatch(fn.toString());
1019
- }
1020
- if (options.respectFunctionNames !== false) {
1021
- this.dispatch("function-name:" + String(fn.name));
1022
- }
1023
- if (options.respectFunctionProperties) {
1024
- this._object(fn);
1025
- }
1026
- },
1027
- _number(number) {
1028
- return write("number:" + number.toString());
1029
- },
1030
- _xml(xml) {
1031
- return write("xml:" + xml.toString());
1032
- },
1033
- _null() {
1034
- return write("Null");
1035
- },
1036
- _undefined() {
1037
- return write("Undefined");
1038
- },
1039
- _regexp(regex) {
1040
- return write("regex:" + regex.toString());
1041
- },
1042
- _uint8array(arr) {
1043
- write("uint8array:");
1044
- return this.dispatch(Array.prototype.slice.call(arr));
1045
- },
1046
- _uint8clampedarray(arr) {
1047
- write("uint8clampedarray:");
1048
- return this.dispatch(Array.prototype.slice.call(arr));
1049
- },
1050
- _int8array(arr) {
1051
- write("int8array:");
1052
- return this.dispatch(Array.prototype.slice.call(arr));
1053
- },
1054
- _uint16array(arr) {
1055
- write("uint16array:");
1056
- return this.dispatch(Array.prototype.slice.call(arr));
1057
- },
1058
- _int16array(arr) {
1059
- write("int16array:");
1060
- return this.dispatch(Array.prototype.slice.call(arr));
1061
- },
1062
- _uint32array(arr) {
1063
- write("uint32array:");
1064
- return this.dispatch(Array.prototype.slice.call(arr));
1065
- },
1066
- _int32array(arr) {
1067
- write("int32array:");
1068
- return this.dispatch(Array.prototype.slice.call(arr));
1069
- },
1070
- _float32array(arr) {
1071
- write("float32array:");
1072
- return this.dispatch(Array.prototype.slice.call(arr));
1073
- },
1074
- _float64array(arr) {
1075
- write("float64array:");
1076
- return this.dispatch(Array.prototype.slice.call(arr));
1077
- },
1078
- _arraybuffer(arr) {
1079
- write("arraybuffer:");
1080
- return this.dispatch(new Uint8Array(arr));
1081
- },
1082
- _url(url) {
1083
- return write("url:" + url.toString());
1084
- },
1085
- _map(map) {
1086
- write("map:");
1087
- const arr = [...map];
1088
- return this._array(arr, options.unorderedSets !== false);
1089
- },
1090
- _set(set) {
1091
- write("set:");
1092
- const arr = [...set];
1093
- return this._array(arr, options.unorderedSets !== false);
1094
- },
1095
- _file(file) {
1096
- write("file:");
1097
- return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
1098
- },
1099
- _blob() {
1100
- if (options.ignoreUnknown) {
1101
- return write("[blob]");
1102
- }
1103
- throw new Error(
1104
- 'Hashing Blob objects is currently not supported\nUse "options.replacer" or "options.ignoreUnknown"\n'
1105
- );
1106
- },
1107
- _domwindow() {
1108
- return write("domwindow");
1109
- },
1110
- _bigint(number) {
1111
- return write("bigint:" + number.toString());
1112
- },
1113
- /* Node.js standard native objects */
1114
- _process() {
1115
- return write("process");
1116
- },
1117
- _timer() {
1118
- return write("timer");
1119
- },
1120
- _pipe() {
1121
- return write("pipe");
1122
- },
1123
- _tcp() {
1124
- return write("tcp");
1125
- },
1126
- _udp() {
1127
- return write("udp");
1128
- },
1129
- _tty() {
1130
- return write("tty");
1131
- },
1132
- _statwatcher() {
1133
- return write("statwatcher");
1134
- },
1135
- _securecontext() {
1136
- return write("securecontext");
1137
- },
1138
- _connection() {
1139
- return write("connection");
1140
- },
1141
- _zlib() {
1142
- return write("zlib");
1143
- },
1144
- _context() {
1145
- return write("context");
1146
- },
1147
- _nodescript() {
1148
- return write("nodescript");
1149
- },
1150
- _httpparser() {
1151
- return write("httpparser");
1152
- },
1153
- _dataview() {
1154
- return write("dataview");
1155
- },
1156
- _signal() {
1157
- return write("signal");
1158
- },
1159
- _fsevent() {
1160
- return write("fsevent");
1161
- },
1162
- _tlswrap() {
1163
- return write("tlswrap");
1164
- }
1165
- };
1166
- }
1167
- function isNativeFunction(f) {
1168
- if (typeof f !== "function") {
1169
- return false;
1170
- }
1171
- const exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code]\s+}$/i;
1172
- return exp.exec(Function.prototype.toString.call(f)) != null;
1173
- }
1174
-
1175
- class WordArray {
1176
- constructor(words, sigBytes) {
1177
- words = this.words = words || [];
1178
- this.sigBytes = sigBytes !== void 0 ? sigBytes : words.length * 4;
1179
- }
1180
- toString(encoder) {
1181
- return (encoder || Hex).stringify(this);
1182
- }
1183
- concat(wordArray) {
1184
- this.clamp();
1185
- if (this.sigBytes % 4) {
1186
- for (let i = 0; i < wordArray.sigBytes; i++) {
1187
- const thatByte = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1188
- this.words[this.sigBytes + i >>> 2] |= thatByte << 24 - (this.sigBytes + i) % 4 * 8;
1189
- }
1190
- } else {
1191
- for (let j = 0; j < wordArray.sigBytes; j += 4) {
1192
- this.words[this.sigBytes + j >>> 2] = wordArray.words[j >>> 2];
1193
- }
1194
- }
1195
- this.sigBytes += wordArray.sigBytes;
1196
- return this;
1197
- }
1198
- clamp() {
1199
- this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8;
1200
- this.words.length = Math.ceil(this.sigBytes / 4);
1201
- }
1202
- clone() {
1203
- return new WordArray([...this.words]);
1204
- }
1205
- }
1206
- const Hex = {
1207
- stringify(wordArray) {
1208
- const hexChars = [];
1209
- for (let i = 0; i < wordArray.sigBytes; i++) {
1210
- const bite = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1211
- hexChars.push((bite >>> 4).toString(16), (bite & 15).toString(16));
1212
- }
1213
- return hexChars.join("");
1214
- }
1215
- };
1216
- const Base64 = {
1217
- stringify(wordArray) {
1218
- const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
1219
- const base64Chars = [];
1220
- for (let i = 0; i < wordArray.sigBytes; i += 3) {
1221
- const byte1 = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1222
- const byte2 = wordArray.words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
1223
- const byte3 = wordArray.words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
1224
- const triplet = byte1 << 16 | byte2 << 8 | byte3;
1225
- for (let j = 0; j < 4 && i * 8 + j * 6 < wordArray.sigBytes * 8; j++) {
1226
- base64Chars.push(keyStr.charAt(triplet >>> 6 * (3 - j) & 63));
1227
- }
1228
- }
1229
- return base64Chars.join("");
1230
- }
1231
- };
1232
- const Latin1 = {
1233
- parse(latin1Str) {
1234
- const latin1StrLength = latin1Str.length;
1235
- const words = [];
1236
- for (let i = 0; i < latin1StrLength; i++) {
1237
- words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
1238
- }
1239
- return new WordArray(words, latin1StrLength);
1240
- }
1241
- };
1242
- const Utf8 = {
1243
- parse(utf8Str) {
1244
- return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
1245
- }
1246
- };
1247
- class BufferedBlockAlgorithm {
1248
- constructor() {
1249
- this._minBufferSize = 0;
1250
- this.blockSize = 512 / 32;
1251
- this.reset();
1252
- }
1253
- reset() {
1254
- this._data = new WordArray();
1255
- this._nDataBytes = 0;
1256
- }
1257
- _append(data) {
1258
- if (typeof data === "string") {
1259
- data = Utf8.parse(data);
1260
- }
1261
- this._data.concat(data);
1262
- this._nDataBytes += data.sigBytes;
1263
- }
1264
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1265
- _doProcessBlock(_dataWords, _offset) {
1266
- }
1267
- _process(doFlush) {
1268
- let processedWords;
1269
- let nBlocksReady = this._data.sigBytes / (this.blockSize * 4);
1270
- if (doFlush) {
1271
- nBlocksReady = Math.ceil(nBlocksReady);
1272
- } else {
1273
- nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
1274
- }
1275
- const nWordsReady = nBlocksReady * this.blockSize;
1276
- const nBytesReady = Math.min(nWordsReady * 4, this._data.sigBytes);
1277
- if (nWordsReady) {
1278
- for (let offset = 0; offset < nWordsReady; offset += this.blockSize) {
1279
- this._doProcessBlock(this._data.words, offset);
1280
- }
1281
- processedWords = this._data.words.splice(0, nWordsReady);
1282
- this._data.sigBytes -= nBytesReady;
1283
- }
1284
- return new WordArray(processedWords, nBytesReady);
1285
- }
1286
- }
1287
- class Hasher extends BufferedBlockAlgorithm {
1288
- update(messageUpdate) {
1289
- this._append(messageUpdate);
1290
- this._process();
1291
- return this;
1292
- }
1293
- finalize(messageUpdate) {
1294
- if (messageUpdate) {
1295
- this._append(messageUpdate);
1296
- }
1297
- }
1298
- }
1299
-
1300
- const H = [
1301
- 1779033703,
1302
- -1150833019,
1303
- 1013904242,
1304
- -1521486534,
1305
- 1359893119,
1306
- -1694144372,
1307
- 528734635,
1308
- 1541459225
1309
- ];
1310
- const K = [
1311
- 1116352408,
1312
- 1899447441,
1313
- -1245643825,
1314
- -373957723,
1315
- 961987163,
1316
- 1508970993,
1317
- -1841331548,
1318
- -1424204075,
1319
- -670586216,
1320
- 310598401,
1321
- 607225278,
1322
- 1426881987,
1323
- 1925078388,
1324
- -2132889090,
1325
- -1680079193,
1326
- -1046744716,
1327
- -459576895,
1328
- -272742522,
1329
- 264347078,
1330
- 604807628,
1331
- 770255983,
1332
- 1249150122,
1333
- 1555081692,
1334
- 1996064986,
1335
- -1740746414,
1336
- -1473132947,
1337
- -1341970488,
1338
- -1084653625,
1339
- -958395405,
1340
- -710438585,
1341
- 113926993,
1342
- 338241895,
1343
- 666307205,
1344
- 773529912,
1345
- 1294757372,
1346
- 1396182291,
1347
- 1695183700,
1348
- 1986661051,
1349
- -2117940946,
1350
- -1838011259,
1351
- -1564481375,
1352
- -1474664885,
1353
- -1035236496,
1354
- -949202525,
1355
- -778901479,
1356
- -694614492,
1357
- -200395387,
1358
- 275423344,
1359
- 430227734,
1360
- 506948616,
1361
- 659060556,
1362
- 883997877,
1363
- 958139571,
1364
- 1322822218,
1365
- 1537002063,
1366
- 1747873779,
1367
- 1955562222,
1368
- 2024104815,
1369
- -2067236844,
1370
- -1933114872,
1371
- -1866530822,
1372
- -1538233109,
1373
- -1090935817,
1374
- -965641998
1375
- ];
1376
- const W = [];
1377
- class SHA256 extends Hasher {
1378
- constructor() {
1379
- super();
1380
- this.reset();
1381
- }
1382
- reset() {
1383
- super.reset();
1384
- this._hash = new WordArray([...H]);
1385
- }
1386
- _doProcessBlock(M, offset) {
1387
- const H2 = this._hash.words;
1388
- let a = H2[0];
1389
- let b = H2[1];
1390
- let c = H2[2];
1391
- let d = H2[3];
1392
- let e = H2[4];
1393
- let f = H2[5];
1394
- let g = H2[6];
1395
- let h = H2[7];
1396
- for (let i = 0; i < 64; i++) {
1397
- if (i < 16) {
1398
- W[i] = M[offset + i] | 0;
1399
- } else {
1400
- const gamma0x = W[i - 15];
1401
- const gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
1402
- const gamma1x = W[i - 2];
1403
- const gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
1404
- W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
1405
- }
1406
- const ch = e & f ^ ~e & g;
1407
- const maj = a & b ^ a & c ^ b & c;
1408
- const sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
1409
- const sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
1410
- const t1 = h + sigma1 + ch + K[i] + W[i];
1411
- const t2 = sigma0 + maj;
1412
- h = g;
1413
- g = f;
1414
- f = e;
1415
- e = d + t1 | 0;
1416
- d = c;
1417
- c = b;
1418
- b = a;
1419
- a = t1 + t2 | 0;
1420
- }
1421
- H2[0] = H2[0] + a | 0;
1422
- H2[1] = H2[1] + b | 0;
1423
- H2[2] = H2[2] + c | 0;
1424
- H2[3] = H2[3] + d | 0;
1425
- H2[4] = H2[4] + e | 0;
1426
- H2[5] = H2[5] + f | 0;
1427
- H2[6] = H2[6] + g | 0;
1428
- H2[7] = H2[7] + h | 0;
1429
- }
1430
- finalize(messageUpdate) {
1431
- super.finalize(messageUpdate);
1432
- const nBitsTotal = this._nDataBytes * 8;
1433
- const nBitsLeft = this._data.sigBytes * 8;
1434
- this._data.words[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
1435
- this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(
1436
- nBitsTotal / 4294967296
1437
- );
1438
- this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
1439
- this._data.sigBytes = this._data.words.length * 4;
1440
- this._process();
1441
- return this._hash;
1442
- }
1443
- }
1444
- function sha256base64(message) {
1445
- return new SHA256().finalize(message).toString(Base64);
1446
- }
1447
-
1448
- function hash(object, options = {}) {
1449
- const hashed = typeof object === "string" ? object : objectHash(object, options);
1450
- return sha256base64(hashed).slice(0, 10);
1451
- }
1452
-
1453
- const ProductId = "#product";
1454
- const productResolver = defineSchemaOrgResolver({
1455
- defaults: {
1456
- "@type": "Product"
1457
- },
1458
- inheritMeta: [
1459
- "description",
1460
- "image",
1461
- { meta: "title", key: "name" }
1462
- ],
1463
- idPrefix: ["url", ProductId],
1464
- resolve(node, ctx) {
1465
- setIfEmpty(node, "sku", hash(node.name));
1466
- node.aggregateOffer = resolveRelation(node.aggregateOffer, ctx, aggregateOfferResolver);
1467
- node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
1468
- node.offers = resolveRelation(node.offers, ctx, offerResolver);
1469
- node.review = resolveRelation(node.review, ctx, reviewResolver);
1470
- return node;
1471
- },
1472
- resolveRootNode(product, { find }) {
1473
- const webPage = find(PrimaryWebPageId);
1474
- const identity = find(IdentityId);
1475
- if (identity)
1476
- setIfEmpty(product, "brand", idReference(identity));
1477
- if (webPage)
1478
- setIfEmpty(product, "mainEntityOfPage", idReference(webPage));
1479
- return product;
1480
- }
1481
- });
1482
-
1483
- const answerResolver = defineSchemaOrgResolver({
1484
- cast(node) {
1485
- if (typeof node === "string") {
1486
- return {
1487
- text: node
1488
- };
1489
- }
1490
- return node;
1491
- },
1492
- defaults: {
1493
- "@type": "Answer"
1494
- }
1495
- });
1496
-
1497
- const questionResolver = defineSchemaOrgResolver({
1498
- defaults: {
1499
- "@type": "Question"
1500
- },
1501
- inheritMeta: [
1502
- "inLanguage"
1503
- ],
1504
- idPrefix: "url",
1505
- resolve(question, ctx) {
1506
- if (question.question)
1507
- question.name = question.question;
1508
- if (question.answer)
1509
- question.acceptedAnswer = question.answer;
1510
- question.acceptedAnswer = resolveRelation(question.acceptedAnswer, ctx, answerResolver);
1511
- return question;
1512
- },
1513
- resolveRootNode(question, { find }) {
1514
- const webPage = find(PrimaryWebPageId);
1515
- if (webPage && asArray(webPage["@type"]).includes("FAQPage"))
1516
- dedupeMerge(webPage, "mainEntity", idReference(question));
1517
- }
1518
- });
1519
-
1520
- const RecipeId = "#recipe";
1521
- const recipeResolver = defineSchemaOrgResolver({
1522
- defaults: {
1523
- "@type": "Recipe"
1524
- },
1525
- inheritMeta: [
1526
- { meta: "title", key: "name" },
1527
- "description",
1528
- "image",
1529
- "datePublished"
1530
- ],
1531
- idPrefix: ["url", RecipeId],
1532
- resolve(node, ctx) {
1533
- node.recipeInstructions = resolveRelation(node.recipeInstructions, ctx, howToStepResolver);
1534
- return node;
1535
- },
1536
- resolveRootNode(node, { find }) {
1537
- const article = find(PrimaryArticleId);
1538
- const webPage = find(PrimaryWebPageId);
1539
- if (article)
1540
- setIfEmpty(node, "mainEntityOfPage", idReference(article));
1541
- else if (webPage)
1542
- setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
1543
- if (article?.author)
1544
- setIfEmpty(node, "author", article.author);
1545
- return node;
1546
- }
1547
- });
1548
-
1549
- const softwareAppResolver = defineSchemaOrgResolver({
1550
- defaults: {
1551
- "@type": "SoftwareApplication"
1552
- },
1553
- resolve(node, ctx) {
1554
- resolveDefaultType(node, "SoftwareApplication");
1555
- node.offers = resolveRelation(node.offers, ctx, offerResolver);
1556
- node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
1557
- node.review = resolveRelation(node.review, ctx, reviewResolver);
1558
- return node;
1559
- }
1560
- });
1561
-
1562
- function loadResolver(resolver) {
1563
- switch (resolver) {
1564
- case "address":
1565
- return addressResolver;
1566
- case "aggregateOffer":
1567
- return aggregateOfferResolver;
1568
- case "aggregateRating":
1569
- return aggregateRatingResolver;
1570
- case "article":
1571
- return articleResolver;
1572
- case "breadcrumb":
1573
- return breadcrumbResolver;
1574
- case "comment":
1575
- return commentResolver;
1576
- case "event":
1577
- return eventResolver;
1578
- case "virtualLocation":
1579
- return virtualLocationResolver;
1580
- case "place":
1581
- return placeResolver;
1582
- case "howTo":
1583
- return howToResolver;
1584
- case "howToStep":
1585
- return howToStepResolver;
1586
- case "image":
1587
- return imageResolver;
1588
- case "localBusiness":
1589
- return localBusinessResolver;
1590
- case "offer":
1591
- return offerResolver;
1592
- case "openingHours":
1593
- return openingHoursResolver;
1594
- case "organization":
1595
- return organizationResolver;
1596
- case "person":
1597
- return personResolver;
1598
- case "product":
1599
- return productResolver;
1600
- case "question":
1601
- return questionResolver;
1602
- case "recipe":
1603
- return recipeResolver;
1604
- case "review":
1605
- return reviewResolver;
1606
- case "video":
1607
- return videoResolver;
1608
- case "webPage":
1609
- return webPageResolver;
1610
- case "webSite":
1611
- return webSiteResolver;
1612
- case "book":
1613
- return bookResolver;
1614
- case "course":
1615
- return courseResolver;
1616
- case "itemList":
1617
- return itemListResolver;
1618
- case "jobPosting":
1619
- return jobPostingResolver;
1620
- case "listItem":
1621
- return listItemResolver;
1622
- case "movie":
1623
- return movieResolver;
1624
- case "searchAction":
1625
- return searchActionResolver;
1626
- case "readAction":
1627
- return readActionResolver;
1628
- case "softwareApp":
1629
- return softwareAppResolver;
1630
- case "bookEdition":
1631
- return bookEditionResolver;
1632
- }
1633
- return null;
1634
- }
1635
-
1636
- const resolver = {
1637
- __proto__: null,
1638
- loadResolver: loadResolver
1639
- };
1640
-
1641
- function resolveMeta(meta) {
1642
- if (!meta.host && meta.canonicalHost)
1643
- meta.host = meta.canonicalHost;
1644
- if (!meta.tagPosition && meta.position)
1645
- meta.tagPosition = meta.position;
1646
- if (!meta.currency && meta.defaultCurrency)
1647
- meta.currency = meta.defaultCurrency;
1648
- if (!meta.inLanguage && meta.defaultLanguage)
1649
- meta.inLanguage = meta.defaultLanguage;
1650
- if (!meta.path)
1651
- meta.path = "/";
1652
- if (!meta.host && typeof document !== "undefined")
1653
- meta.host = document.location.host;
1654
- if (!meta.url && meta.canonicalUrl)
1655
- meta.url = meta.canonicalUrl;
1656
- if (meta.path !== "/") {
1657
- if (meta.trailingSlash && !ufo.hasTrailingSlash(meta.path))
1658
- meta.path = ufo.withTrailingSlash(meta.path);
1659
- else if (!meta.trailingSlash && ufo.hasTrailingSlash(meta.path))
1660
- meta.path = ufo.withoutTrailingSlash(meta.path);
1661
- }
1662
- meta.url = ufo.joinURL(meta.host, meta.path);
1663
- return {
1664
- ...meta,
1665
- host: meta.host,
1666
- url: meta.url,
1667
- currency: meta.currency,
1668
- image: meta.image,
1669
- inLanguage: meta.inLanguage,
1670
- title: meta.title,
1671
- description: meta.description,
1672
- datePublished: meta.datePublished,
1673
- dateModified: meta.dateModified
1674
- };
1675
- }
1676
- function resolveNode(node, ctx, resolver) {
1677
- if (resolver?.cast)
1678
- node = resolver.cast(node, ctx);
1679
- if (resolver?.defaults) {
1680
- let defaults = resolver.defaults || {};
1681
- if (typeof defaults === "function")
1682
- defaults = defaults(ctx);
1683
- node = {
1684
- ...defaults,
1685
- ...node
1686
- };
1687
- }
1688
- resolver.inheritMeta?.forEach((entry) => {
1689
- if (typeof entry === "string")
1690
- setIfEmpty(node, entry, ctx.meta[entry]);
1691
- else
1692
- setIfEmpty(node, entry.key, ctx.meta[entry.meta]);
1693
- });
1694
- if (resolver?.resolve)
1695
- node = resolver.resolve(node, ctx);
1696
- for (const k in node) {
1697
- const v = node[k];
1698
- if (typeof v === "object" && v?._resolver)
1699
- node[k] = resolveRelation(v, ctx, v._resolver);
1700
- }
1701
- stripEmptyProperties(node);
1702
- return node;
1703
- }
1704
- function resolveNodeId(node, ctx, resolver, resolveAsRoot = false) {
1705
- const prefix = Array.isArray(resolver.idPrefix) ? resolver.idPrefix[0] : resolver.idPrefix;
1706
- if (!prefix)
1707
- return node;
1708
- if (node["@id"] && !node["@id"].startsWith(ctx.meta.host)) {
1709
- node["@id"] = prefixId(ctx.meta[prefix], node["@id"]);
1710
- return node;
1711
- }
1712
- const rootId = Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] : void 0;
1713
- if (resolveAsRoot && rootId) {
1714
- node["@id"] = prefixId(ctx.meta[prefix], rootId);
1715
- }
1716
- if (!node["@id"]) {
1717
- let alias = resolver?.alias;
1718
- if (!alias) {
1719
- const type = asArray(node["@type"])?.[0] || "";
1720
- alias = type.toLowerCase();
1721
- }
1722
- const hashNodeData = {};
1723
- Object.entries(node).forEach(([key, val]) => {
1724
- if (!key.startsWith("_"))
1725
- hashNodeData[key] = val;
1726
- });
1727
- node["@id"] = prefixId(ctx.meta[prefix], `#/schema/${alias}/${hashCode(JSON.stringify(hashNodeData))}`);
1728
- }
1729
- return node;
1730
- }
1731
- function resolveRelation(input, ctx, fallbackResolver, options = {}) {
1732
- if (!input)
1733
- return input;
1734
- const ids = asArray(input).map((a) => {
1735
- if (Object.keys(a).length === 1 && a["@id"])
1736
- return a;
1737
- let resolver = fallbackResolver;
1738
- if (a._resolver) {
1739
- resolver = a._resolver;
1740
- if (typeof resolver === "string")
1741
- resolver = loadResolver(resolver);
1742
- delete a._resolver;
1743
- }
1744
- if (!resolver)
1745
- return a;
1746
- let node = resolveNode(a, ctx, resolver);
1747
- if (options.afterResolve)
1748
- options.afterResolve(node);
1749
- if (options.generateId || options.root)
1750
- node = resolveNodeId(node, ctx, resolver, false);
1751
- if (options.root) {
1752
- if (resolver.resolveRootNode)
1753
- resolver.resolveRootNode(node, ctx);
1754
- ctx.push(node);
1755
- return idReference(node["@id"]);
1756
- }
1757
- return node;
1758
- });
1759
- if (!options.array && ids.length === 1)
1760
- return ids[0];
1761
- return ids;
1762
- }
1763
-
1764
- function isObject(value) {
1765
- return value !== null && typeof value === "object";
1766
- }
1767
- function _defu(baseObject, defaults, namespace = ".", merger) {
1768
- if (!isObject(defaults)) {
1769
- return _defu(baseObject, {}, namespace, merger);
1770
- }
1771
- const object = Object.assign({}, defaults);
1772
- for (const key in baseObject) {
1773
- if (key === "__proto__" || key === "constructor") {
1774
- continue;
1775
- }
1776
- const value = baseObject[key];
1777
- if (value === null || value === void 0) {
1778
- continue;
1779
- }
1780
- if (merger && merger(object, key, value, namespace)) {
1781
- continue;
1782
- }
1783
- if (Array.isArray(value) && Array.isArray(object[key])) {
1784
- object[key] = [...value, ...object[key]];
1785
- } else if (isObject(value) && isObject(object[key])) {
1786
- object[key] = _defu(
1787
- value,
1788
- object[key],
1789
- (namespace ? `${namespace}.` : "") + key.toString(),
1790
- merger
1791
- );
1792
- } else {
1793
- object[key] = value;
1794
- }
1795
- }
1796
- return object;
1797
- }
1798
- function createDefu(merger) {
1799
- return (...arguments_) => (
1800
- // eslint-disable-next-line unicorn/no-array-reduce
1801
- arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
1802
- );
1803
- }
1804
- const defu = createDefu();
1805
-
1806
- function groupBy(array, predicate) {
1807
- return array.reduce((acc, value, index, array2) => {
1808
- const key = predicate(value, index, array2);
1809
- if (!acc[key])
1810
- acc[key] = [];
1811
- acc[key].push(value);
1812
- return acc;
1813
- }, {});
1814
- }
1815
- function dedupeNodes(nodes) {
1816
- const dedupedNodes = {};
1817
- for (const key of nodes.keys()) {
1818
- const n = nodes[key];
1819
- const nodeKey = resolveAsGraphKey(n["@id"] || hash(n));
1820
- if (dedupedNodes[nodeKey])
1821
- dedupedNodes[nodeKey] = defu(nodes[key], dedupedNodes[nodeKey]);
1822
- else
1823
- dedupedNodes[nodeKey] = nodes[key];
1824
- }
1825
- return Object.values(dedupedNodes);
1826
- }
1827
- function normaliseNodes(nodes) {
1828
- const sortedNodeKeys = nodes.keys();
1829
- const dedupedNodes = {};
1830
- for (const key of sortedNodeKeys) {
1831
- const n = nodes[key];
1832
- const nodeKey = resolveAsGraphKey(n["@id"] || hash(n));
1833
- const groupedKeys = groupBy(Object.keys(n), (key2) => {
1834
- const val = n[key2];
1835
- if (key2.startsWith("_"))
1836
- return "ignored";
1837
- if (Array.isArray(val) || typeof val === "object")
1838
- return "relations";
1839
- return "primitives";
1840
- });
1841
- const keys = [
1842
- ...(groupedKeys.primitives || []).sort(),
1843
- ...(groupedKeys.relations || []).sort()
1844
- ];
1845
- let newNode = {};
1846
- for (const key2 of keys)
1847
- newNode[key2] = n[key2];
1848
- if (dedupedNodes[nodeKey])
1849
- newNode = defu(newNode, dedupedNodes[nodeKey]);
1850
- dedupedNodes[nodeKey] = newNode;
1851
- }
1852
- return Object.values(dedupedNodes);
1853
- }
1854
-
1855
- function createSchemaOrgGraph() {
1856
- const ctx = {
1857
- find(id) {
1858
- const key = resolveAsGraphKey(id);
1859
- return ctx.nodes.filter((n) => !!n["@id"]).find((n) => resolveAsGraphKey(n["@id"]) === key);
1860
- },
1861
- push(input) {
1862
- asArray(input).forEach((node) => {
1863
- const registeredNode = node;
1864
- ctx.nodes.push(registeredNode);
1865
- });
1866
- },
1867
- resolveGraph(meta) {
1868
- ctx.meta = resolveMeta({ ...meta });
1869
- ctx.nodes.forEach((node, key) => {
1870
- const resolver = node._resolver;
1871
- if (resolver) {
1872
- node = resolveNode(node, ctx, resolver);
1873
- node = resolveNodeId(node, ctx, resolver, true);
1874
- }
1875
- ctx.nodes[key] = node;
1876
- });
1877
- ctx.nodes = dedupeNodes(ctx.nodes);
1878
- ctx.nodes.forEach((node) => {
1879
- if (node.image && typeof node.image === "string") {
1880
- node.image = resolveRelation(node.image, ctx, imageResolver, {
1881
- root: true
1882
- });
1883
- }
1884
- if (node._resolver?.resolveRootNode)
1885
- node._resolver.resolveRootNode(node, ctx);
1886
- delete node._resolver;
1887
- });
1888
- return normaliseNodes(ctx.nodes);
1889
- },
1890
- nodes: [],
1891
- meta: {}
1892
- };
1893
- return ctx;
1894
- }
1895
-
1896
- function SchemaOrgUnheadPlugin(config, meta) {
1897
- config = resolveMeta({ ...config });
1898
- let graph;
1899
- const resolvedMeta = {};
1900
- return {
1901
- hooks: {
1902
- "entries:resolve": function() {
1903
- graph = createSchemaOrgGraph();
1904
- },
1905
- "tag:normalise": async function({ tag }) {
1906
- if (tag.key === "schema-org-graph") {
1907
- const { loadResolver } = await Promise.resolve().then(function () { return resolver; });
1908
- const nodes = await tag.props.nodes;
1909
- for (const node of Array.isArray(nodes) ? nodes : [nodes]) {
1910
- const newNode = {
1911
- ...node,
1912
- _resolver: loadResolver(await node._resolver)
1913
- };
1914
- graph.push(newNode);
1915
- }
1916
- tag.tagPosition = config.tagPosition === "head" ? "head" : "bodyClose";
1917
- }
1918
- if (tag.tag === "title")
1919
- resolvedMeta.title = tag.textContent;
1920
- else if (tag.tag === "meta" && tag.props.name === "description")
1921
- resolvedMeta.description = tag.props.content;
1922
- else if (tag.tag === "link" && tag.props.rel === "canonical")
1923
- resolvedMeta.url = tag.props.href;
1924
- else if (tag.tag === "meta" && tag.props.property === "og:image")
1925
- resolvedMeta.image = tag.props.content;
1926
- },
1927
- "tags:resolve": async function(ctx) {
1928
- for (const tag of ctx.tags) {
1929
- if (tag.tag === "script" && tag.key === "schema-org-graph") {
1930
- tag.innerHTML = JSON.stringify({
1931
- "@context": "https://schema.org",
1932
- "@graph": graph.resolveGraph({ ...config, ...resolvedMeta, ...await meta() })
1933
- }, null, 2);
1934
- delete tag.props.nodes;
1935
- }
1936
- }
1937
- }
1938
- }
1939
- };
1940
- }
5
+ require('ufo');
6
+ require('@unhead/shared');
1941
7
 
1942
8
  function provideResolver(input, resolver) {
1943
9
  if (!input)
@@ -2056,30 +122,63 @@ function useSchemaOrg(input) {
2056
122
  nodes: input
2057
123
  }
2058
124
  ]
2059
- }, { mode: process.env.NODE_ENV === "development" ? "all" : "server" });
125
+ });
2060
126
  }
2061
127
 
2062
- exports.HowToId = HowToId;
2063
- exports.PrimaryArticleId = PrimaryArticleId;
2064
- exports.PrimaryBookId = PrimaryBookId;
2065
- exports.PrimaryBreadcrumbId = PrimaryBreadcrumbId;
2066
- exports.PrimaryEventId = PrimaryEventId;
2067
- exports.PrimaryWebPageId = PrimaryWebPageId;
2068
- exports.PrimaryWebSiteId = PrimaryWebSiteId;
2069
- exports.ProductId = ProductId;
2070
- exports.RecipeId = RecipeId;
2071
- exports.SchemaOrgUnheadPlugin = SchemaOrgUnheadPlugin;
2072
- exports.addressResolver = addressResolver;
2073
- exports.aggregateOfferResolver = aggregateOfferResolver;
2074
- exports.aggregateRatingResolver = aggregateRatingResolver;
2075
- exports.articleResolver = articleResolver;
2076
- exports.bookEditionResolver = bookEditionResolver;
2077
- exports.bookResolver = bookResolver;
2078
- exports.breadcrumbResolver = breadcrumbResolver;
2079
- exports.commentResolver = commentResolver;
2080
- exports.courseResolver = courseResolver;
2081
- exports.createSchemaOrgGraph = createSchemaOrgGraph;
2082
- exports.dedupeNodes = dedupeNodes;
128
+ exports.HowToId = SchemaOrgUnheadPlugin.HowToId;
129
+ exports.PrimaryArticleId = SchemaOrgUnheadPlugin.PrimaryArticleId;
130
+ exports.PrimaryBookId = SchemaOrgUnheadPlugin.PrimaryBookId;
131
+ exports.PrimaryBreadcrumbId = SchemaOrgUnheadPlugin.PrimaryBreadcrumbId;
132
+ exports.PrimaryEventId = SchemaOrgUnheadPlugin.PrimaryEventId;
133
+ exports.PrimaryWebPageId = SchemaOrgUnheadPlugin.PrimaryWebPageId;
134
+ exports.PrimaryWebSiteId = SchemaOrgUnheadPlugin.PrimaryWebSiteId;
135
+ exports.ProductId = SchemaOrgUnheadPlugin.ProductId;
136
+ exports.RecipeId = SchemaOrgUnheadPlugin.RecipeId;
137
+ exports.SchemaOrgUnheadPlugin = SchemaOrgUnheadPlugin.SchemaOrgUnheadPlugin;
138
+ exports.addressResolver = SchemaOrgUnheadPlugin.addressResolver;
139
+ exports.aggregateOfferResolver = SchemaOrgUnheadPlugin.aggregateOfferResolver;
140
+ exports.aggregateRatingResolver = SchemaOrgUnheadPlugin.aggregateRatingResolver;
141
+ exports.articleResolver = SchemaOrgUnheadPlugin.articleResolver;
142
+ exports.bookEditionResolver = SchemaOrgUnheadPlugin.bookEditionResolver;
143
+ exports.bookResolver = SchemaOrgUnheadPlugin.bookResolver;
144
+ exports.breadcrumbResolver = SchemaOrgUnheadPlugin.breadcrumbResolver;
145
+ exports.commentResolver = SchemaOrgUnheadPlugin.commentResolver;
146
+ exports.courseResolver = SchemaOrgUnheadPlugin.courseResolver;
147
+ exports.createSchemaOrgGraph = SchemaOrgUnheadPlugin.createSchemaOrgGraph;
148
+ exports.dedupeNodes = SchemaOrgUnheadPlugin.dedupeNodes;
149
+ exports.defineSchemaOrgResolver = SchemaOrgUnheadPlugin.defineSchemaOrgResolver;
150
+ exports.eventResolver = SchemaOrgUnheadPlugin.eventResolver;
151
+ exports.howToResolver = SchemaOrgUnheadPlugin.howToResolver;
152
+ exports.howToStepDirectionResolver = SchemaOrgUnheadPlugin.howToStepDirectionResolver;
153
+ exports.howToStepResolver = SchemaOrgUnheadPlugin.howToStepResolver;
154
+ exports.imageResolver = SchemaOrgUnheadPlugin.imageResolver;
155
+ exports.itemListResolver = SchemaOrgUnheadPlugin.itemListResolver;
156
+ exports.jobPostingResolver = SchemaOrgUnheadPlugin.jobPostingResolver;
157
+ exports.listItemResolver = SchemaOrgUnheadPlugin.listItemResolver;
158
+ exports.localBusinessResolver = SchemaOrgUnheadPlugin.localBusinessResolver;
159
+ exports.movieResolver = SchemaOrgUnheadPlugin.movieResolver;
160
+ exports.normaliseNodes = SchemaOrgUnheadPlugin.normaliseNodes;
161
+ exports.offerResolver = SchemaOrgUnheadPlugin.offerResolver;
162
+ exports.openingHoursResolver = SchemaOrgUnheadPlugin.openingHoursResolver;
163
+ exports.organizationResolver = SchemaOrgUnheadPlugin.organizationResolver;
164
+ exports.personResolver = SchemaOrgUnheadPlugin.personResolver;
165
+ exports.placeResolver = SchemaOrgUnheadPlugin.placeResolver;
166
+ exports.productResolver = SchemaOrgUnheadPlugin.productResolver;
167
+ exports.questionResolver = SchemaOrgUnheadPlugin.questionResolver;
168
+ exports.ratingResolver = SchemaOrgUnheadPlugin.ratingResolver;
169
+ exports.readActionResolver = SchemaOrgUnheadPlugin.readActionResolver;
170
+ exports.recipeResolver = SchemaOrgUnheadPlugin.recipeResolver;
171
+ exports.resolveMeta = SchemaOrgUnheadPlugin.resolveMeta;
172
+ exports.resolveNode = SchemaOrgUnheadPlugin.resolveNode;
173
+ exports.resolveNodeId = SchemaOrgUnheadPlugin.resolveNodeId;
174
+ exports.resolveRelation = SchemaOrgUnheadPlugin.resolveRelation;
175
+ exports.reviewResolver = SchemaOrgUnheadPlugin.reviewResolver;
176
+ exports.searchActionResolver = SchemaOrgUnheadPlugin.searchActionResolver;
177
+ exports.softwareAppResolver = SchemaOrgUnheadPlugin.softwareAppResolver;
178
+ exports.videoResolver = SchemaOrgUnheadPlugin.videoResolver;
179
+ exports.virtualLocationResolver = SchemaOrgUnheadPlugin.virtualLocationResolver;
180
+ exports.webPageResolver = SchemaOrgUnheadPlugin.webPageResolver;
181
+ exports.webSiteResolver = SchemaOrgUnheadPlugin.webSiteResolver;
2083
182
  exports.defineAddress = defineAddress;
2084
183
  exports.defineAggregateOffer = defineAggregateOffer;
2085
184
  exports.defineAggregateRating = defineAggregateRating;
@@ -2108,43 +207,10 @@ exports.defineQuestion = defineQuestion;
2108
207
  exports.defineReadAction = defineReadAction;
2109
208
  exports.defineRecipe = defineRecipe;
2110
209
  exports.defineReview = defineReview;
2111
- exports.defineSchemaOrgResolver = defineSchemaOrgResolver;
2112
210
  exports.defineSearchAction = defineSearchAction;
2113
211
  exports.defineSoftwareApp = defineSoftwareApp;
2114
212
  exports.defineVideo = defineVideo;
2115
213
  exports.defineVirtualLocation = defineVirtualLocation;
2116
214
  exports.defineWebPage = defineWebPage;
2117
215
  exports.defineWebSite = defineWebSite;
2118
- exports.eventResolver = eventResolver;
2119
- exports.howToResolver = howToResolver;
2120
- exports.howToStepDirectionResolver = howToStepDirectionResolver;
2121
- exports.howToStepResolver = howToStepResolver;
2122
- exports.imageResolver = imageResolver;
2123
- exports.itemListResolver = itemListResolver;
2124
- exports.jobPostingResolver = jobPostingResolver;
2125
- exports.listItemResolver = listItemResolver;
2126
- exports.localBusinessResolver = localBusinessResolver;
2127
- exports.movieResolver = movieResolver;
2128
- exports.normaliseNodes = normaliseNodes;
2129
- exports.offerResolver = offerResolver;
2130
- exports.openingHoursResolver = openingHoursResolver;
2131
- exports.organizationResolver = organizationResolver;
2132
- exports.personResolver = personResolver;
2133
- exports.placeResolver = placeResolver;
2134
- exports.productResolver = productResolver;
2135
- exports.questionResolver = questionResolver;
2136
- exports.ratingResolver = ratingResolver;
2137
- exports.readActionResolver = readActionResolver;
2138
- exports.recipeResolver = recipeResolver;
2139
- exports.resolveMeta = resolveMeta;
2140
- exports.resolveNode = resolveNode;
2141
- exports.resolveNodeId = resolveNodeId;
2142
- exports.resolveRelation = resolveRelation;
2143
- exports.reviewResolver = reviewResolver;
2144
- exports.searchActionResolver = searchActionResolver;
2145
- exports.softwareAppResolver = softwareAppResolver;
2146
216
  exports.useSchemaOrg = useSchemaOrg;
2147
- exports.videoResolver = videoResolver;
2148
- exports.virtualLocationResolver = virtualLocationResolver;
2149
- exports.webPageResolver = webPageResolver;
2150
- exports.webSiteResolver = webSiteResolver;