5etools-utils 0.13.5 → 0.13.6
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/UtilMisc.js +21 -0
- package/package.json +1 -1
- package/schema/brew/fluff-races.json +1 -19
- package/schema/brew-fast/fluff-races.json +1 -19
- package/schema/site/fluff-races.json +7 -7
- package/schema/site-fast/fluff-races.json +7 -7
- package/schema/ua/fluff-races.json +1 -19
- package/schema/ua-fast/fluff-races.json +1 -19
package/lib/UtilMisc.js
CHANGED
|
@@ -37,6 +37,27 @@ export default class MiscUtil {
|
|
|
37
37
|
|
|
38
38
|
/* -------------------------------------------- */
|
|
39
39
|
|
|
40
|
+
/** Delete a prop from a nested object, then all now-empty objects backwards from that point. */
|
|
41
|
+
static deleteObjectPath (object, ...path) {
|
|
42
|
+
const stack = [object];
|
|
43
|
+
|
|
44
|
+
if (object == null) return object;
|
|
45
|
+
for (let i = 0; i < path.length - 1; ++i) {
|
|
46
|
+
object = object[path[i]];
|
|
47
|
+
stack.push(object);
|
|
48
|
+
if (object === undefined) return object;
|
|
49
|
+
}
|
|
50
|
+
const out = delete object[path.at(-1)];
|
|
51
|
+
|
|
52
|
+
for (let i = path.length - 1; i > 0; --i) {
|
|
53
|
+
if (!Object.keys(stack[i]).length) delete stack[i - 1][path[i - 1]];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* -------------------------------------------- */
|
|
60
|
+
|
|
40
61
|
static setEq (a, b) {
|
|
41
62
|
if (a.size !== b.size) return false;
|
|
42
63
|
for (const it of a) if (!b.has(it)) return false;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -31,12 +31,6 @@
|
|
|
31
31
|
"items": {
|
|
32
32
|
"$ref": "entry.json"
|
|
33
33
|
}
|
|
34
|
-
},
|
|
35
|
-
"uncommon": {
|
|
36
|
-
"type": "boolean"
|
|
37
|
-
},
|
|
38
|
-
"monstrous": {
|
|
39
|
-
"type": "boolean"
|
|
40
34
|
}
|
|
41
35
|
},
|
|
42
36
|
"additionalProperties": false
|
|
@@ -70,12 +64,6 @@
|
|
|
70
64
|
"items": {
|
|
71
65
|
"$ref": "entry.json"
|
|
72
66
|
}
|
|
73
|
-
},
|
|
74
|
-
"uncommon": {
|
|
75
|
-
"type": "boolean"
|
|
76
|
-
},
|
|
77
|
-
"monstrous": {
|
|
78
|
-
"type": "boolean"
|
|
79
67
|
}
|
|
80
68
|
},
|
|
81
69
|
"additionalProperties": false,
|
|
@@ -113,12 +101,6 @@
|
|
|
113
101
|
"$ref": "entry.json"
|
|
114
102
|
}
|
|
115
103
|
},
|
|
116
|
-
"uncommon": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
|
-
"monstrous": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
104
|
"_copy": {
|
|
123
105
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
124
106
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -31,12 +31,6 @@
|
|
|
31
31
|
"items": {
|
|
32
32
|
"$ref": "entry.json"
|
|
33
33
|
}
|
|
34
|
-
},
|
|
35
|
-
"uncommon": {
|
|
36
|
-
"type": "boolean"
|
|
37
|
-
},
|
|
38
|
-
"monstrous": {
|
|
39
|
-
"type": "boolean"
|
|
40
34
|
}
|
|
41
35
|
},
|
|
42
36
|
"additionalProperties": false
|
|
@@ -70,12 +64,6 @@
|
|
|
70
64
|
"items": {
|
|
71
65
|
"$ref": "entry.json"
|
|
72
66
|
}
|
|
73
|
-
},
|
|
74
|
-
"uncommon": {
|
|
75
|
-
"type": "boolean"
|
|
76
|
-
},
|
|
77
|
-
"monstrous": {
|
|
78
|
-
"type": "boolean"
|
|
79
67
|
}
|
|
80
68
|
},
|
|
81
69
|
"additionalProperties": false,
|
|
@@ -113,12 +101,6 @@
|
|
|
113
101
|
"$ref": "entry.json"
|
|
114
102
|
}
|
|
115
103
|
},
|
|
116
|
-
"uncommon": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
|
-
"monstrous": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
104
|
"_copy": {
|
|
123
105
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
124
106
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"uncommon": {
|
|
36
|
-
"
|
|
36
|
+
"const": true
|
|
37
37
|
},
|
|
38
38
|
"monstrous": {
|
|
39
|
-
"
|
|
39
|
+
"const": true
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"additionalProperties": false
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"uncommon": {
|
|
75
|
-
"
|
|
75
|
+
"const": true
|
|
76
76
|
},
|
|
77
77
|
"monstrous": {
|
|
78
|
-
"
|
|
78
|
+
"const": true
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"additionalProperties": false,
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"uncommon": {
|
|
117
|
-
"
|
|
117
|
+
"const": true
|
|
118
118
|
},
|
|
119
119
|
"monstrous": {
|
|
120
|
-
"
|
|
120
|
+
"const": true
|
|
121
121
|
},
|
|
122
122
|
"_copy": {
|
|
123
123
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"uncommon": {
|
|
36
|
-
"
|
|
36
|
+
"const": true
|
|
37
37
|
},
|
|
38
38
|
"monstrous": {
|
|
39
|
-
"
|
|
39
|
+
"const": true
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"additionalProperties": false
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"uncommon": {
|
|
75
|
-
"
|
|
75
|
+
"const": true
|
|
76
76
|
},
|
|
77
77
|
"monstrous": {
|
|
78
|
-
"
|
|
78
|
+
"const": true
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"additionalProperties": false,
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"uncommon": {
|
|
117
|
-
"
|
|
117
|
+
"const": true
|
|
118
118
|
},
|
|
119
119
|
"monstrous": {
|
|
120
|
-
"
|
|
120
|
+
"const": true
|
|
121
121
|
},
|
|
122
122
|
"_copy": {
|
|
123
123
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -31,12 +31,6 @@
|
|
|
31
31
|
"items": {
|
|
32
32
|
"$ref": "entry.json"
|
|
33
33
|
}
|
|
34
|
-
},
|
|
35
|
-
"uncommon": {
|
|
36
|
-
"type": "boolean"
|
|
37
|
-
},
|
|
38
|
-
"monstrous": {
|
|
39
|
-
"type": "boolean"
|
|
40
34
|
}
|
|
41
35
|
},
|
|
42
36
|
"additionalProperties": false
|
|
@@ -70,12 +64,6 @@
|
|
|
70
64
|
"items": {
|
|
71
65
|
"$ref": "entry.json"
|
|
72
66
|
}
|
|
73
|
-
},
|
|
74
|
-
"uncommon": {
|
|
75
|
-
"type": "boolean"
|
|
76
|
-
},
|
|
77
|
-
"monstrous": {
|
|
78
|
-
"type": "boolean"
|
|
79
67
|
}
|
|
80
68
|
},
|
|
81
69
|
"additionalProperties": false,
|
|
@@ -113,12 +101,6 @@
|
|
|
113
101
|
"$ref": "entry.json"
|
|
114
102
|
}
|
|
115
103
|
},
|
|
116
|
-
"uncommon": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
|
-
"monstrous": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
104
|
"_copy": {
|
|
123
105
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
124
106
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "fluff-races.json",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"raceFluffData": {
|
|
@@ -31,12 +31,6 @@
|
|
|
31
31
|
"items": {
|
|
32
32
|
"$ref": "entry.json"
|
|
33
33
|
}
|
|
34
|
-
},
|
|
35
|
-
"uncommon": {
|
|
36
|
-
"type": "boolean"
|
|
37
|
-
},
|
|
38
|
-
"monstrous": {
|
|
39
|
-
"type": "boolean"
|
|
40
34
|
}
|
|
41
35
|
},
|
|
42
36
|
"additionalProperties": false
|
|
@@ -70,12 +64,6 @@
|
|
|
70
64
|
"items": {
|
|
71
65
|
"$ref": "entry.json"
|
|
72
66
|
}
|
|
73
|
-
},
|
|
74
|
-
"uncommon": {
|
|
75
|
-
"type": "boolean"
|
|
76
|
-
},
|
|
77
|
-
"monstrous": {
|
|
78
|
-
"type": "boolean"
|
|
79
67
|
}
|
|
80
68
|
},
|
|
81
69
|
"additionalProperties": false,
|
|
@@ -113,12 +101,6 @@
|
|
|
113
101
|
"$ref": "entry.json"
|
|
114
102
|
}
|
|
115
103
|
},
|
|
116
|
-
"uncommon": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
|
-
"monstrous": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
104
|
"_copy": {
|
|
123
105
|
"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
|
|
124
106
|
}
|