5etools-utils 0.9.66 → 0.10.1

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/TestJson.js CHANGED
@@ -90,21 +90,6 @@ class JsonTester {
90
90
  this._isSchemaLoaded = false;
91
91
  }
92
92
 
93
- /**
94
- * Add any implicit data to the JSON
95
- */
96
- _addImplicits (obj, lastKey) {
97
- if (typeof obj !== "object") return;
98
- if (obj == null) return;
99
- if (obj instanceof Array) obj.forEach(it => this._addImplicits(it, lastKey));
100
- else {
101
- // "obj.mode" will be set if this is in a "_copy" etc. block
102
- if (lastKey === "spellcasting" && !obj.mode) obj.type = obj.type || "spellcasting";
103
-
104
- Object.entries(obj).forEach(([k, v]) => this._addImplicits(v, k));
105
- }
106
- }
107
-
108
93
  _getFileErrors ({filePath}) { return `${filePath}\n${JSON.stringify(this._ajv.errors, null, 2)}`; }
109
94
 
110
95
  _getErrors ({filePath, data}) {
@@ -183,7 +168,6 @@ class JsonTester {
183
168
  Um.info(this._tagLog, `\tValidating "${filePath}"...`);
184
169
 
185
170
  const data = Uf.readJsonSync(filePath);
186
- this._addImplicits(data);
187
171
 
188
172
  const isValid = this._ajv.validate(this._fnGetSchemaId(filePath), data);
189
173
  if (isValid) return {errors: [], errorsFull: []};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.9.66",
3
+ "version": "0.10.1",
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.24",
3
+ "version": "1.21.25",
4
4
  "title": "Bestiary Schema",
5
5
  "$id": "bestiary.json",
6
6
  "type": "object",
@@ -313,6 +313,9 @@
313
313
  "type": "string"
314
314
  }
315
315
  },
316
+ "required": [
317
+ "special"
318
+ ],
316
319
  "additionalProperties": false
317
320
  }
318
321
  ]
@@ -364,7 +367,8 @@
364
367
  "$ref": "../entry.json"
365
368
  }
366
369
  },
367
- "additionalProperties": false
370
+ "additionalProperties": false,
371
+ "minProperties": 1
368
372
  },
369
373
  "skill": {
370
374
  "type": "object",
@@ -495,7 +499,8 @@
495
499
  "$ref": "../entry.json"
496
500
  }
497
501
  },
498
- "additionalProperties": false
502
+ "additionalProperties": false,
503
+ "minProperties": 1
499
504
  },
500
505
  "senses": {
501
506
  "oneOf": [
@@ -503,7 +508,8 @@
503
508
  "type": "array",
504
509
  "items": {
505
510
  "type": "string"
506
- }
511
+ },
512
+ "minItems": 1
507
513
  },
508
514
  {
509
515
  "type": "null"
@@ -1249,7 +1255,8 @@
1249
1255
  }
1250
1256
  }
1251
1257
  },
1252
- "additionalProperties": false
1258
+ "additionalProperties": false,
1259
+ "minProperties": 1
1253
1260
  }
1254
1261
  ]
1255
1262
  },
@@ -1473,6 +1480,9 @@
1473
1480
  "type": "string"
1474
1481
  }
1475
1482
  },
1483
+ "required": [
1484
+ "special"
1485
+ ],
1476
1486
  "additionalProperties": false
1477
1487
  }
1478
1488
  ]
@@ -1524,7 +1534,8 @@
1524
1534
  "$ref": "../entry.json"
1525
1535
  }
1526
1536
  },
1527
- "additionalProperties": false
1537
+ "additionalProperties": false,
1538
+ "minProperties": 1
1528
1539
  },
1529
1540
  "skill": {
1530
1541
  "type": "object",
@@ -1655,7 +1666,8 @@
1655
1666
  "$ref": "../entry.json"
1656
1667
  }
1657
1668
  },
1658
- "additionalProperties": false
1669
+ "additionalProperties": false,
1670
+ "minProperties": 1
1659
1671
  },
1660
1672
  "senses": {
1661
1673
  "oneOf": [
@@ -1663,7 +1675,8 @@
1663
1675
  "type": "array",
1664
1676
  "items": {
1665
1677
  "type": "string"
1666
- }
1678
+ },
1679
+ "minItems": 1
1667
1680
  },
1668
1681
  {
1669
1682
  "type": "null"
@@ -2409,7 +2422,8 @@
2409
2422
  }
2410
2423
  }
2411
2424
  },
2412
- "additionalProperties": false
2425
+ "additionalProperties": false,
2426
+ "minProperties": 1
2413
2427
  }
2414
2428
  ]
2415
2429
  },
@@ -2638,6 +2652,9 @@
2638
2652
  "type": "string"
2639
2653
  }
2640
2654
  },
2655
+ "required": [
2656
+ "special"
2657
+ ],
2641
2658
  "additionalProperties": false
2642
2659
  }
2643
2660
  ]
@@ -2689,7 +2706,8 @@
2689
2706
  "$ref": "../entry.json"
2690
2707
  }
2691
2708
  },
2692
- "additionalProperties": false
2709
+ "additionalProperties": false,
2710
+ "minProperties": 1
2693
2711
  },
2694
2712
  "skill": {
2695
2713
  "type": "object",
@@ -2820,7 +2838,8 @@
2820
2838
  "$ref": "../entry.json"
2821
2839
  }
2822
2840
  },
2823
- "additionalProperties": false
2841
+ "additionalProperties": false,
2842
+ "minProperties": 1
2824
2843
  },
2825
2844
  "senses": {
2826
2845
  "oneOf": [
@@ -2828,7 +2847,8 @@
2828
2847
  "type": "array",
2829
2848
  "items": {
2830
2849
  "type": "string"
2831
- }
2850
+ },
2851
+ "minItems": 1
2832
2852
  },
2833
2853
  {
2834
2854
  "type": "null"
@@ -3574,7 +3594,8 @@
3574
3594
  }
3575
3595
  }
3576
3596
  },
3577
- "additionalProperties": false
3597
+ "additionalProperties": false,
3598
+ "minProperties": 1
3578
3599
  }
3579
3600
  ]
3580
3601
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "items-base.json",
4
- "version": "1.5.18",
4
+ "version": "1.5.19",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "itemLookupBase": {
@@ -255,6 +255,14 @@
255
255
  "description": "Flag used when merging generic variants",
256
256
  "type": "boolean"
257
257
  },
258
+ "bulletSling": {
259
+ "description": "Flag used when merging generic variants",
260
+ "type": "boolean"
261
+ },
262
+ "needleBlowgun": {
263
+ "description": "Flag used when merging generic variants",
264
+ "type": "boolean"
265
+ },
258
266
  "weapon": {
259
267
  "description": "Flag used when merging generic variants",
260
268
  "type": "boolean"
@@ -589,6 +597,14 @@
589
597
  "description": "Flag used when merging generic variants",
590
598
  "type": "boolean"
591
599
  },
600
+ "bulletSling": {
601
+ "description": "Flag used when merging generic variants",
602
+ "type": "boolean"
603
+ },
604
+ "needleBlowgun": {
605
+ "description": "Flag used when merging generic variants",
606
+ "type": "boolean"
607
+ },
592
608
  "weapon": {
593
609
  "description": "Flag used when merging generic variants",
594
610
  "type": "boolean"
@@ -927,6 +943,14 @@
927
943
  "description": "Flag used when merging generic variants",
928
944
  "type": "boolean"
929
945
  },
946
+ "bulletSling": {
947
+ "description": "Flag used when merging generic variants",
948
+ "type": "boolean"
949
+ },
950
+ "needleBlowgun": {
951
+ "description": "Flag used when merging generic variants",
952
+ "type": "boolean"
953
+ },
930
954
  "weapon": {
931
955
  "description": "Flag used when merging generic variants",
932
956
  "type": "boolean"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "magicvariants.json",
4
- "version": "1.8.14",
4
+ "version": "1.8.15",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "_magicvariantItemBase": {
@@ -90,6 +90,12 @@
90
90
  "bolt": {
91
91
  "type": "boolean"
92
92
  },
93
+ "bulletSling": {
94
+ "type": "boolean"
95
+ },
96
+ "needleBlowgun": {
97
+ "type": "boolean"
98
+ },
93
99
  "weaponCategory": {
94
100
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
95
101
  },
@@ -451,6 +457,12 @@
451
457
  "bolt": {
452
458
  "type": "boolean"
453
459
  },
460
+ "bulletSling": {
461
+ "type": "boolean"
462
+ },
463
+ "needleBlowgun": {
464
+ "type": "boolean"
465
+ },
454
466
  "weaponCategory": {
455
467
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
456
468
  },
@@ -601,6 +613,12 @@
601
613
  "bolt": {
602
614
  "type": "boolean"
603
615
  },
616
+ "bulletSling": {
617
+ "type": "boolean"
618
+ },
619
+ "needleBlowgun": {
620
+ "type": "boolean"
621
+ },
604
622
  "weaponCategory": {
605
623
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
606
624
  },
@@ -967,6 +985,12 @@
967
985
  "bolt": {
968
986
  "type": "boolean"
969
987
  },
988
+ "bulletSling": {
989
+ "type": "boolean"
990
+ },
991
+ "needleBlowgun": {
992
+ "type": "boolean"
993
+ },
970
994
  "weaponCategory": {
971
995
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
972
996
  },
@@ -1121,6 +1145,12 @@
1121
1145
  "bolt": {
1122
1146
  "type": "boolean"
1123
1147
  },
1148
+ "bulletSling": {
1149
+ "type": "boolean"
1150
+ },
1151
+ "needleBlowgun": {
1152
+ "type": "boolean"
1153
+ },
1124
1154
  "weaponCategory": {
1125
1155
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1126
1156
  },
@@ -1486,6 +1516,12 @@
1486
1516
  "bolt": {
1487
1517
  "type": "boolean"
1488
1518
  },
1519
+ "bulletSling": {
1520
+ "type": "boolean"
1521
+ },
1522
+ "needleBlowgun": {
1523
+ "type": "boolean"
1524
+ },
1489
1525
  "weaponCategory": {
1490
1526
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1491
1527
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "1.21.24",
3
+ "version": "1.21.25",
4
4
  "title": "Bestiary Schema",
5
5
  "$id": "bestiary.json",
6
6
  "type": "object",
@@ -313,6 +313,9 @@
313
313
  "type": "string"
314
314
  }
315
315
  },
316
+ "required": [
317
+ "special"
318
+ ],
316
319
  "additionalProperties": false
317
320
  }
318
321
  ]
@@ -364,7 +367,8 @@
364
367
  "$ref": "../entry.json"
365
368
  }
366
369
  },
367
- "additionalProperties": false
370
+ "additionalProperties": false,
371
+ "minProperties": 1
368
372
  },
369
373
  "skill": {
370
374
  "type": "object",
@@ -495,7 +499,8 @@
495
499
  "$ref": "../entry.json"
496
500
  }
497
501
  },
498
- "additionalProperties": false
502
+ "additionalProperties": false,
503
+ "minProperties": 1
499
504
  },
500
505
  "senses": {
501
506
  "oneOf": [
@@ -503,7 +508,8 @@
503
508
  "type": "array",
504
509
  "items": {
505
510
  "type": "string"
506
- }
511
+ },
512
+ "minItems": 1
507
513
  },
508
514
  {
509
515
  "type": "null"
@@ -1249,7 +1255,8 @@
1249
1255
  }
1250
1256
  }
1251
1257
  },
1252
- "additionalProperties": false
1258
+ "additionalProperties": false,
1259
+ "minProperties": 1
1253
1260
  }
1254
1261
  ]
1255
1262
  },
@@ -1473,6 +1480,9 @@
1473
1480
  "type": "string"
1474
1481
  }
1475
1482
  },
1483
+ "required": [
1484
+ "special"
1485
+ ],
1476
1486
  "additionalProperties": false
1477
1487
  }
1478
1488
  ]
@@ -1524,7 +1534,8 @@
1524
1534
  "$ref": "../entry.json"
1525
1535
  }
1526
1536
  },
1527
- "additionalProperties": false
1537
+ "additionalProperties": false,
1538
+ "minProperties": 1
1528
1539
  },
1529
1540
  "skill": {
1530
1541
  "type": "object",
@@ -1655,7 +1666,8 @@
1655
1666
  "$ref": "../entry.json"
1656
1667
  }
1657
1668
  },
1658
- "additionalProperties": false
1669
+ "additionalProperties": false,
1670
+ "minProperties": 1
1659
1671
  },
1660
1672
  "senses": {
1661
1673
  "oneOf": [
@@ -1663,7 +1675,8 @@
1663
1675
  "type": "array",
1664
1676
  "items": {
1665
1677
  "type": "string"
1666
- }
1678
+ },
1679
+ "minItems": 1
1667
1680
  },
1668
1681
  {
1669
1682
  "type": "null"
@@ -2409,7 +2422,8 @@
2409
2422
  }
2410
2423
  }
2411
2424
  },
2412
- "additionalProperties": false
2425
+ "additionalProperties": false,
2426
+ "minProperties": 1
2413
2427
  }
2414
2428
  ]
2415
2429
  },
@@ -2638,6 +2652,9 @@
2638
2652
  "type": "string"
2639
2653
  }
2640
2654
  },
2655
+ "required": [
2656
+ "special"
2657
+ ],
2641
2658
  "additionalProperties": false
2642
2659
  }
2643
2660
  ]
@@ -2689,7 +2706,8 @@
2689
2706
  "$ref": "../entry.json"
2690
2707
  }
2691
2708
  },
2692
- "additionalProperties": false
2709
+ "additionalProperties": false,
2710
+ "minProperties": 1
2693
2711
  },
2694
2712
  "skill": {
2695
2713
  "type": "object",
@@ -2820,7 +2838,8 @@
2820
2838
  "$ref": "../entry.json"
2821
2839
  }
2822
2840
  },
2823
- "additionalProperties": false
2841
+ "additionalProperties": false,
2842
+ "minProperties": 1
2824
2843
  },
2825
2844
  "senses": {
2826
2845
  "oneOf": [
@@ -2828,7 +2847,8 @@
2828
2847
  "type": "array",
2829
2848
  "items": {
2830
2849
  "type": "string"
2831
- }
2850
+ },
2851
+ "minItems": 1
2832
2852
  },
2833
2853
  {
2834
2854
  "type": "null"
@@ -3574,7 +3594,8 @@
3574
3594
  }
3575
3595
  }
3576
3596
  },
3577
- "additionalProperties": false
3597
+ "additionalProperties": false,
3598
+ "minProperties": 1
3578
3599
  }
3579
3600
  ]
3580
3601
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "items-base.json",
4
- "version": "1.5.18",
4
+ "version": "1.5.19",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "itemLookupBase": {
@@ -255,6 +255,14 @@
255
255
  "description": "Flag used when merging generic variants",
256
256
  "type": "boolean"
257
257
  },
258
+ "bulletSling": {
259
+ "description": "Flag used when merging generic variants",
260
+ "type": "boolean"
261
+ },
262
+ "needleBlowgun": {
263
+ "description": "Flag used when merging generic variants",
264
+ "type": "boolean"
265
+ },
258
266
  "weapon": {
259
267
  "description": "Flag used when merging generic variants",
260
268
  "type": "boolean"
@@ -589,6 +597,14 @@
589
597
  "description": "Flag used when merging generic variants",
590
598
  "type": "boolean"
591
599
  },
600
+ "bulletSling": {
601
+ "description": "Flag used when merging generic variants",
602
+ "type": "boolean"
603
+ },
604
+ "needleBlowgun": {
605
+ "description": "Flag used when merging generic variants",
606
+ "type": "boolean"
607
+ },
592
608
  "weapon": {
593
609
  "description": "Flag used when merging generic variants",
594
610
  "type": "boolean"
@@ -927,6 +943,14 @@
927
943
  "description": "Flag used when merging generic variants",
928
944
  "type": "boolean"
929
945
  },
946
+ "bulletSling": {
947
+ "description": "Flag used when merging generic variants",
948
+ "type": "boolean"
949
+ },
950
+ "needleBlowgun": {
951
+ "description": "Flag used when merging generic variants",
952
+ "type": "boolean"
953
+ },
930
954
  "weapon": {
931
955
  "description": "Flag used when merging generic variants",
932
956
  "type": "boolean"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "magicvariants.json",
4
- "version": "1.8.14",
4
+ "version": "1.8.15",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "_magicvariantItemBase": {
@@ -90,6 +90,12 @@
90
90
  "bolt": {
91
91
  "type": "boolean"
92
92
  },
93
+ "bulletSling": {
94
+ "type": "boolean"
95
+ },
96
+ "needleBlowgun": {
97
+ "type": "boolean"
98
+ },
93
99
  "weaponCategory": {
94
100
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
95
101
  },
@@ -451,6 +457,12 @@
451
457
  "bolt": {
452
458
  "type": "boolean"
453
459
  },
460
+ "bulletSling": {
461
+ "type": "boolean"
462
+ },
463
+ "needleBlowgun": {
464
+ "type": "boolean"
465
+ },
454
466
  "weaponCategory": {
455
467
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
456
468
  },
@@ -601,6 +613,12 @@
601
613
  "bolt": {
602
614
  "type": "boolean"
603
615
  },
616
+ "bulletSling": {
617
+ "type": "boolean"
618
+ },
619
+ "needleBlowgun": {
620
+ "type": "boolean"
621
+ },
604
622
  "weaponCategory": {
605
623
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
606
624
  },
@@ -967,6 +985,12 @@
967
985
  "bolt": {
968
986
  "type": "boolean"
969
987
  },
988
+ "bulletSling": {
989
+ "type": "boolean"
990
+ },
991
+ "needleBlowgun": {
992
+ "type": "boolean"
993
+ },
970
994
  "weaponCategory": {
971
995
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
972
996
  },
@@ -1121,6 +1145,12 @@
1121
1145
  "bolt": {
1122
1146
  "type": "boolean"
1123
1147
  },
1148
+ "bulletSling": {
1149
+ "type": "boolean"
1150
+ },
1151
+ "needleBlowgun": {
1152
+ "type": "boolean"
1153
+ },
1124
1154
  "weaponCategory": {
1125
1155
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1126
1156
  },
@@ -1486,6 +1516,12 @@
1486
1516
  "bolt": {
1487
1517
  "type": "boolean"
1488
1518
  },
1519
+ "bulletSling": {
1520
+ "type": "boolean"
1521
+ },
1522
+ "needleBlowgun": {
1523
+ "type": "boolean"
1524
+ },
1489
1525
  "weaponCategory": {
1490
1526
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1491
1527
  },