2.2.0 • Published 5 years ago

taxonify v2.2.0

Weekly downloads
21
License
ISC
Repository
github
Last release
5 years ago

taxonify

Categorize your stuff

Quick start

You need some categories, define them like this:

function relationships (define) {
  define('automobile', ['car', 'truck'])
  define('car', ['camry', 'accord'])
  define('truck', ['ridgeline', 'tacoma'])
  define('honda', ['accord', 'ridgeline'])
  define('toyota', ['camry', 'tacoma'])
}

Now hand the relationships function to taxonify

import { taxonify } from 'taxonify'

const { createVerifier, brand } = taxonify(relationships)

Make a verifier function (or two)

const isTruck = createVerifier('truck')
const isHonda = createVerifier('honda')

Brand an object with one of your categories

const myAccord = brand({ color: red, sunroof: true }, 'accord')

And you're ready to verify your object

isTruck(myAccord) // false
isHonda(myAccord) // true
2.2.0

5 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago