New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

checkey

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkey

Check Keys existence with whitelist, like rails/strong_parameters.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53
increased by32.5%
Maintainers
1
Weekly downloads
 
Created
Source

ChecKey

Check Keys existence with whitelist, like rails/strong_parameters.

CircleCI

Usage

var checkey = require('checkey')

// define schema which require "name", permit "name" & "web" & "mail"
var schema = {
  require: ['name'],
  permit: ['web', 'mail']
}

// valid object
var result1 = checkey({
  name: 'shokai'
}, schema)
console.log('result1 is valid => ', result1.isValid) // true

// valid object
var result2 = checkey({
  name: 'shokai',
  web: 'http://shokai.org',
  mail: 'hashimoto@shokai.org'
}, schema)
console.log('result2 is valid => ', result2.isValid) // true

// invalid object ... "name" is required, "fullname" is not pemited
var result3 = checkey({
  fullname: 'Sho Hashimoto',
  web: 'http://shokai.org',
  mail: 'hashimoto@shokai.org'
}, schema)
console.log('result3 is valid => ', result3.isValid) // false
console.log(result3.errors) // [ 'require "name"', 'not permit "fullname"' ]

Develop

install dependencies

% npm install

build

% npm run build
or
% npm run watch

test

% npm test

Keywords

FAQs

Package last updated on 19 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc