1.0.16 • Published 8 months ago

match-conditions v1.0.16

Weekly downloads
55
License
MIT
Repository
github
Last release
8 months ago

match-conditions

Match a set of conditions for a collection of key-value pairs. Conditions are able to access nested keys.

Install

yarn add match-conditions

Usage

import { normalizeCondition, matchValuesWithCondition } from 'match-conditions'

// true
matchValuesWithCondition(
  normalizeCondition({
    a: '2'
  }),
  {
    a: '2'
  }
)

// false
matchValuesWithCondition(
  normalizeCondition({
    a: '3'
  }),
  {
    a: '2'
  }
)

// true
matchValuesWithCondition(
  normalizeCondition({
    any: {
      a: '3 | 2',
      b: 'c'
    }
  }),
  {
    a: '2',
    b: 'a'
  }
)
1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

2 years ago

1.0.11

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago