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

whitelister

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whitelister

Simple, basic filtering and validation tool for Node.js.

  • 0.1.0-beta2
  • beta
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Whitelister

Simple, dependency-free filtering and validation tool for Node.js and the browser.

Build Status

Quick Start

Node.js

Using yarn:

yarn add whitelister@latest

Using npm:

npm i --save whitelister@latest

const whitelister = require('whitelister');

const rules = {
  q: 'string',
  page: { type: 'integer', min: 1, default: 1 },
  per_page: { type: 'integer', min: 1, max: 100, default: 20 },
};

const params = { q: 'hello' };

return whitelister(rules, params);
// => { page: 1, per_page: 20, q: 'hello' };
Browser
<script src="https://unpkg.com/whitelister@latest/dist/whitelister.js" />
# or the minified version
<script src="https://unpkg.com/whitelister@latest/dist/whitelister.min.js" />

<script>
  var rules = {
    q: 'string',
    page: { type: 'integer', min: 1, default: 1 },
    per_page: { type: 'integer', min: 1, max: 100, default: 20 },
  };

  var params = { q: 'hello' };

  var result = whitelister.sync(rules, params);
</script>

Documentation

You can find the full documentation on the website: https://spireteam.github.io/whitelister/

License

MIT

Changelog

v0.0.5

Oct. 25, 2017
  • Ignore non-required properties with undefined values
  • Treat external errors differently than internal errors

v0.0.4

Oct. 16, 2017
  • Ensure that type is treated like other attributes

Keywords

FAQs

Package last updated on 31 Oct 2017

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