1.0.5 • Published 6 years ago

iotdb-match v1.0.5

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
6 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

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

9 years ago

1.0.1

9 years ago