tag_utils

A set of utilities for parsing and testing tags.

Description:
  • A set of utilities for parsing and testing tags.

Source:

Methods

(static) matcher(expression, tags)

Description:
  • Given a tag expression and a set of tags, evaluate whether the tags meet the expression or not.

Source:
Example
matcher('luxury | clothing', ['clothing'])
=> true
matcher('luxury | clothing', ['alcohol'])
=> false
matcher('(food | ammo) luxury', ['ammo'])
=> false
matcher('(food | ammo) luxury', ['luxury', 'food'])
=> true
Parameters:
Name Type Description
expression String
tags Set

a set of tag strings to match against

Returns:

boolean true if the tags match the expression, false otherwise