5etools-utils 0.9.14 → 0.9.16

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/lib/UtilClean.js CHANGED
@@ -3,12 +3,14 @@ const _CLEAN_JSON_REPLACEMENTS = {
3
3
  "–": "\\u2013",
4
4
  "‑": "\\u2011",
5
5
  "−": "\\u2212",
6
- "": `\\"`,
7
- "”": `\\"`,
6
+ " ": "\\u00A0",
7
+
8
8
  "’": "'",
9
9
  "‘": "'",
10
+ "’": "'",
10
11
  "…": "...",
11
- " ": "\\u00A0",
12
+ "\u200B": "", // zero-width space
13
+ "\u2002": " ", // em space
12
14
  "ff": "ff",
13
15
  "ffi": "ffi",
14
16
  "ffl": "ffl",
@@ -23,6 +25,9 @@ const _CLEAN_JSON_REPLACEMENTS = {
23
25
  "Nj": "Nj",
24
26
  "nj": "nj",
25
27
  "ſt": "ft",
28
+ "“": `"`,
29
+ "”": `"`,
30
+ "\u201a": ",",
26
31
  };
27
32
  const _CLEAN_JSON_REPLACEMENT_REGEX = new RegExp(Object.keys(_CLEAN_JSON_REPLACEMENTS).join("|"), "g");
28
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "1.21.19",
3
+ "version": "1.21.20",
4
4
  "title": "Bestiary Schema",
5
5
  "$id": "bestiary.json",
6
6
  "type": "object",
@@ -1125,13 +1125,14 @@
1125
1125
  "miscTags": {
1126
1126
  "type": "array",
1127
1127
  "items": {
1128
- "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
1128
+ "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n MLW: Has Melee Weapons\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
1129
1129
  "enum": [
1130
1130
  "AOE",
1131
1131
  "HPR",
1132
1132
  "MW",
1133
1133
  "RW",
1134
1134
  "RCH",
1135
+ "MLW",
1135
1136
  "RNG",
1136
1137
  "THW"
1137
1138
  ]
@@ -2306,13 +2307,14 @@
2306
2307
  "miscTags": {
2307
2308
  "type": "array",
2308
2309
  "items": {
2309
- "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
2310
+ "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n MLW: Has Melee Weapons\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
2310
2311
  "enum": [
2311
2312
  "AOE",
2312
2313
  "HPR",
2313
2314
  "MW",
2314
2315
  "RW",
2315
2316
  "RCH",
2317
+ "MLW",
2316
2318
  "RNG",
2317
2319
  "THW"
2318
2320
  ]
@@ -3501,13 +3503,14 @@
3501
3503
  "miscTags": {
3502
3504
  "type": "array",
3503
3505
  "items": {
3504
- "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
3506
+ "description": "AOE: Has Areas of Effect\n HPR: Has HP Reduction\n MW: Has Weapon Attacks, Melee\n RW: Has Weapon Attacks, Ranged\n RCH: Has Reach Attacks\n MLW: Has Melee Weapons\n RNG: Has Ranged Weapons\n THW: Has Thrown Weapons",
3505
3507
  "enum": [
3506
3508
  "AOE",
3507
3509
  "HPR",
3508
3510
  "MW",
3509
3511
  "RW",
3510
3512
  "RCH",
3513
+ "MLW",
3511
3514
  "RNG",
3512
3515
  "THW"
3513
3516
  ]
@@ -1,41 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "fluff-recipes.json",
4
- "version": "1.1.2",
4
+ "version": "1.2.0",
5
5
  "type": "object",
6
6
  "properties": {
7
+ "_meta": {
8
+ "$ref": "util.json#/$defs/metaBlock"
9
+ },
7
10
  "recipeFluff": {
8
- "type": "array",
9
- "minItems": 1,
10
- "uniqueItems": true,
11
- "items": {
12
- "type": "object",
13
- "properties": {
14
- "name": {
15
- "type": "string"
16
- },
17
- "source": {
18
- "$ref": "util.json#/$defs/source"
19
- },
20
- "images": {
21
- "type": "array",
22
- "items": {
23
- "$ref": "entry.json#/$defs/entryImage"
24
- }
25
- },
26
- "entries": {
27
- "type": "array",
28
- "items": {
29
- "$ref": "entry.json"
30
- }
31
- }
32
- },
33
- "required": [
34
- "name",
35
- "source"
36
- ],
37
- "additionalProperties": false
38
- }
11
+ "$ref": "util.json#/$defs/genericFluffArray"
39
12
  }
40
13
  },
41
14
  "additionalProperties": false
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "recipes.json",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "type": "object",
6
6
  "$defs": {
7
- "recipe": {
7
+ "recipeData": {
8
8
  "type": "object",
9
9
  "properties": {
10
10
  "name": {
@@ -19,6 +19,9 @@
19
19
  "time": {
20
20
  "type": "object",
21
21
  "properties": {
22
+ "total": {
23
+ "$ref": "util-time.json#/$defs/timeMinutes"
24
+ },
22
25
  "cooking": {
23
26
  "$ref": "util-time.json#/$defs/timeMinutes"
24
27
  },
@@ -178,16 +181,450 @@
178
181
  "$ref": "util.json#/$defs/foundryImg"
179
182
  }
180
183
  },
181
- "required": [
182
- "name",
183
- "source",
184
- "instructions",
185
- "ingredients"
186
- ],
187
184
  "additionalProperties": false
185
+ },
186
+ "recipe": {
187
+ "anyOf": [
188
+ {
189
+ "type": "object",
190
+ "properties": {
191
+ "name": {
192
+ "type": "string"
193
+ },
194
+ "source": {
195
+ "$ref": "util.json#/$defs/source"
196
+ },
197
+ "page": {
198
+ "$ref": "util.json#/$defs/page"
199
+ },
200
+ "time": {
201
+ "type": "object",
202
+ "properties": {
203
+ "total": {
204
+ "$ref": "util-time.json#/$defs/timeMinutes"
205
+ },
206
+ "cooking": {
207
+ "$ref": "util-time.json#/$defs/timeMinutes"
208
+ },
209
+ "preparation": {
210
+ "$ref": "util-time.json#/$defs/timeMinutes"
211
+ }
212
+ },
213
+ "additionalProperties": false,
214
+ "minProperties": 1
215
+ },
216
+ "serves": {
217
+ "oneOf": [
218
+ {
219
+ "type": "object",
220
+ "properties": {
221
+ "min": {
222
+ "type": "integer"
223
+ },
224
+ "max": {
225
+ "type": "integer"
226
+ },
227
+ "note": {
228
+ "$ref": "entry.json"
229
+ }
230
+ },
231
+ "required": [
232
+ "min",
233
+ "max"
234
+ ],
235
+ "additionalProperties": false
236
+ },
237
+ {
238
+ "type": "object",
239
+ "properties": {
240
+ "exact": {
241
+ "type": "integer"
242
+ },
243
+ "note": {
244
+ "$ref": "entry.json"
245
+ }
246
+ },
247
+ "required": [
248
+ "exact"
249
+ ],
250
+ "additionalProperties": false
251
+ }
252
+ ]
253
+ },
254
+ "makes": {
255
+ "$ref": "entry.json"
256
+ },
257
+ "ingredients": {
258
+ "type": "array",
259
+ "items": {
260
+ "$ref": "entry.json"
261
+ }
262
+ },
263
+ "equipment": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "entry.json"
267
+ }
268
+ },
269
+ "instructions": {
270
+ "type": "array",
271
+ "items": {
272
+ "$ref": "entry.json"
273
+ }
274
+ },
275
+ "noteCook": {
276
+ "type": "array",
277
+ "items": {
278
+ "$ref": "entry.json"
279
+ }
280
+ },
281
+ "type": {
282
+ "type": "string",
283
+ "examples": [
284
+ "Dwarven",
285
+ "Elven",
286
+ "Elixir/Ale",
287
+ "Human",
288
+ "Halfling",
289
+ "Uncommon Cuisine"
290
+ ]
291
+ },
292
+ "diet": {
293
+ "type": "string",
294
+ "description": "C: Vegetarian [aka \"cheese\"]\n V: Vegan\n X: Omnivorous",
295
+ "enum": [
296
+ "C",
297
+ "V",
298
+ "X"
299
+ ]
300
+ },
301
+ "miscTags": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "string",
305
+ "enum": [
306
+ "alcohol"
307
+ ]
308
+ }
309
+ },
310
+ "allergenGroups": {
311
+ "type": "array",
312
+ "description": "One of the 14 major food allergens; see https://erudus.com/food-allergens for more information.",
313
+ "items": {
314
+ "type": "string",
315
+ "enum": [
316
+ "celery",
317
+ "crustaceans",
318
+ "eggs",
319
+ "fish",
320
+ "gluten",
321
+ "lupin",
322
+ "milk",
323
+ "molluscs",
324
+ "mustard",
325
+ "nuts",
326
+ "peanuts",
327
+ "sesame",
328
+ "soya",
329
+ "sulphites"
330
+ ]
331
+ }
332
+ },
333
+ "dishTypes": {
334
+ "type": "array",
335
+ "items": {
336
+ "type": "string",
337
+ "examples": [
338
+ "appetizer",
339
+ "bread",
340
+ "cocktail",
341
+ "dessert",
342
+ "drink",
343
+ "entree",
344
+ "pastry",
345
+ "salad",
346
+ "side",
347
+ "snack",
348
+ "soup"
349
+ ]
350
+ }
351
+ },
352
+ "hasFluff": {
353
+ "type": "boolean"
354
+ },
355
+ "hasFluffImages": {
356
+ "type": "boolean"
357
+ },
358
+ "fluff": {
359
+ "$ref": "util.json#/$defs/fluffObject"
360
+ },
361
+ "foundryImg": {
362
+ "$ref": "util.json#/$defs/foundryImg"
363
+ }
364
+ },
365
+ "additionalProperties": false,
366
+ "required": [
367
+ "name",
368
+ "source",
369
+ "instructions",
370
+ "ingredients"
371
+ ]
372
+ },
373
+ {
374
+ "type": "object",
375
+ "properties": {
376
+ "name": {
377
+ "type": "string"
378
+ },
379
+ "source": {
380
+ "$ref": "util.json#/$defs/source"
381
+ },
382
+ "page": {
383
+ "$ref": "util.json#/$defs/page"
384
+ },
385
+ "time": {
386
+ "type": "object",
387
+ "properties": {
388
+ "total": {
389
+ "$ref": "util-time.json#/$defs/timeMinutes"
390
+ },
391
+ "cooking": {
392
+ "$ref": "util-time.json#/$defs/timeMinutes"
393
+ },
394
+ "preparation": {
395
+ "$ref": "util-time.json#/$defs/timeMinutes"
396
+ }
397
+ },
398
+ "additionalProperties": false,
399
+ "minProperties": 1
400
+ },
401
+ "serves": {
402
+ "oneOf": [
403
+ {
404
+ "type": "object",
405
+ "properties": {
406
+ "min": {
407
+ "type": "integer"
408
+ },
409
+ "max": {
410
+ "type": "integer"
411
+ },
412
+ "note": {
413
+ "$ref": "entry.json"
414
+ }
415
+ },
416
+ "required": [
417
+ "min",
418
+ "max"
419
+ ],
420
+ "additionalProperties": false
421
+ },
422
+ {
423
+ "type": "object",
424
+ "properties": {
425
+ "exact": {
426
+ "type": "integer"
427
+ },
428
+ "note": {
429
+ "$ref": "entry.json"
430
+ }
431
+ },
432
+ "required": [
433
+ "exact"
434
+ ],
435
+ "additionalProperties": false
436
+ }
437
+ ]
438
+ },
439
+ "makes": {
440
+ "$ref": "entry.json"
441
+ },
442
+ "ingredients": {
443
+ "type": "array",
444
+ "items": {
445
+ "$ref": "entry.json"
446
+ }
447
+ },
448
+ "equipment": {
449
+ "type": "array",
450
+ "items": {
451
+ "$ref": "entry.json"
452
+ }
453
+ },
454
+ "instructions": {
455
+ "type": "array",
456
+ "items": {
457
+ "$ref": "entry.json"
458
+ }
459
+ },
460
+ "noteCook": {
461
+ "type": "array",
462
+ "items": {
463
+ "$ref": "entry.json"
464
+ }
465
+ },
466
+ "type": {
467
+ "type": "string",
468
+ "examples": [
469
+ "Dwarven",
470
+ "Elven",
471
+ "Elixir/Ale",
472
+ "Human",
473
+ "Halfling",
474
+ "Uncommon Cuisine"
475
+ ]
476
+ },
477
+ "diet": {
478
+ "type": "string",
479
+ "description": "C: Vegetarian [aka \"cheese\"]\n V: Vegan\n X: Omnivorous",
480
+ "enum": [
481
+ "C",
482
+ "V",
483
+ "X"
484
+ ]
485
+ },
486
+ "miscTags": {
487
+ "type": "array",
488
+ "items": {
489
+ "type": "string",
490
+ "enum": [
491
+ "alcohol"
492
+ ]
493
+ }
494
+ },
495
+ "allergenGroups": {
496
+ "type": "array",
497
+ "description": "One of the 14 major food allergens; see https://erudus.com/food-allergens for more information.",
498
+ "items": {
499
+ "type": "string",
500
+ "enum": [
501
+ "celery",
502
+ "crustaceans",
503
+ "eggs",
504
+ "fish",
505
+ "gluten",
506
+ "lupin",
507
+ "milk",
508
+ "molluscs",
509
+ "mustard",
510
+ "nuts",
511
+ "peanuts",
512
+ "sesame",
513
+ "soya",
514
+ "sulphites"
515
+ ]
516
+ }
517
+ },
518
+ "dishTypes": {
519
+ "type": "array",
520
+ "items": {
521
+ "type": "string",
522
+ "examples": [
523
+ "appetizer",
524
+ "bread",
525
+ "cocktail",
526
+ "dessert",
527
+ "drink",
528
+ "entree",
529
+ "pastry",
530
+ "salad",
531
+ "side",
532
+ "snack",
533
+ "soup"
534
+ ]
535
+ }
536
+ },
537
+ "hasFluff": {
538
+ "type": "boolean"
539
+ },
540
+ "hasFluffImages": {
541
+ "type": "boolean"
542
+ },
543
+ "fluff": {
544
+ "$ref": "util.json#/$defs/fluffObject"
545
+ },
546
+ "foundryImg": {
547
+ "$ref": "util.json#/$defs/foundryImg"
548
+ },
549
+ "_copy": {
550
+ "type": "object",
551
+ "properties": {
552
+ "name": {
553
+ "type": "string"
554
+ },
555
+ "source": {
556
+ "$ref": "util.json#/$defs/source"
557
+ },
558
+ "pantheon": {
559
+ "description": "Used in deity data",
560
+ "type": "string"
561
+ },
562
+ "shortName": {
563
+ "description": "Used in subclass data",
564
+ "type": "string"
565
+ },
566
+ "className": {
567
+ "description": "Used in subclass data",
568
+ "type": "string"
569
+ },
570
+ "classSource": {
571
+ "description": "Used in subclass data",
572
+ "$ref": "util.json#/$defs/source"
573
+ },
574
+ "raceName": {
575
+ "description": "Used in race feature data",
576
+ "type": "string"
577
+ },
578
+ "raceSource": {
579
+ "description": "Used in race feature data",
580
+ "$ref": "util.json#/$defs/source"
581
+ },
582
+ "_mod": {
583
+ "$ref": "util.json#/$defs/_modObject"
584
+ },
585
+ "_trait": {
586
+ "type": "object",
587
+ "properties": {
588
+ "name": {
589
+ "type": "string"
590
+ },
591
+ "source": {
592
+ "$ref": "util.json#/$defs/source"
593
+ }
594
+ },
595
+ "required": [
596
+ "name",
597
+ "source"
598
+ ]
599
+ },
600
+ "_preserve": {
601
+ "type": "object",
602
+ "patternProperties": {
603
+ ".*": {
604
+ "const": true
605
+ }
606
+ }
607
+ }
608
+ },
609
+ "required": [
610
+ "name",
611
+ "source"
612
+ ],
613
+ "additionalProperties": false
614
+ }
615
+ },
616
+ "additionalProperties": false,
617
+ "required": [
618
+ "_copy"
619
+ ]
620
+ }
621
+ ]
188
622
  }
189
623
  },
190
624
  "properties": {
625
+ "_meta": {
626
+ "$ref": "util.json#/$defs/metaBlock"
627
+ },
191
628
  "recipe": {
192
629
  "type": "array",
193
630
  "uniqueItems": true,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "spells.json",
4
- "version": "1.9.7",
4
+ "version": "1.9.8",
5
5
  "title": "Spells",
6
6
  "type": "object",
7
7
  "$defs": {
@@ -278,13 +278,14 @@
278
278
  },
279
279
  "miscTags": {
280
280
  "type": "array",
281
- "description": "AAD: Additional Attack Damage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
281
+ "description": "AAD: Additional Attack Damage\n ADV: Grants Advantage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
282
282
  "minItems": 1,
283
283
  "uniqueItems": true,
284
284
  "items": {
285
285
  "type": "string",
286
286
  "enum": [
287
287
  "AAD",
288
+ "ADV",
288
289
  "DFT",
289
290
  "FMV",
290
291
  "HL",
@@ -823,13 +824,14 @@
823
824
  },
824
825
  "miscTags": {
825
826
  "type": "array",
826
- "description": "AAD: Additional Attack Damage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
827
+ "description": "AAD: Additional Attack Damage\n ADV: Grants Advantage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
827
828
  "minItems": 1,
828
829
  "uniqueItems": true,
829
830
  "items": {
830
831
  "type": "string",
831
832
  "enum": [
832
833
  "AAD",
834
+ "ADV",
833
835
  "DFT",
834
836
  "FMV",
835
837
  "HL",
@@ -1376,13 +1378,14 @@
1376
1378
  },
1377
1379
  "miscTags": {
1378
1380
  "type": "array",
1379
- "description": "AAD: Additional Attack Damage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
1381
+ "description": "AAD: Additional Attack Damage\n ADV: Grants Advantage\n DFT: Difficult Terrain\n FMV: Forced Movement\n HL: Healing\n LGT: Creates Light\n LGTS: Creates Sunlight\n MAC: Modifies AC\n OBJ: Affects Objects\n OBS: Obscures Vision\n PRM: Permanent Effects\n PS: Plane Shifting\nRO: Rollable Effects\n SCL: Scaling Effects\n SMN: Summons Creature\n SGT: Requires Sight\n THP: Grants Temporary Hit Points\n TP: Teleportation\n UBA: Uses Bonus Action",
1380
1382
  "minItems": 1,
1381
1383
  "uniqueItems": true,
1382
1384
  "items": {
1383
1385
  "type": "string",
1384
1386
  "enum": [
1385
1387
  "AAD",
1388
+ "ADV",
1386
1389
  "DFT",
1387
1390
  "FMV",
1388
1391
  "HL",