2.2.0 • Published 6 years ago

taxonify v2.2.0

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

6 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.2.0

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago