advanced-poe-filter-parser 0.2.6 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "advanced-poe-filter-parser",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "keywords": [
5
5
  "path-of-exile",
6
6
  "filter-of-kalandra",
@@ -12,28 +12,29 @@
12
12
  "author": "isuke <isuke770@gmail.com>",
13
13
  "license": "MIT",
14
14
  "private": false,
15
+ "type": "module",
15
16
  "scripts": {
16
17
  "lint": "eslint ./*.js test/**/*.js",
17
18
  "fix": "eslint --fix ./*.js test/**/*.js",
18
19
  "test": "ava --verbose",
19
20
  "build": "pegjs --format=es -o lib/parser.js src/advanced-poe-filter.pegjs",
20
- "predeploy": "yarn run build",
21
- "deploy": "yarn publish"
21
+ "predeploy": "npm run build",
22
+ "deploy": "npm publish"
22
23
  },
23
24
  "dependencies": {},
24
25
  "devDependencies": {
25
- "@babel/cli": "7.10.5",
26
- "@babel/core": "7.10.5",
27
- "@babel/preset-env": "7.10.4",
28
- "ava": "2.4.0",
29
- "eslint": "7.4.0",
30
- "eslint-config-prettier": "6.11.0",
31
- "eslint-plugin-prettier": "3.1.4",
32
- "outdent": "0.7.1",
26
+ "@babel/cli": "7.19.3",
27
+ "@babel/core": "7.19.6",
28
+ "@babel/preset-env": "7.19.4",
29
+ "ava": "5.0.1",
30
+ "eslint": "8.26.0",
31
+ "eslint-config-prettier": "8.5.0",
32
+ "eslint-plugin-prettier": "4.2.1",
33
+ "outdent": "0.8.0",
33
34
  "pegjs": "0.11.0-master.b7b87ea",
34
- "prettier": "2.0.5",
35
- "sinon": "9.0.2",
36
- "webpack": "4.43.0",
37
- "webpack-cli": "3.3.12"
35
+ "prettier": "2.7.1",
36
+ "sinon": "14.0.1",
37
+ "webpack": "5.74.0",
38
+ "webpack-cli": "4.10.00"
38
39
  }
39
40
  }
@@ -83,7 +83,6 @@ commentline = _* '#' [^\n]* br
83
83
  condition =
84
84
  conditionClass
85
85
  / conditionBaseType
86
- / conditionProphecy
87
86
  / conditionDropLevel
88
87
  / conditionItemLevel
89
88
  / conditionAreaLevel
@@ -101,8 +100,6 @@ condition =
101
100
  / conditionBaseEnergyShield
102
101
  / conditionBaseEvasion
103
102
  / conditionBaseWard
104
- / conditionShaperItem
105
- / conditionElderItem
106
103
  / conditionFracturedItem
107
104
  / conditionSynthesisedItem
108
105
  / conditionCorrupted
@@ -118,17 +115,21 @@ condition =
118
115
  / conditionCorruptedMods
119
116
  / conditionEnchantmentPassiveNum
120
117
  / conditionHasExplicitMod
118
+ / conditionHasImplicitMod
119
+ / conditionHasEaterOfWorldsImplicit
120
+ / conditionHasSearingExarchImplicit
121
121
  / conditionAnyEnchantment
122
122
  / conditionHasEnchantment
123
123
  / conditionHasInfluence
124
124
  / conditionEnchantmentPassiveNode
125
125
  / conditionAlternateQuality
126
126
  / conditionReplica
127
+ / conditionArchnemesisMod
128
+ / conditionHasCruciblePassiveTree
127
129
 
128
130
  // Condition Attributes
129
131
  conditionClass = attr:'Class' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
130
132
  conditionBaseType = attr:'BaseType' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
131
- conditionProphecy = attr:'Prophecy' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
132
133
  conditionDropLevel = attr:'DropLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
133
134
  conditionItemLevel = attr:'ItemLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
134
135
  conditionAreaLevel = attr:'AreaLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
@@ -146,8 +147,6 @@ conditionBaseArmour = attr:'BaseArmour' __ val:condition
146
147
  conditionBaseEnergyShield = attr:'BaseEnergyShield' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
147
148
  conditionBaseEvasion = attr:'BaseEvasion' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
148
149
  conditionBaseWard = attr:'BaseWard' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
149
- conditionShaperItem = attr:'ShaperItem' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
150
- conditionElderItem = attr:'ElderItem' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
151
150
  conditionFracturedItem = attr:'FracturedItem' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
152
151
  conditionSynthesisedItem = attr:'SynthesisedItem' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
153
152
  conditionCorrupted = attr:'Corrupted' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
@@ -163,12 +162,18 @@ conditionWidth = attr:'Width' __ val:condition
163
162
  conditionCorruptedMods = attr:'CorruptedMods' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
164
163
  conditionEnchantmentPassiveNum = attr:'EnchantmentPassiveNum' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
165
164
  conditionHasExplicitMod = attr:'HasExplicitMod' __ val:conditionValueNumericAndArray { return { lineType: 'condition', attr, val} }
165
+ conditionHasImplicitMod = attr:'HasImplicitMod' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
166
+ conditionHasEaterOfWorldsImplicit = attr:'HasEaterOfWorldsImplicit' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
167
+ conditionHasSearingExarchImplicit = attr:'HasSearingExarchImplicit' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
166
168
  conditionAnyEnchantment = attr:'AnyEnchantment' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
167
169
  conditionHasEnchantment = attr:'HasEnchantment' __ val:conditionValueNumericAndArray { return { lineType: 'condition', attr, val} }
168
170
  conditionHasInfluence = attr:'HasInfluence' __ val:conditionValueArrayOrNone { return { lineType: 'condition', attr, val} }
169
171
  conditionEnchantmentPassiveNode = attr:'EnchantmentPassiveNode' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
170
172
  conditionAlternateQuality = attr:'AlternateQuality' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
171
173
  conditionReplica = attr:'Replica' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
174
+ conditionArchnemesisMod = attr:'ArchnemesisMod' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
175
+ conditionHasCruciblePassiveTree = attr:'HasCruciblePassiveTree' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
176
+
172
177
 
173
178
  // Condition Values
174
179
  conditionValueArray = operator:(matchOperator __)? names:names { return operator ? { ope: operator[0], vals: names } : { ope: '=', vals: names } }
@@ -1,7 +1,7 @@
1
1
  import test from 'ava'
2
2
  import outdent from 'outdent'
3
3
 
4
- import { parse } from '../lib/parser'
4
+ import { parse } from '../lib/parser.js'
5
5
 
6
6
  test('parse : blank and comment lines', (t) => {
7
7
  const script = [
@@ -103,7 +103,6 @@ test('parse : all actions and conditions', (t) => {
103
103
  Show "Section1"
104
104
  Class "Maps"
105
105
  BaseType "Sacrificial Garb"
106
- Prophecy == "Foo"
107
106
  DropLevel > 85
108
107
  ItemLevel >= 70
109
108
  AreaLevel < 30
@@ -121,8 +120,6 @@ Show "Section1"
121
120
  BaseEnergyShield > 41
122
121
  BaseEvasion > 42
123
122
  BaseWard > 43
124
- ShaperItem True
125
- ElderItem False
126
123
  FracturedItem False
127
124
  SynthesisedItem False
128
125
  Corrupted True
@@ -138,6 +135,9 @@ Show "Section1"
138
135
  CorruptedMods >= 1
139
136
  EnchantmentPassiveNum > 5
140
137
  HasExplicitMod "Foo" "Bar"
138
+ HasImplicitMod True
139
+ HasEaterOfWorldsImplicit >= 4
140
+ HasSearingExarchImplicit >= 4
141
141
  AnyEnchantment True
142
142
  HasEnchantment "Foo" "Bar"
143
143
  HasInfluence "Shaper" "Elder"
@@ -153,10 +153,11 @@ Show "Section1"
153
153
  CustomAlertSound "C\\foobar\\sound.mp3" 300
154
154
  MinimapIcon 0 Red Circle
155
155
  PlayEffect Red
156
+ ArchnemesisMod "Toxic"
157
+ HasCruciblePassiveTree True
156
158
  Show "Section2"
157
159
  Class "Life Flasks" "Mana Flasks" "Hybrid Flasks"
158
160
  BaseType "Two-Toned Boots" "Spiked Gloves" "Gripped Gloves" "Fingerless Silk Gloves" "Bone Helmet"
159
- Prophecy "Foo" "Bar"
160
161
  SocketGroup W
161
162
  Rarity Rare
162
163
  HasExplicitMod == "Foo" "Bar"
@@ -203,7 +204,6 @@ Unset "Section6"
203
204
  conditions: {
204
205
  Class: { ope: '=', vals: ['Maps'] },
205
206
  BaseType: { ope: '=', vals: ['Sacrificial Garb'] },
206
- Prophecy: { ope: '==', vals: ['Foo'] },
207
207
  DropLevel: '> 85',
208
208
  ItemLevel: '>= 70',
209
209
  AreaLevel: '< 30',
@@ -221,8 +221,6 @@ Unset "Section6"
221
221
  BaseEnergyShield: '> 41',
222
222
  BaseEvasion: '> 42',
223
223
  BaseWard: '> 43',
224
- ShaperItem: true,
225
- ElderItem: false,
226
224
  FracturedItem: false,
227
225
  SynthesisedItem: false,
228
226
  Corrupted: true,
@@ -238,12 +236,20 @@ Unset "Section6"
238
236
  CorruptedMods: '>= 1',
239
237
  EnchantmentPassiveNum: '> 5',
240
238
  HasExplicitMod: { ope: '=', vals: ['Foo', 'Bar'] },
239
+ HasImplicitMod: true,
240
+ HasEaterOfWorldsImplicit: '>= 4',
241
+ HasSearingExarchImplicit: '>= 4',
241
242
  AnyEnchantment: true,
242
243
  HasEnchantment: { ope: '=', vals: ['Foo', 'Bar'] },
243
244
  HasInfluence: { ope: '=', vals: ['Shaper', 'Elder'] },
244
- EnchantmentPassiveNode: { ope: '=', vals: ['Damage while you have a Herald', 'Projectile Damage'] },
245
+ EnchantmentPassiveNode: {
246
+ ope: '=',
247
+ vals: ['Damage while you have a Herald', 'Projectile Damage'],
248
+ },
245
249
  AlternateQuality: true,
246
250
  Replica: true,
251
+ ArchnemesisMod: { ope: '=', vals: ['Toxic'] },
252
+ HasCruciblePassiveTree: true,
247
253
  },
248
254
  actions: {
249
255
  SetBorderColor: { rgb: { r: 100, g: 101, b: 102 }, alpha: 255 },
@@ -264,9 +270,9 @@ Unset "Section6"
264
270
  offset: 0,
265
271
  },
266
272
  end: {
267
- line: 54,
273
+ line: 56,
268
274
  column: 1,
269
- offset: 1514,
275
+ offset: 1600,
270
276
  },
271
277
  },
272
278
  },
@@ -275,9 +281,14 @@ Unset "Section6"
275
281
  name: 'Section2',
276
282
  activity: 'Show',
277
283
  conditions: {
278
- Class: { ope: '=', vals: ['Life Flasks', 'Mana Flasks', 'Hybrid Flasks'] },
279
- BaseType: { ope: '=', vals: ['Two-Toned Boots', 'Spiked Gloves', 'Gripped Gloves', 'Fingerless Silk Gloves', 'Bone Helmet'] },
280
- Prophecy: { ope: '=', vals: ['Foo', 'Bar'] },
284
+ Class: {
285
+ ope: '=',
286
+ vals: ['Life Flasks', 'Mana Flasks', 'Hybrid Flasks'],
287
+ },
288
+ BaseType: {
289
+ ope: '=',
290
+ vals: ['Two-Toned Boots', 'Spiked Gloves', 'Gripped Gloves', 'Fingerless Silk Gloves', 'Bone Helmet'],
291
+ },
281
292
  SocketGroup: 'W',
282
293
  Rarity: 'Rare',
283
294
  HasExplicitMod: { ope: '==', vals: ['Foo', 'Bar'] },
@@ -290,21 +301,24 @@ Unset "Section6"
290
301
  SetBackgroundColor: { rgb: { r: 106, g: 107, b: 108 }, alpha: 202 },
291
302
  PlayAlertSound: { id: '2', volume: undefined },
292
303
  DisableDropSound: true,
293
- CustomAlertSound: { filePath: 'C\\foobar\\sound.mp3', volume: undefined },
304
+ CustomAlertSound: {
305
+ filePath: 'C\\foobar\\sound.mp3',
306
+ volume: undefined,
307
+ },
294
308
  MinimapIcon: { size: 'Medium', color: 'Red', shape: 'Circle' },
295
309
  PlayEffect: { color: 'Blue', temp: true },
296
310
  },
297
311
  branches: [],
298
312
  location: {
299
313
  start: {
300
- line: 54,
314
+ line: 56,
301
315
  column: 1,
302
- offset: 1514,
316
+ offset: 1600,
303
317
  },
304
318
  end: {
305
- line: 71,
319
+ line: 72,
306
320
  column: 1,
307
- offset: 2208,
321
+ offset: 2263,
308
322
  },
309
323
  },
310
324
  },
@@ -313,8 +327,14 @@ Unset "Section6"
313
327
  name: 'Section3',
314
328
  activity: 'Show',
315
329
  conditions: {
316
- HasExplicitMod: { numeric: { ope: '>=', val: 2 }, vals: ['Foo', 'Bar'] },
317
- HasEnchantment: { numeric: { ope: '>=', val: 2 }, vals: ['Foo', 'Bar'] },
330
+ HasExplicitMod: {
331
+ numeric: { ope: '>=', val: 2 },
332
+ vals: ['Foo', 'Bar'],
333
+ },
334
+ HasEnchantment: {
335
+ numeric: { ope: '>=', val: 2 },
336
+ vals: ['Foo', 'Bar'],
337
+ },
318
338
  HasInfluence: { ope: undefined, val: 'None' },
319
339
  },
320
340
  actions: {
@@ -327,14 +347,14 @@ Unset "Section6"
327
347
  branches: [],
328
348
  location: {
329
349
  start: {
330
- line: 71,
350
+ line: 72,
331
351
  column: 1,
332
- offset: 2208,
352
+ offset: 2263,
333
353
  },
334
354
  end: {
335
- line: 80,
355
+ line: 81,
336
356
  column: 1,
337
- offset: 2519,
357
+ offset: 2574,
338
358
  },
339
359
  },
340
360
  },
@@ -353,14 +373,14 @@ Unset "Section6"
353
373
  branches: [],
354
374
  location: {
355
375
  start: {
356
- line: 80,
376
+ line: 81,
357
377
  column: 1,
358
- offset: 2519,
378
+ offset: 2574,
359
379
  },
360
380
  end: {
361
- line: 86,
381
+ line: 87,
362
382
  column: 1,
363
- offset: 2739,
383
+ offset: 2794,
364
384
  },
365
385
  },
366
386
  },
@@ -377,14 +397,14 @@ Unset "Section6"
377
397
  branches: [],
378
398
  location: {
379
399
  start: {
380
- line: 86,
400
+ line: 87,
381
401
  column: 1,
382
- offset: 2739,
402
+ offset: 2794,
383
403
  },
384
404
  end: {
385
- line: 90,
405
+ line: 91,
386
406
  column: 1,
387
- offset: 2881,
407
+ offset: 2936,
388
408
  },
389
409
  },
390
410
  },
@@ -400,14 +420,14 @@ Unset "Section6"
400
420
  branches: [],
401
421
  location: {
402
422
  start: {
403
- line: 90,
423
+ line: 91,
404
424
  column: 1,
405
- offset: 2881,
425
+ offset: 2936,
406
426
  },
407
427
  end: {
408
- line: 93,
428
+ line: 94,
409
429
  column: 1,
410
- offset: 2987,
430
+ offset: 3042,
411
431
  },
412
432
  },
413
433
  },
package/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- sudo: false
3
- notifications:
4
- email: false
5
- language: node_js
6
- node_js:
7
- - "12"
8
- script:
9
- - yarn run lint
10
- - yarn run build
11
- - yarn run test
package/README.adoc DELETED
@@ -1,94 +0,0 @@
1
- :chapter-label:
2
- :icons: font
3
- :lang: en
4
- :sectanchors:
5
- :sectlinks:
6
- :sectnums:
7
- :sectnumlevels: 1
8
- :source-highlighter: highlightjs
9
- :toc: preamble
10
- :toclevels: 1
11
-
12
- = Advanced PoE Filter Parser image:https://img.shields.io/github/license/mashape/apistatus.svg["MIT", link="https://raw.githubusercontent.com/isuke/vscode-advanced-poe-filter/master/LICENSE"] image:https://travis-ci.org/isuke/advanced-poe-filter-parser.svg?branch=master["Build Status", link="https://travis-ci.org/isuke/advanced-poe-filter-parser"] image:https://img.shields.io/npm/v/advanced-poe-filter-parser.svg["npm",link="https://www.npmjs.com/package/advanced-poe-filter-parser"] image:https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg["git-consistent friendly",link="https://github.com/isuke/git-consistent"]
13
-
14
- Advanced PoE Filter is used by link:https://filter-of-kalandra.netlify.com/[Filter of Kalarandra].
15
-
16
- == Usage
17
-
18
- ```js
19
- import { parse, SyntaxError } from "advanced-poe-filter-parser"
20
-
21
- const script = [
22
- 'Show "Map Section"'
23
- ' Class "Maps"'
24
- ' MapTier > 3'
25
- ' SetBorderColor 250 251 252'
26
- ' PlayAlertSound 1 300'
27
- ''
28
- ' Fork "Rarity"'
29
- ' Show "Rare"'
30
- ' Rarity Rare'
31
- ' SetBackgroundColor 255 0 0 100'
32
- ''
33
- ' Hide "Magic"'
34
- ' Rarity Magic'
35
- ''
36
- ].join('\n')
37
-
38
- const object = parse(script)
39
- // [
40
- // {
41
- // id: '0003',
42
- // name: 'Map Section',
43
- // activity: 'Show',
44
- // conditions: {
45
- // Class: { ope: '=', vals: ['Maps'] },
46
- // MapTier: '> 3',
47
- // },
48
- // actions: {
49
- // SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
50
- // PlayAlertSound: { id: '1', volume: 300 },
51
- // },
52
- // branches: [
53
- // {
54
- // name: 'Rarity',
55
- // type: 'Fork',
56
- // blocks: [
57
- // {
58
- // id: '0001',
59
- // name: 'Rare',
60
- // activity: 'Show',
61
- // conditions: { Rarity: 'Rare' },
62
- // actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
63
- // branches: [],
64
- // location: {
65
- // start: { line: 8, column: 9, offset: 135 },
66
- // end: { line: 12, column: 1, offset: 215 },
67
- // },
68
- // },
69
- // {
70
- // id: '0002',
71
- // name: 'Magic',
72
- // activity: 'Hide',
73
- // conditions: { Rarity: 'Magic' },
74
- // actions: {},
75
- // branches: [],
76
- // location: {
77
- // start: { line: 12, column: 9, offset: 223 },
78
- // end: { line: 14, column: 1, offset: 261 },
79
- // },
80
- // },
81
- // ],
82
- // location: {
83
- // start: { line: 7, column: 5, offset: 113 },
84
- // end: { line: 14, column: 1, offset: 261 },
85
- // },
86
- // },
87
- // ],
88
- // location: {
89
- // start: { line: 1, column: 1, offset: 0 },
90
- // end: { line: 14, column: 1, offset: 261 },
91
- // },
92
- // },
93
- // ]
94
- ```
package/ava.config.js DELETED
@@ -1,3 +0,0 @@
1
- export default {
2
- require: ['esm'],
3
- }