Skip to content

Check passed settings object and throw error if there are problems.

License

Notifications You must be signed in to change notification settings

jadesrochers/checksettings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check Settings

Checks whether a settings object has the settings defined by and.

Whats the Use?

I found that I kept using code along these lines for checking arguments, so
I split it out into a little package.

installation

npm install @jadesrochers/checksettings

const check = require('@jadesrochers/checksettings')

Usage

let reqArray = ['names','of','keys','to','check']
let inputfail = {actual:1, object:2, passed:3, as:4, input:5}
let inputpass = {names:1, of:2, keys:3, to:4, check:5}
check.checkSettings(reqArray, inputfail)
false
check.checkSettings(reqArray, inputpass)
true 

About

Check passed settings object and throw error if there are problems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published