advanced-poe-filter-parser 0.9.0 → 0.9.2
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/README.md +2 -2
- package/lib/parser.cjs +803 -773
- package/lib/parser.d.ts +57 -39
- package/lib/parser.mjs +6364 -0
- package/package.json +5 -1
- package/src/advanced-poe-filter.pegjs +6 -8
- package/.eslintrc +0 -17
- package/.git_consistent +0 -80
- package/.gitcommit_template +0 -3
- package/.github/workflows/main.yml +0 -32
- package/.node-version +0 -1
- package/.prettierrc.json +0 -11
- package/.vscode/settings.json +0 -17
- package/test/parser.test.js +0 -1173
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "advanced-poe-filter-parser",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"path-of-exile",
|
|
6
6
|
"filter-of-kalandra",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"private": false,
|
|
17
17
|
"type": "module",
|
|
18
|
+
"files": [
|
|
19
|
+
"lib",
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
18
22
|
"scripts": {
|
|
19
23
|
"lint": "eslint test/**/*.js",
|
|
20
24
|
"lint:fix": "eslint --fix test/**/*.js",
|
|
@@ -87,7 +87,7 @@ condition =
|
|
|
87
87
|
/ conditionItemLevel
|
|
88
88
|
/ conditionAreaLevel
|
|
89
89
|
/ conditionGemLevel
|
|
90
|
-
/
|
|
90
|
+
/ conditionTransfiguredGem
|
|
91
91
|
/ conditionStackSize
|
|
92
92
|
/ conditionMapTier
|
|
93
93
|
/ conditionQuality
|
|
@@ -122,7 +122,6 @@ condition =
|
|
|
122
122
|
/ conditionHasEnchantment
|
|
123
123
|
/ conditionHasInfluence
|
|
124
124
|
/ conditionEnchantmentPassiveNode
|
|
125
|
-
/ conditionAlternateQuality
|
|
126
125
|
/ conditionReplica
|
|
127
126
|
/ conditionArchnemesisMod
|
|
128
127
|
/ conditionHasCruciblePassiveTree
|
|
@@ -134,13 +133,13 @@ conditionDropLevel = attr:'DropLevel' __ val:condition
|
|
|
134
133
|
conditionItemLevel = attr:'ItemLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
135
134
|
conditionAreaLevel = attr:'AreaLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
136
135
|
conditionGemLevel = attr:'GemLevel' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
137
|
-
|
|
136
|
+
conditionTransfiguredGem = attr:'TransfiguredGem' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
|
|
138
137
|
conditionStackSize = attr:'StackSize' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
139
138
|
conditionMapTier = attr:'MapTier' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
140
139
|
conditionQuality = attr:'Quality' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
141
140
|
conditionLinkedSockets = attr:'LinkedSockets' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
142
|
-
conditionSockets = attr:'Sockets' __ val:
|
|
143
|
-
conditionSocketGroup = attr:'SocketGroup' __ val:
|
|
141
|
+
conditionSockets = attr:'Sockets' __ val:conditionValueSocketType { return { lineType: 'condition', attr, val} }
|
|
142
|
+
conditionSocketGroup = attr:'SocketGroup' __ val:conditionValueSocketType { return { lineType: 'condition', attr, val} }
|
|
144
143
|
conditionRarity = attr:'Rarity' __ val:conditionValueRarity { return { lineType: 'condition', attr, val} }
|
|
145
144
|
conditionBaseDefencePercentile = attr:'BaseDefencePercentile' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
146
145
|
conditionBaseArmour = attr:'BaseArmour' __ val:conditionValueNumber { return { lineType: 'condition', attr, val} }
|
|
@@ -169,7 +168,6 @@ conditionAnyEnchantment = attr:'AnyEnchantment' __ val:condition
|
|
|
169
168
|
conditionHasEnchantment = attr:'HasEnchantment' __ val:conditionValueNumericAndArray { return { lineType: 'condition', attr, val} }
|
|
170
169
|
conditionHasInfluence = attr:'HasInfluence' __ val:conditionValueArrayOrNone { return { lineType: 'condition', attr, val} }
|
|
171
170
|
conditionEnchantmentPassiveNode = attr:'EnchantmentPassiveNode' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
|
|
172
|
-
conditionAlternateQuality = attr:'AlternateQuality' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
|
|
173
171
|
conditionReplica = attr:'Replica' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
|
|
174
172
|
conditionArchnemesisMod = attr:'ArchnemesisMod' __ val:conditionValueArray { return { lineType: 'condition', attr, val} }
|
|
175
173
|
conditionHasCruciblePassiveTree = attr:'HasCruciblePassiveTree' __ val:conditionValueBoolean { return { lineType: 'condition', attr, val} }
|
|
@@ -180,7 +178,7 @@ conditionValueArray = operator:(matchOperator __)? names:names { return operator
|
|
|
180
178
|
conditionValueArrayOrNone = conditionValueArray / val:'None' { return val ? { ope: undefined, val: 'None' } : { ope, vals } }
|
|
181
179
|
conditionValueNumericAndArray = pre:((numOperator __ num __) / (matchOperator __))? names:names { return pre ? (pre.length === 4 ? { numeric: { ope: pre[0], val: pre[2] }, vals: names } : { ope: pre[0], vals: names } ) : { ope: '=', vals: names } }
|
|
182
180
|
conditionValueNumber = operator:numOperator __ num:num { return `${operator} ${num}` }
|
|
183
|
-
|
|
181
|
+
conditionValueSocketType = operator:(numOperator __)? num:(num)? socketType:socketType { return operator ? `${operator[0]} ${num ? num : ''}${socketType}` : `= ${num ? num : ''}${socketType}` }
|
|
184
182
|
conditionValueRarity = operator:(numOperator __)? rarity:rarity { return operator ? `${operator[0]} ${rarity}` : rarity }
|
|
185
183
|
conditionValueBoolean = boolean
|
|
186
184
|
|
|
@@ -263,7 +261,7 @@ color = r:rgbaNum __ g:rgbaNum __ b:rgbaNum alpha:(__ rgbaNum)? { return { rgb:
|
|
|
263
261
|
numOperator = '<=' / '>=' / '<' / '>' / '='
|
|
264
262
|
matchOperator = '==' / '='
|
|
265
263
|
rarity = 'Normal' / 'Magic' / 'Rare' / 'Unique'
|
|
266
|
-
|
|
264
|
+
socketType = $('R'* 'G'* 'B'* 'W'* 'A'* 'D'*)
|
|
267
265
|
rgbaNum = num:num &{ return 0 <= num && num <= 255 } { return num }
|
|
268
266
|
fontSize = num:num &{ return 18 <= num && num <= 45 } { return num }
|
|
269
267
|
minimapIconSize = val:('0' / '1' / '2' / 'Largest' / 'Medium' / 'Small') {
|
package/.eslintrc
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"es6": true,
|
|
4
|
-
"amd": true,
|
|
5
|
-
"node": true
|
|
6
|
-
},
|
|
7
|
-
"extends": ["eslint:recommended", "prettier"],
|
|
8
|
-
"parserOptions": {
|
|
9
|
-
"ecmaVersion": 2022,
|
|
10
|
-
"sourceType": "module"
|
|
11
|
-
},
|
|
12
|
-
"rules": {
|
|
13
|
-
"no-console": "off",
|
|
14
|
-
"no-control-regex": "off",
|
|
15
|
-
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }]
|
|
16
|
-
}
|
|
17
|
-
}
|
package/.git_consistent
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
type:
|
|
2
|
-
type: enum
|
|
3
|
-
required: true
|
|
4
|
-
description: 'commit type'
|
|
5
|
-
values:
|
|
6
|
-
-
|
|
7
|
-
name: feat
|
|
8
|
-
description: 'when implementing function'
|
|
9
|
-
-
|
|
10
|
-
name: fix
|
|
11
|
-
description: 'when fixing a bug'
|
|
12
|
-
-
|
|
13
|
-
name: refactor
|
|
14
|
-
description: 'when refactoring'
|
|
15
|
-
-
|
|
16
|
-
name: docs
|
|
17
|
-
description: 'when writing docs'
|
|
18
|
-
-
|
|
19
|
-
name: test
|
|
20
|
-
description: 'when adding tests'
|
|
21
|
-
-
|
|
22
|
-
name: chore
|
|
23
|
-
description: "when change other that don't modify code or test files"
|
|
24
|
-
-
|
|
25
|
-
name: remove
|
|
26
|
-
description: 'when removing function'
|
|
27
|
-
-
|
|
28
|
-
name: perf
|
|
29
|
-
description: 'when improving performance'
|
|
30
|
-
-
|
|
31
|
-
name: ci
|
|
32
|
-
description: 'when fixing the CI build'
|
|
33
|
-
-
|
|
34
|
-
name: sec
|
|
35
|
-
description: 'when dealing with security'
|
|
36
|
-
-
|
|
37
|
-
name: up
|
|
38
|
-
description: 'when upgrading dependencies'
|
|
39
|
-
-
|
|
40
|
-
name: down
|
|
41
|
-
description: 'when downgrading dependencies'
|
|
42
|
-
-
|
|
43
|
-
name: tada
|
|
44
|
-
description: 'when celebrating'
|
|
45
|
-
-
|
|
46
|
-
name: revert
|
|
47
|
-
description: 'when reverts a previous commit'
|
|
48
|
-
subject:
|
|
49
|
-
type: string
|
|
50
|
-
required: true
|
|
51
|
-
description: 'The subject contains succinct description of the change'
|
|
52
|
-
rules:
|
|
53
|
-
firstLetter: lower
|
|
54
|
-
dotAtEnd: false
|
|
55
|
-
nonAscii: false
|
|
56
|
-
issueKeyword:
|
|
57
|
-
type: branch
|
|
58
|
-
required: false
|
|
59
|
-
description: 'Github issue link'
|
|
60
|
-
regExp: 'issue([0-9]+)'
|
|
61
|
-
regExpFlag: 'i'
|
|
62
|
-
prefix: '(close #'
|
|
63
|
-
suffix: ")"
|
|
64
|
-
issueLink:
|
|
65
|
-
type: branch
|
|
66
|
-
required: false
|
|
67
|
-
description: 'Github issue link'
|
|
68
|
-
regExp: 'issue([0-9]+)'
|
|
69
|
-
regExpFlag: 'i'
|
|
70
|
-
prefix: 'https://github.com/isuke/git-consistent/issues/'
|
|
71
|
-
suffix: "\n"
|
|
72
|
-
body:
|
|
73
|
-
type: text
|
|
74
|
-
default: ''
|
|
75
|
-
required: false
|
|
76
|
-
description: 'The body contains details of the change'
|
|
77
|
-
rules:
|
|
78
|
-
firstLetter: upper
|
|
79
|
-
dotAtEnd: true
|
|
80
|
-
nonAscii: false
|
package/.gitcommit_template
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: Test and Lint
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
test:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
|
|
9
|
-
strategy:
|
|
10
|
-
matrix:
|
|
11
|
-
node-version: [16.x, 18.x, 20.x]
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
16
|
-
uses: actions/setup-node@v3
|
|
17
|
-
with:
|
|
18
|
-
node-version: ${{ matrix.node-version }}
|
|
19
|
-
cache: 'npm'
|
|
20
|
-
- run: npm install
|
|
21
|
-
- run: npm run build
|
|
22
|
-
- run: npm run test
|
|
23
|
-
lint:
|
|
24
|
-
runs-on: ubuntu-latest
|
|
25
|
-
steps:
|
|
26
|
-
- uses: actions/checkout@v3
|
|
27
|
-
- uses: actions/setup-node@v3
|
|
28
|
-
with:
|
|
29
|
-
node-version: 20.x
|
|
30
|
-
cache: 'npm'
|
|
31
|
-
- run: npm install
|
|
32
|
-
- run: npm run lint
|
package/.node-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20.5.0
|
package/.prettierrc.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
3
|
-
"editor.codeActionsOnSave": {
|
|
4
|
-
"source.fixAll.eslint": true
|
|
5
|
-
},
|
|
6
|
-
"editor.formatOnSave": false,
|
|
7
|
-
"cSpell.userWords": ["pegjs", "synthesised", "archnemesis"],
|
|
8
|
-
"[javascript]": {
|
|
9
|
-
"editor.formatOnSave": true
|
|
10
|
-
},
|
|
11
|
-
"[json]": {
|
|
12
|
-
"editor.formatOnSave": true
|
|
13
|
-
},
|
|
14
|
-
"[typescript]": {
|
|
15
|
-
"editor.formatOnSave": true
|
|
16
|
-
}
|
|
17
|
-
}
|