arc-flag-parser

2.0.0 • Public • Published

arc-flag-parser

ebay open source MIT licensed travisci build Codecov npm version downloads

Parse arc flag expressions to arrays of flag matches

Syntax

  • + represents AND
  • , represents OR
  • AND (+) has higher precedence than OR (,)
  • [] is used to increase the precedence of the wrapped group

Examples

import { parse } from 'arc-flag-parser';
parse('mobile+ios') // [ ['mobile', 'ios'] ]
import { parse } from 'arc-flag-parser';
parse('mobile,ios') // [ ['mobile'], ['ios'] ]
import { parse } from 'arc-flag-parser';
parse('mobile+[ios,android]') // [ ['mobile', 'ios'], ['mobile', 'android'] ]

See test.js for more examples

Readme

Keywords

none

Package Sidebar

Install

npm i arc-flag-parser

Weekly Downloads

67

Version

2.0.0

License

MIT

Unpacked Size

20.5 kB

Total Files

6

Last publish

Collaborators

  • mlrawlings
  • dylanpiercey