5etools-utils 0.9.65 → 0.10.0

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.65",
3
+ "version": "0.10.0",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "decks.json",
4
- "version": "1.0.4",
4
+ "version": "1.0.3",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "deckData": {
@@ -65,9 +65,6 @@
65
65
  "back": {
66
66
  "$ref": "entry.json#/$defs/entryImage"
67
67
  },
68
- "creditBack": {
69
- "type": "string"
70
- },
71
68
  "hasCardArt": {
72
69
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
73
70
  "type": "boolean"
@@ -138,9 +135,6 @@
138
135
  "back": {
139
136
  "$ref": "entry.json#/$defs/entryImage"
140
137
  },
141
- "creditBack": {
142
- "type": "string"
143
- },
144
138
  "hasCardArt": {
145
139
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
146
140
  "type": "boolean"
@@ -214,9 +208,6 @@
214
208
  "back": {
215
209
  "$ref": "entry.json#/$defs/entryImage"
216
210
  },
217
- "creditBack": {
218
- "type": "string"
219
- },
220
211
  "hasCardArt": {
221
212
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
222
213
  "type": "boolean"
@@ -265,15 +256,9 @@
265
256
  "face": {
266
257
  "$ref": "entry.json#/$defs/entryImage"
267
258
  },
268
- "creditFace": {
269
- "type": "string"
270
- },
271
259
  "back": {
272
260
  "$ref": "entry.json#/$defs/entryImage"
273
261
  },
274
- "creditBack": {
275
- "type": "string"
276
- },
277
262
  "suit": {
278
263
  "type": "string"
279
264
  },
@@ -321,15 +306,9 @@
321
306
  "face": {
322
307
  "$ref": "entry.json#/$defs/entryImage"
323
308
  },
324
- "creditFace": {
325
- "type": "string"
326
- },
327
309
  "back": {
328
310
  "$ref": "entry.json#/$defs/entryImage"
329
311
  },
330
- "creditBack": {
331
- "type": "string"
332
- },
333
312
  "suit": {
334
313
  "type": "string"
335
314
  },
@@ -380,15 +359,9 @@
380
359
  "face": {
381
360
  "$ref": "entry.json#/$defs/entryImage"
382
361
  },
383
- "creditFace": {
384
- "type": "string"
385
- },
386
362
  "back": {
387
363
  "$ref": "entry.json#/$defs/entryImage"
388
364
  },
389
- "creditBack": {
390
- "type": "string"
391
- },
392
365
  "suit": {
393
366
  "type": "string"
394
367
  },
@@ -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.17",
4
+ "version": "1.5.19",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "itemLookupBase": {
@@ -196,6 +196,9 @@
196
196
  "strength": {
197
197
  "type": "string"
198
198
  },
199
+ "dexterityMax": {
200
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
201
+ },
199
202
  "armor": {
200
203
  "description": "Flag used when merging generic variants",
201
204
  "type": "boolean"
@@ -252,6 +255,14 @@
252
255
  "description": "Flag used when merging generic variants",
253
256
  "type": "boolean"
254
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
+ },
255
266
  "weapon": {
256
267
  "description": "Flag used when merging generic variants",
257
268
  "type": "boolean"
@@ -377,6 +388,9 @@
377
388
  "customProperties": {
378
389
  "$ref": "items-shared.json#/$defs/customProperties"
379
390
  },
391
+ "acSpecial": {
392
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
393
+ },
380
394
  "currencyConversion": {
381
395
  "description": "ID of a value conversion table. Homebrew only.",
382
396
  "type": "string"
@@ -524,6 +538,9 @@
524
538
  "strength": {
525
539
  "type": "string"
526
540
  },
541
+ "dexterityMax": {
542
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
543
+ },
527
544
  "armor": {
528
545
  "description": "Flag used when merging generic variants",
529
546
  "type": "boolean"
@@ -580,6 +597,14 @@
580
597
  "description": "Flag used when merging generic variants",
581
598
  "type": "boolean"
582
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
+ },
583
608
  "weapon": {
584
609
  "description": "Flag used when merging generic variants",
585
610
  "type": "boolean"
@@ -705,6 +730,9 @@
705
730
  "customProperties": {
706
731
  "$ref": "items-shared.json#/$defs/customProperties"
707
732
  },
733
+ "acSpecial": {
734
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
735
+ },
708
736
  "currencyConversion": {
709
737
  "description": "ID of a value conversion table. Homebrew only.",
710
738
  "type": "string"
@@ -856,6 +884,9 @@
856
884
  "strength": {
857
885
  "type": "string"
858
886
  },
887
+ "dexterityMax": {
888
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
889
+ },
859
890
  "armor": {
860
891
  "description": "Flag used when merging generic variants",
861
892
  "type": "boolean"
@@ -912,6 +943,14 @@
912
943
  "description": "Flag used when merging generic variants",
913
944
  "type": "boolean"
914
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
+ },
915
954
  "weapon": {
916
955
  "description": "Flag used when merging generic variants",
917
956
  "type": "boolean"
@@ -1037,6 +1076,9 @@
1037
1076
  "customProperties": {
1038
1077
  "$ref": "items-shared.json#/$defs/customProperties"
1039
1078
  },
1079
+ "acSpecial": {
1080
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
1081
+ },
1040
1082
  "currencyConversion": {
1041
1083
  "description": "ID of a value conversion table. Homebrew only.",
1042
1084
  "type": "string"
@@ -281,6 +281,13 @@
281
281
  "itemReach": {
282
282
  "type": "integer"
283
283
  },
284
+ "itemDexterityMax": {
285
+ "description": "Maximum dexterity modifier for medium armor.",
286
+ "type": [
287
+ "integer",
288
+ "null"
289
+ ]
290
+ },
284
291
  "customProperties": {
285
292
  "description": "An unrestricted area for custom properties to be stored.",
286
293
  "type": "object",
@@ -293,6 +300,10 @@
293
300
  ]
294
301
  }
295
302
  },
303
+ "itemAcSpecial": {
304
+ "description": "Free text field for homebrew use.",
305
+ "type": "string"
306
+ },
296
307
  "fluff": {
297
308
  "description": "This is intended to be used for Homebrew only - site data should include a fluff file per source.",
298
309
  "anyOf": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "items.json",
4
- "version": "1.14.7",
4
+ "version": "1.14.8",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "itemData": {
@@ -125,11 +125,7 @@
125
125
  ]
126
126
  },
127
127
  "dexterityMax": {
128
- "description": "Maximum dexterity modifier for medium armor.",
129
- "type": [
130
- "integer",
131
- "null"
132
- ]
128
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
133
129
  },
134
130
  "firearm": {
135
131
  "type": "boolean"
@@ -547,8 +543,7 @@
547
543
  "$ref": "items-shared.json#/$defs/customProperties"
548
544
  },
549
545
  "acSpecial": {
550
- "description": "Free text field for homebrew use.",
551
- "type": "string"
546
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
552
547
  },
553
548
  "currencyConversion": {
554
549
  "description": "ID of a value conversion table. Homebrew only.",
@@ -722,11 +717,7 @@
722
717
  ]
723
718
  },
724
719
  "dexterityMax": {
725
- "description": "Maximum dexterity modifier for medium armor.",
726
- "type": [
727
- "integer",
728
- "null"
729
- ]
720
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
730
721
  },
731
722
  "firearm": {
732
723
  "type": "boolean"
@@ -1144,8 +1135,7 @@
1144
1135
  "$ref": "items-shared.json#/$defs/customProperties"
1145
1136
  },
1146
1137
  "acSpecial": {
1147
- "description": "Free text field for homebrew use.",
1148
- "type": "string"
1138
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
1149
1139
  },
1150
1140
  "currencyConversion": {
1151
1141
  "description": "ID of a value conversion table. Homebrew only.",
@@ -1314,11 +1304,7 @@
1314
1304
  ]
1315
1305
  },
1316
1306
  "dexterityMax": {
1317
- "description": "Maximum dexterity modifier for medium armor.",
1318
- "type": [
1319
- "integer",
1320
- "null"
1321
- ]
1307
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
1322
1308
  },
1323
1309
  "firearm": {
1324
1310
  "type": "boolean"
@@ -1736,8 +1722,7 @@
1736
1722
  "$ref": "items-shared.json#/$defs/customProperties"
1737
1723
  },
1738
1724
  "acSpecial": {
1739
- "description": "Free text field for homebrew use.",
1740
- "type": "string"
1725
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
1741
1726
  },
1742
1727
  "currencyConversion": {
1743
1728
  "description": "ID of a value conversion table. Homebrew only.",
@@ -1911,11 +1896,7 @@
1911
1896
  ]
1912
1897
  },
1913
1898
  "dexterityMax": {
1914
- "description": "Maximum dexterity modifier for medium armor.",
1915
- "type": [
1916
- "integer",
1917
- "null"
1918
- ]
1899
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
1919
1900
  },
1920
1901
  "firearm": {
1921
1902
  "type": "boolean"
@@ -2333,8 +2314,7 @@
2333
2314
  "$ref": "items-shared.json#/$defs/customProperties"
2334
2315
  },
2335
2316
  "acSpecial": {
2336
- "description": "Free text field for homebrew use.",
2337
- "type": "string"
2317
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
2338
2318
  },
2339
2319
  "currencyConversion": {
2340
2320
  "description": "ID of a value conversion table. Homebrew only.",
@@ -2507,11 +2487,7 @@
2507
2487
  ]
2508
2488
  },
2509
2489
  "dexterityMax": {
2510
- "description": "Maximum dexterity modifier for medium armor.",
2511
- "type": [
2512
- "integer",
2513
- "null"
2514
- ]
2490
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
2515
2491
  },
2516
2492
  "firearm": {
2517
2493
  "type": "boolean"
@@ -2929,8 +2905,7 @@
2929
2905
  "$ref": "items-shared.json#/$defs/customProperties"
2930
2906
  },
2931
2907
  "acSpecial": {
2932
- "description": "Free text field for homebrew use.",
2933
- "type": "string"
2908
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
2934
2909
  },
2935
2910
  "currencyConversion": {
2936
2911
  "description": "ID of a value conversion table. Homebrew only.",
@@ -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.13",
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
  },
@@ -243,6 +249,9 @@
243
249
  "null"
244
250
  ]
245
251
  },
252
+ "dexterityMax": {
253
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
254
+ },
246
255
  "wondrous": {
247
256
  "type": "boolean"
248
257
  },
@@ -343,6 +352,9 @@
343
352
  "description": "An unrestricted area for custom properties to be stored.",
344
353
  "type": "object"
345
354
  },
355
+ "acSpecial": {
356
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
357
+ },
346
358
  "currencyConversion": {
347
359
  "description": "ID of a value conversion table. Homebrew only.",
348
360
  "type": "string"
@@ -445,6 +457,12 @@
445
457
  "bolt": {
446
458
  "type": "boolean"
447
459
  },
460
+ "bulletSling": {
461
+ "type": "boolean"
462
+ },
463
+ "needleBlowgun": {
464
+ "type": "boolean"
465
+ },
448
466
  "weaponCategory": {
449
467
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
450
468
  },
@@ -595,6 +613,12 @@
595
613
  "bolt": {
596
614
  "type": "boolean"
597
615
  },
616
+ "bulletSling": {
617
+ "type": "boolean"
618
+ },
619
+ "needleBlowgun": {
620
+ "type": "boolean"
621
+ },
598
622
  "weaponCategory": {
599
623
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
600
624
  },
@@ -748,6 +772,9 @@
748
772
  "null"
749
773
  ]
750
774
  },
775
+ "dexterityMax": {
776
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
777
+ },
751
778
  "wondrous": {
752
779
  "type": "boolean"
753
780
  },
@@ -848,6 +875,9 @@
848
875
  "description": "An unrestricted area for custom properties to be stored.",
849
876
  "type": "object"
850
877
  },
878
+ "acSpecial": {
879
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
880
+ },
851
881
  "currencyConversion": {
852
882
  "description": "ID of a value conversion table. Homebrew only.",
853
883
  "type": "string"
@@ -955,6 +985,12 @@
955
985
  "bolt": {
956
986
  "type": "boolean"
957
987
  },
988
+ "bulletSling": {
989
+ "type": "boolean"
990
+ },
991
+ "needleBlowgun": {
992
+ "type": "boolean"
993
+ },
958
994
  "weaponCategory": {
959
995
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
960
996
  },
@@ -1109,6 +1145,12 @@
1109
1145
  "bolt": {
1110
1146
  "type": "boolean"
1111
1147
  },
1148
+ "bulletSling": {
1149
+ "type": "boolean"
1150
+ },
1151
+ "needleBlowgun": {
1152
+ "type": "boolean"
1153
+ },
1112
1154
  "weaponCategory": {
1113
1155
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1114
1156
  },
@@ -1262,6 +1304,9 @@
1262
1304
  "null"
1263
1305
  ]
1264
1306
  },
1307
+ "dexterityMax": {
1308
+ "$ref": "items-shared.json#/$defs/itemDexterityMax"
1309
+ },
1265
1310
  "wondrous": {
1266
1311
  "type": "boolean"
1267
1312
  },
@@ -1362,6 +1407,9 @@
1362
1407
  "description": "An unrestricted area for custom properties to be stored.",
1363
1408
  "type": "object"
1364
1409
  },
1410
+ "acSpecial": {
1411
+ "$ref": "items-shared.json#/$defs/itemAcSpecial"
1412
+ },
1365
1413
  "currencyConversion": {
1366
1414
  "description": "ID of a value conversion table. Homebrew only.",
1367
1415
  "type": "string"
@@ -1468,6 +1516,12 @@
1468
1516
  "bolt": {
1469
1517
  "type": "boolean"
1470
1518
  },
1519
+ "bulletSling": {
1520
+ "type": "boolean"
1521
+ },
1522
+ "needleBlowgun": {
1523
+ "type": "boolean"
1524
+ },
1471
1525
  "weaponCategory": {
1472
1526
  "$ref": "items-shared.json#/$defs/itemWeaponCategory"
1473
1527
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "decks.json",
4
- "version": "1.0.4",
4
+ "version": "1.0.3",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "deckData": {
@@ -65,9 +65,6 @@
65
65
  "back": {
66
66
  "$ref": "entry.json#/$defs/entryImage"
67
67
  },
68
- "creditBack": {
69
- "type": "string"
70
- },
71
68
  "hasCardArt": {
72
69
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
73
70
  "type": "boolean"
@@ -138,9 +135,6 @@
138
135
  "back": {
139
136
  "$ref": "entry.json#/$defs/entryImage"
140
137
  },
141
- "creditBack": {
142
- "type": "string"
143
- },
144
138
  "hasCardArt": {
145
139
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
146
140
  "type": "boolean"
@@ -214,9 +208,6 @@
214
208
  "back": {
215
209
  "$ref": "entry.json#/$defs/entryImage"
216
210
  },
217
- "creditBack": {
218
- "type": "string"
219
- },
220
211
  "hasCardArt": {
221
212
  "description": "A hint used by filters, determining whether or not this deck should be filtered out by default.",
222
213
  "type": "boolean"
@@ -265,15 +256,9 @@
265
256
  "face": {
266
257
  "$ref": "entry.json#/$defs/entryImage"
267
258
  },
268
- "creditFace": {
269
- "type": "string"
270
- },
271
259
  "back": {
272
260
  "$ref": "entry.json#/$defs/entryImage"
273
261
  },
274
- "creditBack": {
275
- "type": "string"
276
- },
277
262
  "suit": {
278
263
  "type": "string"
279
264
  },
@@ -321,15 +306,9 @@
321
306
  "face": {
322
307
  "$ref": "entry.json#/$defs/entryImage"
323
308
  },
324
- "creditFace": {
325
- "type": "string"
326
- },
327
309
  "back": {
328
310
  "$ref": "entry.json#/$defs/entryImage"
329
311
  },
330
- "creditBack": {
331
- "type": "string"
332
- },
333
312
  "suit": {
334
313
  "type": "string"
335
314
  },
@@ -380,15 +359,9 @@
380
359
  "face": {
381
360
  "$ref": "entry.json#/$defs/entryImage"
382
361
  },
383
- "creditFace": {
384
- "type": "string"
385
- },
386
362
  "back": {
387
363
  "$ref": "entry.json#/$defs/entryImage"
388
364
  },
389
- "creditBack": {
390
- "type": "string"
391
- },
392
365
  "suit": {
393
366
  "type": "string"
394
367
  },