@xylabs/sdk-meta 5.0.83 → 5.0.86

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/README.md CHANGED
@@ -15,6 +15,8 @@
15
15
 
16
16
  Base functionality used throughout XYO TypeScript/JavaScript libraries
17
17
 
18
+
19
+
18
20
  ## Reference
19
21
 
20
22
  **@xylabs/sdk-meta**
@@ -23,24 +25,30 @@ Base functionality used throughout XYO TypeScript/JavaScript libraries
23
25
 
24
26
  ## Interfaces
25
27
 
26
- - [Meta](#interfaces/Meta)
27
- - [OpenGraphMeta](#interfaces/OpenGraphMeta)
28
- - [OpenGraphStructured](#interfaces/OpenGraphStructured)
29
- - [TwitterMeta](#interfaces/TwitterMeta)
30
- - [TwitterApp](#interfaces/TwitterApp)
31
- - [TwitterPlayer](#interfaces/TwitterPlayer)
28
+ | Interface | Description |
29
+ | ------ | ------ |
30
+ | [Meta](#interfaces/Meta) | Represents page metadata including Open Graph and Twitter card properties. |
31
+ | [OpenGraphMeta](#interfaces/OpenGraphMeta) | Open Graph protocol metadata for rich link previews. |
32
+ | [OpenGraphStructured](#interfaces/OpenGraphStructured) | Structured properties for an Open Graph media object (image, video, or audio). |
33
+ | [TwitterMeta](#interfaces/TwitterMeta) | https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup |
34
+ | [TwitterApp](#interfaces/TwitterApp) | Twitter App Card metadata containing app store identifiers, names, and URLs per platform. |
35
+ | [TwitterPlayer](#interfaces/TwitterPlayer) | https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card |
32
36
 
33
37
  ## Type Aliases
34
38
 
35
- - [StringIndexable](#type-aliases/StringIndexable)
36
- - [OpenGraphStructuredProperty](#type-aliases/OpenGraphStructuredProperty)
39
+ | Type Alias | Description |
40
+ | ------ | ------ |
41
+ | [StringIndexable](#type-aliases/StringIndexable) | An object with string keys and arbitrary values, used for recursive meta flattening. |
42
+ | [OpenGraphStructuredProperty](#type-aliases/OpenGraphStructuredProperty) | A structured Open Graph property value: a URL string, a structured object, or an array of either. |
37
43
 
38
44
  ## Functions
39
45
 
40
- - [mergeDocumentHead](#functions/mergeDocumentHead)
41
- - [getMetaAsDict](#functions/getMetaAsDict)
42
- - [addMetaToHead](#functions/addMetaToHead)
43
- - [metaBuilder](#functions/metaBuilder)
46
+ | Function | Description |
47
+ | ------ | ------ |
48
+ | [mergeDocumentHead](#functions/mergeDocumentHead) | Merges meta tags from the source HTML head into the destination HTML head. Existing meta tags with matching property attributes are replaced; others are appended. |
49
+ | [getMetaAsDict](#functions/getMetaAsDict) | Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys. |
50
+ | [addMetaToHead](#functions/addMetaToHead) | Adds or replaces a meta tag in the document head. |
51
+ | [metaBuilder](#functions/metaBuilder) | Injects meta properties, title, and description into an HTML string. |
44
52
 
45
53
  ### functions
46
54
 
@@ -52,24 +60,20 @@ Base functionality used throughout XYO TypeScript/JavaScript libraries
52
60
 
53
61
  ```ts
54
62
  function addMetaToHead(
55
- $,
56
- name,
57
- value): void;
63
+ $: CheerioAPI,
64
+ name: string,
65
+ value: string | object): void;
58
66
  ```
59
67
 
60
- ## Parameters
61
-
62
- ### $
63
-
64
- `CheerioAPI`
68
+ Adds or replaces a meta tag in the document head.
65
69
 
66
- ### name
67
-
68
- `string`
69
-
70
- ### value
70
+ ## Parameters
71
71
 
72
- `string` | `object`
72
+ | Parameter | Type | Description |
73
+ | ------ | ------ | ------ |
74
+ | `$` | `CheerioAPI` | The Cheerio API instance for the document. |
75
+ | `name` | `string` | The meta property name. |
76
+ | `value` | `string` \| `object` | The meta content value (string, array, or nested object). |
73
77
 
74
78
  ## Returns
75
79
 
@@ -82,23 +86,24 @@ function addMetaToHead(
82
86
  ***
83
87
 
84
88
  ```ts
85
- function getMetaAsDict(obj, parentKey?): Record<string, string>;
89
+ function getMetaAsDict(obj: StringIndexable, parentKey?: string): Record<string, string>;
86
90
  ```
87
91
 
88
- ## Parameters
89
-
90
- ### obj
92
+ Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.
91
93
 
92
- [`StringIndexable`](#../type-aliases/StringIndexable)
94
+ ## Parameters
93
95
 
94
- ### parentKey?
95
-
96
- `string`
96
+ | Parameter | Type | Description |
97
+ | ------ | ------ | ------ |
98
+ | `obj` | [`StringIndexable`](#../type-aliases/StringIndexable) | The nested object to flatten. |
99
+ | `parentKey?` | `string` | The accumulated key prefix from parent levels. |
97
100
 
98
101
  ## Returns
99
102
 
100
103
  `Record`\<`string`, `string`\>
101
104
 
105
+ A flat record mapping colon-delimited property names to string values.
106
+
102
107
  ### <a id="mergeDocumentHead"></a>mergeDocumentHead
103
108
 
104
109
  [**@xylabs/sdk-meta**](#../README)
@@ -106,23 +111,25 @@ function getMetaAsDict(obj, parentKey?): Record<string, string>;
106
111
  ***
107
112
 
108
113
  ```ts
109
- function mergeDocumentHead(destination, source): string;
114
+ function mergeDocumentHead(destination: string, source: string): string;
110
115
  ```
111
116
 
112
- ## Parameters
113
-
114
- ### destination
117
+ Merges meta tags from the source HTML head into the destination HTML head.
118
+ Existing meta tags with matching property attributes are replaced; others are appended.
115
119
 
116
- `string`
120
+ ## Parameters
117
121
 
118
- ### source
119
-
120
- `string`
122
+ | Parameter | Type | Description |
123
+ | ------ | ------ | ------ |
124
+ | `destination` | `string` | The base HTML string to merge into. |
125
+ | `source` | `string` | The HTML string whose head meta tags will be merged. |
121
126
 
122
127
  ## Returns
123
128
 
124
129
  `string`
125
130
 
131
+ The merged HTML string.
132
+
126
133
  ### <a id="metaBuilder"></a>metaBuilder
127
134
 
128
135
  [**@xylabs/sdk-meta**](#../README)
@@ -131,29 +138,27 @@ function mergeDocumentHead(destination, source): string;
131
138
 
132
139
  ```ts
133
140
  function metaBuilder(
134
- html,
135
- meta,
136
- handler?): string;
141
+ html: string,
142
+ meta: Meta,
143
+ handler?: string): string;
137
144
  ```
138
145
 
139
- ## Parameters
140
-
141
- ### html
142
-
143
- `string`
144
-
145
- ### meta
146
-
147
- [`Meta`](#../interfaces/Meta)
146
+ Injects meta properties, title, and description into an HTML string.
148
147
 
149
- ### handler?
148
+ ## Parameters
150
149
 
151
- `string`
150
+ | Parameter | Type | Description |
151
+ | ------ | ------ | ------ |
152
+ | `html` | `string` | The base HTML string to modify. |
153
+ | `meta` | [`Meta`](#../interfaces/Meta) | The metadata to inject. |
154
+ | `handler?` | `string` | Optional meta-handler property value to include. |
152
155
 
153
156
  ## Returns
154
157
 
155
158
  `string`
156
159
 
160
+ The modified HTML string with injected metadata.
161
+
157
162
  ### interfaces
158
163
 
159
164
  ### <a id="Meta"></a>Meta
@@ -162,37 +167,16 @@ function metaBuilder(
162
167
 
163
168
  ***
164
169
 
165
- ## Properties
166
-
167
- ### description?
168
-
169
- ```ts
170
- optional description: string;
171
- ```
172
-
173
- ***
174
-
175
- ### og?
170
+ Represents page metadata including Open Graph and Twitter card properties.
176
171
 
177
- ```ts
178
- optional og: OpenGraphMeta;
179
- ```
180
-
181
- ***
182
-
183
- ### title?
184
-
185
- ```ts
186
- optional title: string;
187
- ```
188
-
189
- ***
172
+ ## Properties
190
173
 
191
- ### twitter?
192
-
193
- ```ts
194
- optional twitter: TwitterMeta;
195
- ```
174
+ | Property | Type |
175
+ | ------ | ------ |
176
+ | <a id="description"></a> `description?` | `string` |
177
+ | <a id="og"></a> `og?` | [`OpenGraphMeta`](#OpenGraphMeta) |
178
+ | <a id="title"></a> `title?` | `string` |
179
+ | <a id="twitter"></a> `twitter?` | [`TwitterMeta`](#TwitterMeta) |
196
180
 
197
181
  ### <a id="OpenGraphMeta"></a>OpenGraphMeta
198
182
 
@@ -200,85 +184,22 @@ optional twitter: TwitterMeta;
200
184
 
201
185
  ***
202
186
 
203
- ## Properties
204
-
205
- ### audio?
206
-
207
- ```ts
208
- optional audio: OpenGraphStructuredProperty;
209
- ```
210
-
211
- ***
212
-
213
- ### description?
214
-
215
- ```ts
216
- optional description: string;
217
- ```
218
-
219
- ***
220
-
221
- ### determiner?
222
-
223
- ```ts
224
- optional determiner: string;
225
- ```
226
-
227
- ***
228
-
229
- ### image?
230
-
231
- ```ts
232
- optional image: OpenGraphStructuredProperty;
233
- ```
234
-
235
- ***
236
-
237
- ### locale?
238
-
239
- ```ts
240
- optional locale: string | string[];
241
- ```
242
-
243
- ***
244
-
245
- ### site\_name?
246
-
247
- ```ts
248
- optional site_name: string;
249
- ```
250
-
251
- ***
252
-
253
- ### title?
254
-
255
- ```ts
256
- optional title: string;
257
- ```
258
-
259
- ***
260
-
261
- ### type?
187
+ Open Graph protocol metadata for rich link previews.
262
188
 
263
- ```ts
264
- optional type: string;
265
- ```
266
-
267
- ***
268
-
269
- ### url?
270
-
271
- ```ts
272
- optional url: string;
273
- ```
274
-
275
- ***
276
-
277
- ### video?
189
+ ## Properties
278
190
 
279
- ```ts
280
- optional video: OpenGraphStructuredProperty;
281
- ```
191
+ | Property | Type |
192
+ | ------ | ------ |
193
+ | <a id="audio"></a> `audio?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
194
+ | <a id="description"></a> `description?` | `string` |
195
+ | <a id="determiner"></a> `determiner?` | `string` |
196
+ | <a id="image"></a> `image?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
197
+ | <a id="locale"></a> `locale?` | `string` \| `string`[] |
198
+ | <a id="site_name"></a> `site_name?` | `string` |
199
+ | <a id="title"></a> `title?` | `string` |
200
+ | <a id="type"></a> `type?` | `string` |
201
+ | <a id="url"></a> `url?` | `string` |
202
+ | <a id="video"></a> `video?` | [`OpenGraphStructuredProperty`](#../type-aliases/OpenGraphStructuredProperty) |
282
203
 
283
204
  ### <a id="OpenGraphStructured"></a>OpenGraphStructured
284
205
 
@@ -286,61 +207,19 @@ optional video: OpenGraphStructuredProperty;
286
207
 
287
208
  ***
288
209
 
289
- ## Properties
290
-
291
- ### ?
292
-
293
- ```ts
294
- optional : string;
295
- ```
296
-
297
- ***
298
-
299
- ### alt?
300
-
301
- ```ts
302
- optional alt: string;
303
- ```
304
-
305
- ***
306
-
307
- ### height?
308
-
309
- ```ts
310
- optional height: number;
311
- ```
312
-
313
- ***
314
-
315
- ### secure\_url?
316
-
317
- ```ts
318
- optional secure_url: string;
319
- ```
320
-
321
- ***
322
-
323
- ### type?
210
+ Structured properties for an Open Graph media object (image, video, or audio).
324
211
 
325
- ```ts
326
- optional type: string;
327
- ```
328
-
329
- ***
330
-
331
- ### url?
332
-
333
- ```ts
334
- optional url: string;
335
- ```
336
-
337
- ***
212
+ ## Properties
338
213
 
339
- ### width?
340
-
341
- ```ts
342
- optional width: number;
343
- ```
214
+ | Property | Type |
215
+ | ------ | ------ |
216
+ | <a id="_"></a> `?` | `string` |
217
+ | <a id="alt"></a> `alt?` | `string` |
218
+ | <a id="height"></a> `height?` | `number` |
219
+ | <a id="secure_url"></a> `secure_url?` | `string` |
220
+ | <a id="type"></a> `type?` | `string` |
221
+ | <a id="url"></a> `url?` | `string` |
222
+ | <a id="width"></a> `width?` | `number` |
344
223
 
345
224
  ### <a id="TwitterApp"></a>TwitterApp
346
225
 
@@ -348,83 +227,24 @@ optional width: number;
348
227
 
349
228
  ***
350
229
 
351
- ## Properties
352
-
353
- ### id?
354
-
355
- ```ts
356
- optional id: object;
357
- ```
358
-
359
- ### googleplay?
360
-
361
- ```ts
362
- optional googleplay: string;
363
- ```
364
-
365
- ### ipad?
366
-
367
- ```ts
368
- optional ipad: string;
369
- ```
370
-
371
- ### iphone?
372
-
373
- ```ts
374
- optional iphone: string;
375
- ```
376
-
377
- ***
378
-
379
- ### name?
380
-
381
- ```ts
382
- optional name: object;
383
- ```
384
-
385
- ### googleplay?
386
-
387
- ```ts
388
- optional googleplay: string;
389
- ```
390
-
391
- ### ipad?
392
-
393
- ```ts
394
- optional ipad: string;
395
- ```
396
-
397
- ### iphone?
398
-
399
- ```ts
400
- optional iphone: string;
401
- ```
402
-
403
- ***
404
-
405
- ### url?
406
-
407
- ```ts
408
- optional url: object;
409
- ```
410
-
411
- ### googleplay?
412
-
413
- ```ts
414
- optional googleplay: string;
415
- ```
416
-
417
- ### ipad?
418
-
419
- ```ts
420
- optional ipad: string;
421
- ```
230
+ Twitter App Card metadata containing app store identifiers, names, and URLs per platform.
422
231
 
423
- ### iphone?
232
+ ## Properties
424
233
 
425
- ```ts
426
- optional iphone: string;
427
- ```
234
+ | Property | Type |
235
+ | ------ | ------ |
236
+ | <a id="id"></a> `id?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
237
+ | `id.googleplay?` | `string` |
238
+ | `id.ipad?` | `string` |
239
+ | `id.iphone?` | `string` |
240
+ | <a id="name"></a> `name?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
241
+ | `name.googleplay?` | `string` |
242
+ | `name.ipad?` | `string` |
243
+ | `name.iphone?` | `string` |
244
+ | <a id="url"></a> `url?` | \{ `googleplay?`: `string`; `ipad?`: `string`; `iphone?`: `string`; \} |
245
+ | `url.googleplay?` | `string` |
246
+ | `url.ipad?` | `string` |
247
+ | `url.iphone?` | `string` |
428
248
 
429
249
  ### <a id="TwitterMeta"></a>TwitterMeta
430
250
 
@@ -436,143 +256,22 @@ https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
436
256
 
437
257
  ## Properties
438
258
 
439
- ### app?
440
-
441
- ```ts
442
- optional app: TwitterApp;
443
- ```
444
-
445
- ***
446
-
447
- ### card?
448
-
449
- ```ts
450
- optional card: "summary" | "summary_large_image" | "app" | "player";
451
- ```
452
-
453
- The card type. Used with all cards. Fallback: og:type.
454
- If an og:type, og:title and og:description exist in the markup but
455
- twitter:card is absent, then a summary card may be rendered.
456
-
457
- ***
458
-
459
- ### creator?
460
-
461
- ```ts
462
- optional creator: object;
463
- ```
464
-
465
- ### ?
466
-
467
- ```ts
468
- optional : string;
469
- ```
470
-
471
- The
472
-
473
- #### Username
474
-
475
- of content creator. Used with summary_large_image cards
476
-
477
- ### id?
478
-
479
- ```ts
480
- optional id: string;
481
- ```
482
-
483
- Twitter user ID of content creator. Used with summary,
484
- summary_large_image cards
485
-
486
- ***
487
-
488
- ### description?
489
-
490
- ```ts
491
- optional description: string;
492
- ```
493
-
494
- Description of content (maximum 200 characters). Used with summary,
495
- summary_large_image, player cards. Fallback: og:description.
496
-
497
- ***
498
-
499
- ### image?
500
-
501
- ```ts
502
- optional image: object;
503
- ```
504
-
505
- ### ?
506
-
507
- ```ts
508
- optional : string;
509
- ```
510
-
511
- URL of image to use in the card. Images must be less than 5MB in size.
512
- JPG, PNG, WEBP and GIF formats are supported. Only the first frame of
513
- an animated GIF will be used. SVG is not supported. Used with summary,
514
- summary_large_image, player cards. Fallback: og:image
515
-
516
- ### alt?
517
-
518
- ```ts
519
- optional alt: string;
520
- ```
521
-
522
- A text description of the image conveying the essential nature of
523
- an image to users who are visually impaired. Maximum 420
524
- characters. Used with summary, summary_large_image, player cards
525
-
526
- ***
527
-
528
- ### player?
529
-
530
- ```ts
531
- optional player: TwitterPlayer;
532
- ```
533
-
534
- ***
535
-
536
- ### site?
537
-
538
- ```ts
539
- optional site: object;
540
- ```
541
-
542
- The
543
-
544
- ### ?
545
-
546
- ```ts
547
- optional : string;
548
- ```
549
-
550
- ### id?
551
-
552
- ```ts
553
- optional id: string;
554
- ```
555
-
556
- Same as twitter:site, but the user’s Twitter ID. Either
557
- twitter:site or twitter:site:id is required. Used with
558
- summary, summary_large_image, player cards
559
-
560
- ### Username
561
-
562
- of website. Either twitter:site or twitter:site:id is
563
- required. Used with summary, summary_large_image, app, player
564
- cards
565
-
566
- ***
567
-
568
- ### title?
569
-
570
- ```ts
571
- optional title: string;
572
- ```
573
-
574
- Title of content (max 70 characters). Used with summary,
575
- summary_large_image, player cards. Fallback: og:title.
259
+ | Property | Type | Description |
260
+ | ------ | ------ | ------ |
261
+ | <a id="app"></a> `app?` | [`TwitterApp`](#TwitterApp) | - |
262
+ | <a id="card"></a> `card?` | `"summary"` \| `"summary_large_image"` \| `"app"` \| `"player"` | The card type. Used with all cards. Fallback: og:type. If an og:type, og:title and og:description exist in the markup but twitter:card is absent, then a summary card may be rendered. |
263
+ | <a id="creator"></a> `creator?` | \{ `?`: `string`; `id?`: `string`; \} | - |
264
+ | `creator.?` | `string` | The **Username** of content creator. Used with summary_large_image cards |
265
+ | `creator.id?` | `string` | Twitter user ID of content creator. Used with summary, summary_large_image cards |
266
+ | <a id="description"></a> `description?` | `string` | Description of content (maximum 200 characters). Used with summary, summary_large_image, player cards. Fallback: og:description. |
267
+ | <a id="image"></a> `image?` | \{ `?`: `string`; `alt?`: `string`; \} | - |
268
+ | `image.?` | `string` | URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported. Used with summary, summary_large_image, player cards. Fallback: og:image |
269
+ | `image.alt?` | `string` | A text description of the image conveying the essential nature of an image to users who are visually impaired. Maximum 420 characters. Used with summary, summary_large_image, player cards |
270
+ | <a id="player"></a> `player?` | [`TwitterPlayer`](#TwitterPlayer) | - |
271
+ | <a id="site"></a> `site?` | \{ `?`: `string`; `id?`: `string`; \} | The **Username** of website. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, app, player cards |
272
+ | `site.?` | `string` | - |
273
+ | `site.id?` | `string` | Same as twitter:site, but the user’s Twitter ID. Either twitter:site or twitter:site:id is required. Used with summary, summary_large_image, player cards |
274
+ | <a id="title"></a> `title?` | `string` | Title of content (max 70 characters). Used with summary, summary_large_image, player cards. Fallback: og:title. |
576
275
 
577
276
  ### <a id="TwitterPlayer"></a>TwitterPlayer
578
277
 
@@ -584,45 +283,12 @@ https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player
584
283
 
585
284
  ## Properties
586
285
 
587
- ###
588
-
589
- ```ts
590
- : string;
591
- ```
592
-
593
- HTTPS URL to iFrame player. This must be a HTTPS URL which does not
594
- generate active mixed content warnings in a web browser. The audio or
595
- video player must not require plugins such as Adobe Flash.
596
-
597
- ***
598
-
599
- ### height?
600
-
601
- ```ts
602
- optional height: number;
603
- ```
604
-
605
- Height of iframe in pixels. Used with player card
606
-
607
- ***
608
-
609
- ### stream?
610
-
611
- ```ts
612
- optional stream: string;
613
- ```
614
-
615
- URL to raw video or audio stream. Used with player card
616
-
617
- ***
618
-
619
- ### width?
620
-
621
- ```ts
622
- optional width: number;
623
- ```
624
-
625
- Width of iframe in pixels. Used with player card
286
+ | Property | Type | Description |
287
+ | ------ | ------ | ------ |
288
+ | <a id="_"></a> `` | `string` | HTTPS URL to iFrame player. This must be a HTTPS URL which does not generate active mixed content warnings in a web browser. The audio or video player must not require plugins such as Adobe Flash. |
289
+ | <a id="height"></a> `height?` | `number` | Height of iframe in pixels. Used with player card |
290
+ | <a id="stream"></a> `stream?` | `string` | URL to raw video or audio stream. Used with player card |
291
+ | <a id="width"></a> `width?` | `number` | Width of iframe in pixels. Used with player card |
626
292
 
627
293
  ### type-aliases
628
294
 
@@ -639,6 +305,8 @@ type OpenGraphStructuredProperty =
639
305
  | (string | OpenGraphStructured)[];
640
306
  ```
641
307
 
308
+ A structured Open Graph property value: a URL string, a structured object, or an array of either.
309
+
642
310
  ### <a id="StringIndexable"></a>StringIndexable
643
311
 
644
312
  [**@xylabs/sdk-meta**](#../README)
@@ -646,9 +314,13 @@ type OpenGraphStructuredProperty =
646
314
  ***
647
315
 
648
316
  ```ts
649
- type StringIndexable = object;
317
+ type StringIndexable = {
318
+ [key: string]: any;
319
+ };
650
320
  ```
651
321
 
322
+ An object with string keys and arbitrary values, used for recursive meta flattening.
323
+
652
324
  ## Index Signature
653
325
 
654
326
  ```ts
@@ -1,2 +1,9 @@
1
+ /**
2
+ * Merges meta tags from the source HTML head into the destination HTML head.
3
+ * Existing meta tags with matching property attributes are replaced; others are appended.
4
+ * @param destination - The base HTML string to merge into.
5
+ * @param source - The HTML string whose head meta tags will be merged.
6
+ * @returns The merged HTML string.
7
+ */
1
8
  export declare const mergeDocumentHead: (destination: string, source: string) => string;
2
9
  //# sourceMappingURL=mergeDocumentHead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDocumentHead.d.ts","sourceRoot":"","sources":["../../../src/html/mergeDocumentHead.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,EAAE,QAAQ,MAAM,WAwCpE,CAAA"}
1
+ {"version":3,"file":"mergeDocumentHead.d.ts","sourceRoot":"","sources":["../../../src/html/mergeDocumentHead.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,EAAE,QAAQ,MAAM,WAwCpE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/html/mergeDocumentHead.ts","../../src/lib/getMetaAsDict.ts","../../src/meta/builder.ts"],"sourcesContent":["import { isString } from '@xylabs/typeof'\nimport { load } from 'cheerio'\n\nconst opts = {}\n// const opts = { decodeEntities: false }\n\nexport const mergeDocumentHead = (destination: string, source: string) => {\n const $destination = load(destination, opts)\n const $source = load(source, opts)\n\n // For each child node of the source head\n $source('head')\n .children()\n .each((_, element) => {\n const el = $destination(element)\n\n // Special case for meta tags: We want to match them by the name attribute\n if (el[0].tagName === 'meta') {\n const property = el.attr('property')\n if (isString(property)) {\n const match = $destination(`head meta[property=\"${property}\"]`)\n\n // If it exists, replace it, otherwise append it\n if (match.length > 0) {\n match.replaceWith(el)\n return\n } else {\n $destination('head').append(el)\n }\n }\n // else {\n // // For all other elements, just check if the same element exists in the first HTML string\n // const match = $destination(el[0].tagName)\n\n // // If it exists, replace it, otherwise append it\n // if (match.length > 0) {\n // match.replaceWith(el)\n // } else {\n // $destination('head').append(el)\n // }\n // }\n }\n })\n\n // Return the merged HTML\n return $destination.html(opts)\n}\n","import { isString } from '@xylabs/typeof'\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type StringIndexable = { [key: string]: any }\n\nconst propertyDelimiter = ':'\n\nexport const getMetaAsDict = (obj: StringIndexable, parentKey?: string): Record<string, string> => {\n let flatRecord: StringIndexable = {}\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null) {\n // If the value is another object, we want to iterate through its keys as well.\n const childRecord = getMetaAsDict(obj[key] as StringIndexable, `${isString(parentKey) ? parentKey : ''}${key}${propertyDelimiter}`)\n flatRecord = { ...flatRecord, ...childRecord }\n } else {\n // Concatenate the key with its parent key.\n const newKey = isString(parentKey) ? `${parentKey}${key}` : key\n const trimmed = newKey.endsWith(propertyDelimiter) ? newKey.slice(0, -1) : newKey\n flatRecord[trimmed] = `${obj[key]}`\n }\n }\n return flatRecord\n}\n","import { isString } from '@xylabs/typeof'\nimport type { CheerioAPI } from 'cheerio'\nimport { load } from 'cheerio'\n\nimport { getMetaAsDict } from '../lib/index.ts'\nimport type { Meta } from '../models/index.ts'\n\n/* test change */\n\nexport const addMetaToHead = ($: CheerioAPI, name: string, value: string | object) => {\n if (typeof value === 'string') {\n const newMeta = `<meta property=\"${name}\" content=\"${value}\" />`\n const existingMeta = $(`head meta[property=\"${name}\"]`)\n if ((existingMeta?.length ?? 0) > 0) {\n existingMeta.replaceWith(newMeta)\n } else {\n $('head').append(newMeta)\n }\n } else if (Array.isArray(value)) {\n for (const item of value) addMetaToHead($, `${name}`, item)\n } else if (typeof value === 'object') {\n for (let [key, v] of Object.entries(value)) {\n if (key === 'url') {\n addMetaToHead($, name, v)\n } else {\n addMetaToHead($, `${name}:${key}`, v)\n }\n }\n } else {\n throw new TypeError(`Invalid item type [${name}, ${typeof value}]`)\n }\n}\n\nexport const metaBuilder = (html: string, meta: Meta, handler?: string) => {\n const $ = load(html)\n // NOTE: This assumes unique meta properties (no duplicates)\n // which is generally the case, but not always (you can have\n // multiple og:video:tag tags, for example)\n const metaProperties = getMetaAsDict(meta)\n for (const [key, value] of Object.entries(metaProperties)) {\n addMetaToHead($, key, value)\n }\n if (isString(meta.description)) {\n addMetaToHead($, 'description', meta.description)\n }\n if (isString(meta.title)) {\n $('title').text(meta.title)\n }\n if (isString(handler)) {\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AE,KAAK,KAAK,KAAK;AAAA,EAC5B;AACA,MAAIA,UAAS,OAAO,GAAG;AACrB,kBAAc,GAAG,gBAAgB,OAAO;AAAA,EAC1C;AACA,SAAO,EAAE,KAAK;AAChB;","names":["isString","isString","load","load","isString"]}
1
+ {"version":3,"sources":["../../src/html/mergeDocumentHead.ts","../../src/lib/getMetaAsDict.ts","../../src/meta/builder.ts"],"sourcesContent":["import { isString } from '@xylabs/typeof'\nimport { load } from 'cheerio'\n\nconst opts = {}\n// const opts = { decodeEntities: false }\n\n/**\n * Merges meta tags from the source HTML head into the destination HTML head.\n * Existing meta tags with matching property attributes are replaced; others are appended.\n * @param destination - The base HTML string to merge into.\n * @param source - The HTML string whose head meta tags will be merged.\n * @returns The merged HTML string.\n */\nexport const mergeDocumentHead = (destination: string, source: string) => {\n const $destination = load(destination, opts)\n const $source = load(source, opts)\n\n // For each child node of the source head\n $source('head')\n .children()\n .each((_, element) => {\n const el = $destination(element)\n\n // Special case for meta tags: We want to match them by the name attribute\n if (el[0].tagName === 'meta') {\n const property = el.attr('property')\n if (isString(property)) {\n const match = $destination(`head meta[property=\"${property}\"]`)\n\n // If it exists, replace it, otherwise append it\n if (match.length > 0) {\n match.replaceWith(el)\n return\n } else {\n $destination('head').append(el)\n }\n }\n // else {\n // // For all other elements, just check if the same element exists in the first HTML string\n // const match = $destination(el[0].tagName)\n\n // // If it exists, replace it, otherwise append it\n // if (match.length > 0) {\n // match.replaceWith(el)\n // } else {\n // $destination('head').append(el)\n // }\n // }\n }\n })\n\n // Return the merged HTML\n return $destination.html(opts)\n}\n","import { isString } from '@xylabs/typeof'\n\n/** An object with string keys and arbitrary values, used for recursive meta flattening. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type StringIndexable = { [key: string]: any }\n\nconst propertyDelimiter = ':'\n\n/**\n * Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.\n * @param obj - The nested object to flatten.\n * @param parentKey - The accumulated key prefix from parent levels.\n * @returns A flat record mapping colon-delimited property names to string values.\n */\nexport const getMetaAsDict = (obj: StringIndexable, parentKey?: string): Record<string, string> => {\n let flatRecord: StringIndexable = {}\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null) {\n // If the value is another object, we want to iterate through its keys as well.\n const childRecord = getMetaAsDict(obj[key] as StringIndexable, `${isString(parentKey) ? parentKey : ''}${key}${propertyDelimiter}`)\n flatRecord = { ...flatRecord, ...childRecord }\n } else {\n // Concatenate the key with its parent key.\n const newKey = isString(parentKey) ? `${parentKey}${key}` : key\n const trimmed = newKey.endsWith(propertyDelimiter) ? newKey.slice(0, -1) : newKey\n flatRecord[trimmed] = `${obj[key]}`\n }\n }\n return flatRecord\n}\n","import { isString } from '@xylabs/typeof'\nimport type { CheerioAPI } from 'cheerio'\nimport { load } from 'cheerio'\n\nimport { getMetaAsDict } from '../lib/index.ts'\nimport type { Meta } from '../models/index.ts'\n\n/* test change */\n\n/**\n * Adds or replaces a meta tag in the document head.\n * @param $ - The Cheerio API instance for the document.\n * @param name - The meta property name.\n * @param value - The meta content value (string, array, or nested object).\n */\nexport const addMetaToHead = ($: CheerioAPI, name: string, value: string | object) => {\n if (typeof value === 'string') {\n const newMeta = `<meta property=\"${name}\" content=\"${value}\" />`\n const existingMeta = $(`head meta[property=\"${name}\"]`)\n if ((existingMeta?.length ?? 0) > 0) {\n existingMeta.replaceWith(newMeta)\n } else {\n $('head').append(newMeta)\n }\n } else if (Array.isArray(value)) {\n for (const item of value) addMetaToHead($, `${name}`, item)\n } else if (typeof value === 'object') {\n for (let [key, v] of Object.entries(value)) {\n if (key === 'url') {\n addMetaToHead($, name, v)\n } else {\n addMetaToHead($, `${name}:${key}`, v)\n }\n }\n } else {\n throw new TypeError(`Invalid item type [${name}, ${typeof value}]`)\n }\n}\n\n/**\n * Injects meta properties, title, and description into an HTML string.\n * @param html - The base HTML string to modify.\n * @param meta - The metadata to inject.\n * @param handler - Optional meta-handler property value to include.\n * @returns The modified HTML string with injected metadata.\n */\nexport const metaBuilder = (html: string, meta: Meta, handler?: string) => {\n const $ = load(html)\n // NOTE: This assumes unique meta properties (no duplicates)\n // which is generally the case, but not always (you can have\n // multiple og:video:tag tags, for example)\n const metaProperties = getMetaAsDict(meta)\n for (const [key, value] of Object.entries(metaProperties)) {\n addMetaToHead($, key, value)\n }\n if (isString(meta.description)) {\n addMetaToHead($, 'description', meta.description)\n }\n if (isString(meta.title)) {\n $('title').text(meta.title)\n }\n if (isString(handler)) {\n addMetaToHead($, 'meta-handler', handler)\n }\n return $.html()\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,IAAM,OAAO,CAAC;AAUP,IAAM,oBAAoB,CAAC,aAAqB,WAAmB;AACxE,QAAM,eAAe,KAAK,aAAa,IAAI;AAC3C,QAAM,UAAU,KAAK,QAAQ,IAAI;AAGjC,UAAQ,MAAM,EACX,SAAS,EACT,KAAK,CAAC,GAAG,YAAY;AACpB,UAAM,KAAK,aAAa,OAAO;AAG/B,QAAI,GAAG,CAAC,EAAE,YAAY,QAAQ;AAC5B,YAAM,WAAW,GAAG,KAAK,UAAU;AACnC,UAAI,SAAS,QAAQ,GAAG;AACtB,cAAM,QAAQ,aAAa,uBAAuB,QAAQ,IAAI;AAG9D,YAAI,MAAM,SAAS,GAAG;AACpB,gBAAM,YAAY,EAAE;AACpB;AAAA,QACF,OAAO;AACL,uBAAa,MAAM,EAAE,OAAO,EAAE;AAAA,QAChC;AAAA,MACF;AAAA,IAYF;AAAA,EACF,CAAC;AAGH,SAAO,aAAa,KAAK,IAAI;AAC/B;;;ACrDA,SAAS,YAAAA,iBAAgB;AAMzB,IAAM,oBAAoB;AAQnB,IAAM,gBAAgB,CAAC,KAAsB,cAA+C;AACjG,MAAI,aAA8B,CAAC;AACnC,aAAW,OAAO,KAAK;AACrB,QAAI,OAAO,IAAI,GAAG,MAAM,YAAY,IAAI,GAAG,MAAM,MAAM;AAErD,YAAM,cAAc,cAAc,IAAI,GAAG,GAA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MAAK,IAAI;AAInB,QAAM,iBAAiB,cAAc,IAAI;AACzC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,cAAc,GAAG;AACzD,kBAAc,GAAG,KAAK,KAAK;AAAA,EAC7B;AACA,MAAIC,UAAS,KAAK,WAAW,GAAG;AAC9B,kBAAc,GAAG,eAAe,KAAK,WAAW;AAAA,EAClD;AACA,MAAIA,UAAS,KAAK,KAAK,GAAG;AACxB,MAAE,OAAO,EAAE,KAAK,KAAK,KAAK;AAAA,EAC5B;AACA,MAAIA,UAAS,OAAO,GAAG;AACrB,kBAAc,GAAG,gBAAgB,OAAO;AAAA,EAC1C;AACA,SAAO,EAAE,KAAK;AAChB;","names":["isString","isString","load","load","isString"]}
@@ -1,5 +1,12 @@
1
+ /** An object with string keys and arbitrary values, used for recursive meta flattening. */
1
2
  export type StringIndexable = {
2
3
  [key: string]: any;
3
4
  };
5
+ /**
6
+ * Recursively flattens a nested meta object into a flat dictionary with colon-delimited keys.
7
+ * @param obj - The nested object to flatten.
8
+ * @param parentKey - The accumulated key prefix from parent levels.
9
+ * @returns A flat record mapping colon-delimited property names to string values.
10
+ */
4
11
  export declare const getMetaAsDict: (obj: StringIndexable, parentKey?: string) => Record<string, string>;
5
12
  //# sourceMappingURL=getMetaAsDict.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getMetaAsDict.d.ts","sourceRoot":"","sources":["../../../src/lib/getMetaAsDict.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAIpD,eAAO,MAAM,aAAa,GAAI,KAAK,eAAe,EAAE,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAe7F,CAAA"}
1
+ {"version":3,"file":"getMetaAsDict.d.ts","sourceRoot":"","sources":["../../../src/lib/getMetaAsDict.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAE3F,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAIpD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,eAAe,EAAE,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAe7F,CAAA"}
@@ -1,5 +1,18 @@
1
1
  import type { CheerioAPI } from 'cheerio';
2
2
  import type { Meta } from '../models/index.ts';
3
+ /**
4
+ * Adds or replaces a meta tag in the document head.
5
+ * @param $ - The Cheerio API instance for the document.
6
+ * @param name - The meta property name.
7
+ * @param value - The meta content value (string, array, or nested object).
8
+ */
3
9
  export declare const addMetaToHead: ($: CheerioAPI, name: string, value: string | object) => void;
10
+ /**
11
+ * Injects meta properties, title, and description into an HTML string.
12
+ * @param html - The base HTML string to modify.
13
+ * @param meta - The metadata to inject.
14
+ * @param handler - Optional meta-handler property value to include.
15
+ * @returns The modified HTML string with injected metadata.
16
+ */
4
17
  export declare const metaBuilder: (html: string, meta: Meta, handler?: string) => string;
5
18
  //# sourceMappingURL=builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/meta/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI9C,eAAO,MAAM,aAAa,GAAI,GAAG,UAAU,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,GAAG,MAAM,SAsBhF,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,MAAM,IAAI,EAAE,UAAU,MAAM,WAmBrE,CAAA"}
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/meta/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI9C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,UAAU,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,GAAG,MAAM,SAsBhF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,MAAM,IAAI,EAAE,UAAU,MAAM,WAmBrE,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import type { OpenGraphMeta } from './OpenGraph/index.ts';
2
2
  import type { TwitterMeta } from './Twitter/index.ts';
3
+ /** Represents page metadata including Open Graph and Twitter card properties. */
3
4
  export interface Meta {
4
5
  description?: string;
5
6
  og?: OpenGraphMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../../../src/models/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,WAAW,IAAI;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB"}
1
+ {"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../../../src/models/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB"}
@@ -1,4 +1,5 @@
1
1
  import type { OpenGraphStructuredProperty } from './OpenGraphStructuredProperty.ts';
2
+ /** Open Graph protocol metadata for rich link previews. */
2
3
  export interface OpenGraphMeta {
3
4
  audio?: OpenGraphStructuredProperty;
4
5
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenGraphMeta.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC"}
1
+ {"version":3,"file":"OpenGraphMeta.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,2BAA2B,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC"}
@@ -1,3 +1,4 @@
1
+ /** Structured properties for an Open Graph media object (image, video, or audio). */
1
2
  export interface OpenGraphStructured {
2
3
  ''?: string;
3
4
  'alt'?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenGraphStructured.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructured.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
1
+ {"version":3,"file":"OpenGraphStructured.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructured.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -1,3 +1,4 @@
1
1
  import type { OpenGraphStructured } from './OpenGraphStructured.ts';
2
+ /** A structured Open Graph property value: a URL string, a structured object, or an array of either. */
2
3
  export type OpenGraphStructuredProperty = string | OpenGraphStructured | (string | OpenGraphStructured)[];
3
4
  //# sourceMappingURL=OpenGraphStructuredProperty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenGraphStructuredProperty.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructuredProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,CAAA"}
1
+ {"version":3,"file":"OpenGraphStructuredProperty.d.ts","sourceRoot":"","sources":["../../../../src/models/OpenGraph/OpenGraphStructuredProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,wGAAwG;AACxG,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** Twitter App Card metadata containing app store identifiers, names, and URLs per platform. */
1
2
  export interface TwitterApp {
2
3
  id?: {
3
4
  googleplay?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TwitterApp.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/TwitterApp.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
1
+ {"version":3,"file":"TwitterApp.d.ts","sourceRoot":"","sources":["../../../../src/models/Twitter/TwitterApp.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/sdk-meta",
3
- "version": "5.0.83",
3
+ "version": "5.0.86",
4
4
  "description": "Base functionality used throughout XYO TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "meta",
@@ -37,13 +37,13 @@
37
37
  "!**/*.test.*"
38
38
  ],
39
39
  "dependencies": {
40
- "@xylabs/typeof": "~5.0.83",
40
+ "@xylabs/typeof": "~5.0.86",
41
41
  "cheerio": "~1.2.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "~25.4.0",
45
- "@xylabs/ts-scripts-yarn3": "~7.4.11",
46
- "@xylabs/tsconfig": "~7.4.11",
45
+ "@xylabs/ts-scripts-yarn3": "~7.4.16",
46
+ "@xylabs/tsconfig": "~7.4.16",
47
47
  "typescript": "~5.9.3",
48
48
  "vitest": "~4.0.18"
49
49
  },