1.0.2 • Published 7 years ago

is-regalia v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

Build Status JavaScript Style Guide

is-regalia

Validates regalia

Why?

To make it easy writing regalia tests.

How?

By traversing the provided tree and returning early on negatives.

Usage

Example

const regalia = require('regalia')
const isRegalia = require('is-regalia')

const constants = regalia({
  a: ['one, two'],
  b: ['one, two']
})

isRegalia(constants) // true

isRegalia({ a: Symbol('b') }) // false
isRegalia({ a: { one: Symbol('a.two') } }) // false
isRegalia({ a: Symbol.for('a') }) // false
isRegalia('foo') // false
isRegalia(Symbol()) // false

API

isRegalia(subject)

  • subject: the value you wish to validate

Synchronously returns result boolean.