Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

to-bool-function

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-bool-function

Convert things to functions for use in some/filter/every etc.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

to-bool-function

Convert things to functions for use in some/filter/every etc.

Build Status Dependency Status NPM version

Installation

$ npm install to-bool-function

API

var fun = require('to-bool-function');

fun('isAdmin')({isAdmin: true})
// => true

fun('isAdmin', false)({isAdmin: true})
// => false

fun('name', 'Forbes')({name: 'Forbes'})
// => true

fun(/^\S+@\S+\.\S+$/)('forbes@component.io')
// => true

fun(/^\S+@\S+\.\S+$/)('forbescomponent.io')
// => false

fun('contact.email', /^\S+@\S+\.\S+$/)({contact: {email: 'forbes@component.io'}})
// => true

fun({contact: {realName: /\w+/,    email: /^\S+@\S+\.\S+$/}})
   ({contact: {realName: 'Forbes', email: 'forbes@component.io'}})
// => true

License

MIT

FAQs

Package last updated on 28 Jun 2013

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