tpmkms_4wp 9.1.1 → 9.2.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.
Files changed (54) hide show
  1. package/common/animals.instance.json +13 -0
  2. package/common/articles.js +3 -0
  3. package/common/asking.test.json +193 -72
  4. package/common/avatar.js +0 -6
  5. package/common/colors.instance.json +42 -0
  6. package/common/comparable.instance.json +3 -0
  7. package/common/comparable.js +6 -0
  8. package/common/concept.js +1 -1
  9. package/common/crew.instance.json +26 -39
  10. package/common/crew.js +0 -7
  11. package/common/dialogues.js +2 -1
  12. package/common/dimension.instance.json +1 -0
  13. package/common/edible.instance.json +92 -0
  14. package/common/emotions.instance.json +1 -0
  15. package/common/events.js +3 -3
  16. package/common/events.test.json +107 -36
  17. package/common/fastfood.instance.json +1053 -12554
  18. package/common/fastfood.js +2 -1
  19. package/common/formulas.instance.json +1 -0
  20. package/common/formulas.js +3 -1
  21. package/common/formulas.test.json +643 -711
  22. package/common/helpers/concept.js +6 -2
  23. package/common/helpers/dialogues.js +1 -1
  24. package/common/helpers/menus.js +154 -0
  25. package/common/helpers.js +16 -0
  26. package/common/kirk.instance.json +1 -0
  27. package/common/length.instance.json +15 -0
  28. package/common/math.instance.json +1 -0
  29. package/common/menus.instance.json +10097 -0
  30. package/common/menus.js +260 -0
  31. package/common/menus.test.json +26163 -0
  32. package/common/negation.js +5 -0
  33. package/common/ordering.instance.json +2 -0
  34. package/common/people.instance.json +96 -8
  35. package/common/pipboy.instance.json +105 -123
  36. package/common/pipboy.js +0 -7
  37. package/common/pokemon.instance.json +13 -8
  38. package/common/pressure.instance.json +4 -0
  39. package/common/properties.instance.json +1 -0
  40. package/common/properties.js +1 -0
  41. package/common/reports.instance.json +18 -23
  42. package/common/reports.js +12 -3
  43. package/common/sdefaults.js +28 -3
  44. package/common/spock.instance.json +1 -0
  45. package/common/stm.js +2 -1
  46. package/common/temperature.instance.json +4 -0
  47. package/common/tester.js +24 -2
  48. package/common/ui.instance.json +446 -0
  49. package/common/ui.js +9 -4
  50. package/common/ui.test.json +6794 -0
  51. package/common/weight.instance.json +14 -0
  52. package/common/wp.instance.json +6262 -2
  53. package/main.js +2 -0
  54. package/package.json +8 -3
@@ -50,7 +50,11 @@ class API {
50
50
  const objectSingular = pluralize.singular(objectWord)
51
51
  const objectPlural = pluralize.plural(objectWord)
52
52
  // config.addOperator({ pattern: `(${modifierIds.map((modifierId) => `(${modifierId}/*)`).join(' ')} [${modifiersObjectId}] (${objectId}/0))`, allowDups: true })
53
- config.addOperator({ pattern: `(${modifierIds.map((modifierId) => `(${modifierId}/*)`).join(' ')} [${modifiersObjectId}] (${objectId}/*))`, allowDups: true })
53
+ if (false) {
54
+ config.addOperator({ pattern: `(${modifierIds.map((modifierId) => `(${modifierId}/*)`).join(' ')} [${modifiersObjectId}] (${objectId}/*))`, allowDups: true })
55
+ } else {
56
+ config.addOperator({ pattern: `(${modifierIds.map((modifierId) => `(@==${modifierId})`).join(' ')} [${modifiersObjectId}] (@==${objectId}))`, allowDups: true })
57
+ }
54
58
  // config.addOperator({ pattern: `(<${modifierId}|> ([${objectId}|]))`, allowDups: true })
55
59
  // config.addOperator({ pattern: `([${modifierObjectId}|])`, allowDups: true })
56
60
 
@@ -91,7 +95,7 @@ class API {
91
95
  })
92
96
  // modifierds.forEach((modifierId) => config.addWord(modifierId, { id: modifierId, initial: `{ value: '${modifierId}' }`}))
93
97
 
94
- modifierIds.forEach((modifierId) => config.addBridge({ id: modifierId, level: 0, bridge: `{ ...next(operator), value: '${modifierId}' }`, allowDups: true }))
98
+ modifierIds.forEach((modifierId) => config.addBridge({ id: modifierId, level: 0, bridge: `{ ...next(operator), value: or(operator.value, '${modifierId}') }`, allowDups: true }))
95
99
  config.addBridge({ id: objectId, level: 0, bridge: `{ ...next(operator), value: '${objectId}' }`, allowDups: true })
96
100
  // config.addBridge({ id: modifierObjectId, level: 0, bridge: `{ ...next(operator), value: '${modifierObjectId}' }`, allowDups: true })
97
101
  const modifierProperties = modifierIds.map((modifierId, index) => `'modifier_${modifierId}': before[${index}]`).join(', ')
@@ -102,7 +102,7 @@ class API {
102
102
  }
103
103
  // config.addOperator({ pattern: `(["${fixUps(concept)}"])`, allowDups: true })
104
104
  config.addOperator({ pattern: `(["${concept}"])`, allowDups: true })
105
- config.addBridge({ id: concept, level: 0, bridge: `{ ...next(operator), value: '${source_value || concept}' }` , allowDups: true })
105
+ config.addBridge({ id: concept, level: 0, bridge: `{ ...next(operator), value: or(operator.value, '${source_value || concept}') }` , allowDups: true })
106
106
  const addConcept = (word, number) => {
107
107
  config.addWord(word, { id: concept, initial: `{ value: "${source_value || concept}", number: "${number}" }` } )
108
108
  const baseTypes = [
@@ -0,0 +1,154 @@
1
+ const calculateLefts = (defs) => {
2
+ const lefts = {}
3
+ calculateLeftsHelper(defs, lefts)
4
+ return lefts
5
+ }
6
+
7
+ const calculateLeftsHelper = (defs, lefts) => {
8
+ if (Array.isArray(defs)) {
9
+ let previous
10
+ for (const def of defs) {
11
+ if (previous) {
12
+ lefts[def.key] = previous.key
13
+ previous = def
14
+ } else {
15
+ previous = def
16
+ }
17
+ }
18
+ }
19
+ return lefts
20
+ }
21
+
22
+ const calculateRights = (defs) => {
23
+ const rights = {}
24
+ calculateRightsHelper(defs, rights)
25
+ return rights
26
+ }
27
+
28
+ const calculateRightsHelper = (defs, rights) => {
29
+ if (Array.isArray(defs)) {
30
+ let previous
31
+ for (const def of defs) {
32
+ if (previous) {
33
+ rights[previous.key] = def.key
34
+ previous = def
35
+ } else {
36
+ previous = def
37
+ }
38
+ }
39
+ }
40
+ return rights
41
+ }
42
+
43
+ const calculateDowns = (defs) => {
44
+ const downs = {}
45
+ calculateDownsHelper(defs, downs)
46
+ return downs
47
+ }
48
+
49
+ const calculateDownsHelper = (defs, downs) => {
50
+ if (Array.isArray(defs)) {
51
+ for (const def of defs) {
52
+ calculateDownsHelper(def, downs)
53
+ }
54
+ } else if (defs.children) {
55
+ if (defs.children.length > 0) {
56
+ downs[defs.key] = defs.children[0].key
57
+ }
58
+
59
+ let previous
60
+ for (const child of defs.children) {
61
+ if (child.divider) {
62
+ continue
63
+ }
64
+ if (previous) {
65
+ downs[previous.key] = child.key
66
+ previous = child
67
+ } else {
68
+ previous = child
69
+ }
70
+ }
71
+ }
72
+ return downs
73
+ }
74
+
75
+ const calculateUps = (defs) => {
76
+ const ups = {}
77
+ calculateUpsHelper(defs, ups)
78
+ return ups
79
+ }
80
+
81
+ const calculateUpsHelper = (defs, ups) => {
82
+ if (Array.isArray(defs)) {
83
+ for (const def of defs) {
84
+ calculateUpsHelper(def, ups)
85
+ }
86
+ } else if (defs.children) {
87
+ let previous
88
+ for (const child of defs.children) {
89
+ if (child.divider) {
90
+ continue
91
+ }
92
+ if (previous) {
93
+ ups[child.key] = previous.key
94
+ previous = child
95
+ } else {
96
+ previous = child
97
+ }
98
+ }
99
+ }
100
+ return ups
101
+ }
102
+
103
+ const calculateParents = (defs) => {
104
+ const parents = {}
105
+ calculateParentsHelper(defs, parents)
106
+ return parents
107
+ }
108
+
109
+ const calculateParentsHelper = (defs, parents) => {
110
+ if (Array.isArray(defs)) {
111
+ for (const def of defs) {
112
+ parents[def.key] = def.key
113
+ calculateParentsHelper(def, parents)
114
+ }
115
+ } else if (defs.children) {
116
+ for (const child of defs.children) {
117
+ if (child.divider) {
118
+ continue
119
+ }
120
+ parents[child.key] = defs.key
121
+ }
122
+ }
123
+ return parents
124
+ }
125
+
126
+ const calculatePaths = (defs) => {
127
+ const paths = {}
128
+ calculatePathsHelper(defs, paths)
129
+ return paths
130
+ }
131
+
132
+ const calculatePathsHelper = (defs, paths) => {
133
+ if (Array.isArray(defs)) {
134
+ for (const def of defs) {
135
+ calculatePathsHelper(def, paths)
136
+ }
137
+ } else {
138
+ paths[defs.key] = [defs.key]
139
+ for (const child of (defs.children || [])) {
140
+ paths[child.key] = [defs.key, child.key]
141
+ }
142
+ }
143
+ return paths
144
+ }
145
+
146
+
147
+ module.exports = {
148
+ calculateRights,
149
+ calculateLefts,
150
+ calculateDowns,
151
+ calculateUps,
152
+ calculateParents,
153
+ calculatePaths,
154
+ }
package/common/helpers.js CHANGED
@@ -1,5 +1,19 @@
1
1
  const pluralize = require('pluralize')
2
2
 
3
+ const unshiftL = (list, element, max) => {
4
+ if (list.length >= max) {
5
+ list.pop()
6
+ }
7
+ list.unshift(element)
8
+ }
9
+
10
+ const pushL = (list, element, max) => {
11
+ if (list.length >= max) {
12
+ list.shift()
13
+ }
14
+ list.push(element)
15
+ }
16
+
3
17
  // X pm today or tomorrow
4
18
  const millisecondsUntilHourOfDay = (newDate, hour) => {
5
19
  const now = newDate()
@@ -207,6 +221,8 @@ const getValue = (propertyPath, object) => {
207
221
  }
208
222
 
209
223
  module.exports = {
224
+ unshiftL,
225
+ pushL,
210
226
  getValue,
211
227
  defaultContextCheck,
212
228
  defaultContextCheckProperties,
@@ -1567,6 +1567,7 @@
1567
1567
  "level": 2,
1568
1568
  "context_index": 1,
1569
1569
  "topLevel": true,
1570
+ "context_id": 2,
1570
1571
  "touchedBy": [
1571
1572
  "kirk#call2"
1572
1573
  ]
@@ -1174,6 +1174,7 @@
1174
1174
  "level": 2,
1175
1175
  "context_index": 1,
1176
1176
  "topLevel": true,
1177
+ "context_id": 2,
1177
1178
  "touchedBy": [
1178
1179
  "length#call2"
1179
1180
  ]
@@ -2911,6 +2912,7 @@
2911
2912
  "level": 2,
2912
2913
  "context_index": 1,
2913
2914
  "topLevel": true,
2915
+ "context_id": 2,
2914
2916
  "touchedBy": [
2915
2917
  "length#call2"
2916
2918
  ]
@@ -5250,6 +5252,7 @@
5250
5252
  "level": 1,
5251
5253
  "context_index": 1,
5252
5254
  "topLevel": true,
5255
+ "context_id": 2,
5253
5256
  "touchedBy": [
5254
5257
  "length#call2"
5255
5258
  ]
@@ -6964,6 +6967,7 @@
6964
6967
  "level": 1,
6965
6968
  "context_index": 1,
6966
6969
  "topLevel": true,
6970
+ "context_id": 2,
6967
6971
  "touchedBy": [
6968
6972
  "length#call2"
6969
6973
  ]
@@ -8679,6 +8683,7 @@
8679
8683
  "level": 1,
8680
8684
  "context_index": 1,
8681
8685
  "topLevel": true,
8686
+ "context_id": 2,
8682
8687
  "touchedBy": [
8683
8688
  "length#call2"
8684
8689
  ]
@@ -10384,6 +10389,7 @@
10384
10389
  "level": 1,
10385
10390
  "context_index": 1,
10386
10391
  "topLevel": true,
10392
+ "context_id": 2,
10387
10393
  "touchedBy": [
10388
10394
  "length#call2"
10389
10395
  ]
@@ -12099,6 +12105,7 @@
12099
12105
  "level": 1,
12100
12106
  "context_index": 1,
12101
12107
  "topLevel": true,
12108
+ "context_id": 2,
12102
12109
  "touchedBy": [
12103
12110
  "length#call2"
12104
12111
  ]
@@ -13814,6 +13821,7 @@
13814
13821
  "level": 1,
13815
13822
  "context_index": 1,
13816
13823
  "topLevel": true,
13824
+ "context_id": 2,
13817
13825
  "touchedBy": [
13818
13826
  "length#call2"
13819
13827
  ]
@@ -15518,6 +15526,7 @@
15518
15526
  "level": 1,
15519
15527
  "context_index": 1,
15520
15528
  "topLevel": true,
15529
+ "context_id": 2,
15521
15530
  "touchedBy": [
15522
15531
  "length#call2"
15523
15532
  ]
@@ -17232,6 +17241,7 @@
17232
17241
  "level": 1,
17233
17242
  "context_index": 1,
17234
17243
  "topLevel": true,
17244
+ "context_id": 2,
17235
17245
  "touchedBy": [
17236
17246
  "length#call2"
17237
17247
  ]
@@ -18946,6 +18956,7 @@
18946
18956
  "level": 1,
18947
18957
  "context_index": 1,
18948
18958
  "topLevel": true,
18959
+ "context_id": 2,
18949
18960
  "touchedBy": [
18950
18961
  "length#call2"
18951
18962
  ]
@@ -20643,6 +20654,7 @@
20643
20654
  "level": 1,
20644
20655
  "context_index": 1,
20645
20656
  "topLevel": true,
20657
+ "context_id": 2,
20646
20658
  "touchedBy": [
20647
20659
  "length#call2"
20648
20660
  ]
@@ -22289,6 +22301,7 @@
22289
22301
  "level": 1,
22290
22302
  "context_index": 1,
22291
22303
  "topLevel": true,
22304
+ "context_id": 2,
22292
22305
  "touchedBy": [
22293
22306
  "length#call2"
22294
22307
  ]
@@ -23994,6 +24007,7 @@
23994
24007
  "level": 1,
23995
24008
  "context_index": 1,
23996
24009
  "topLevel": true,
24010
+ "context_id": 2,
23997
24011
  "touchedBy": [
23998
24012
  "length#call2"
23999
24013
  ]
@@ -25709,6 +25723,7 @@
25709
25723
  "level": 1,
25710
25724
  "context_index": 1,
25711
25725
  "topLevel": true,
25726
+ "context_id": 2,
25712
25727
  "touchedBy": [
25713
25728
  "length#call2"
25714
25729
  ]
@@ -914,6 +914,7 @@
914
914
  "level": 1,
915
915
  "context_index": 1,
916
916
  "topLevel": true,
917
+ "context_id": 2,
917
918
  "touchedBy": [
918
919
  "math#call2"
919
920
  ]