1.0.5 • Published 3 years ago

iotdb-match v1.0.5

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
3 years ago

iotdb-match

match objects against templates

example

The template is the first argument. The thing you're testing - the event - is the second argument

Exact Match

const matcher = require("iotdb-match")

## true
matcher.match({
    first: "David",
    last: "Janes",
}, {
    first: "David",
    last: "Janes",
    height: 180,
})

Glob Match

const matcher = require("iotdb-match")

## true
matcher.match({
    first: "*",
    last: "Janes",
}, {
    first: "David",
    last: "Janes",
    height: 180,
})

Array Match

const matcher = require("iotdb-match")

## true
matcher.match({
    first: [ "David", "John", "Jacqui", ],
    last: "Janes",
}, {
    first: "David",
    last: "Janes",
    height: 180,
})
1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago