https://github.com/isuke/advanced-poe-filter-parser
Advanced PoE Filter Parser
https://github.com/isuke/advanced-poe-filter-parser
filter-of-kalandra path-of-exile pathofexile pegjs
Last synced: 10 days ago
JSON representation
Advanced PoE Filter Parser
- Host: GitHub
- URL: https://github.com/isuke/advanced-poe-filter-parser
- Owner: isuke
- License: mit
- Created: 2019-05-07T08:12:57.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-12-23T23:00:22.000Z (5 months ago)
- Last Synced: 2025-04-01T05:30:42.824Z (about 2 months ago)
- Topics: filter-of-kalandra, path-of-exile, pathofexile, pegjs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/advanced-poe-filter-parser
- Size: 410 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advanced PoE Filter Parser [](https://github.com/isuke/advanced-poe-filter-parser/actions/workflows/main.yml) [](https://github.com/isuke/git-consistent) [](https://raw.githubusercontent.com/isuke/advanced-poe-filter-parser/main/LICENSE) [](https://www.npmjs.com/package/advanced-poe-filter-parser)
Advanced PoE Filter is used by [Filter of Kalandra](https://filter-of-kalandra.netlify.com/).
## Usage
```js
import { parse, SyntaxError } from "advanced-poe-filter-parser"const script = [
'Show "Map Section"'
' Class "Maps"'
' MapTier > 3'
' SetBorderColor 250 251 252'
' PlayAlertSound 1 300'
''
' Fork "Rarity"'
' Show "Rare"'
' Rarity Rare'
' SetBackgroundColor 255 0 0 100'
''
' Hide "Magic"'
' Rarity Magic'
''
].join('\n')const object = parse(script)
// [
// {
// id: '0003',
// name: 'Map Section',
// activity: 'Show',
// conditions: {
// Class: { ope: '=', vals: ['Maps'] },
// MapTier: { ope: '>', val: 3 },
// },
// actions: {
// SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
// PlayAlertSound: { id: '1', volume: 300 },
// },
// branches: [
// {
// name: 'Rarity',
// type: 'Fork',
// blocks: [
// {
// id: '0001',
// name: 'Rare',
// activity: 'Show',
// conditions: {
// Rarity: { ope: '=', val: 'Rare' },
// },
// actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
// branches: [],
// location: {
// start: { line: 8, column: 9, offset: 135 },
// end: { line: 12, column: 1, offset: 215 },
// source: undefined,
// },
// },
// {
// id: '0002',
// name: 'Magic',
// activity: 'Hide',
// conditions: {
// Rarity: { ope: '=', val: 'Magic' },
// },
// actions: {},
// branches: [],
// location: {
// start: { line: 12, column: 9, offset: 223 },
// end: { line: 14, column: 1, offset: 261 },
// source: undefined,
// },
// },
// ],
// location: {
// start: { line: 7, column: 5, offset: 113 },
// end: { line: 14, column: 1, offset: 261 },
// source: undefined,
// },
// },
// ],
// location: {
// start: { line: 1, column: 1, offset: 0 },
// end: { line: 14, column: 1, offset: 261 },
// source: undefined,
// },
// },
// ]
```