Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bind-it

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bind-it

convert between data-first/last and ::

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

bind-it Build Status

convert between data-first/last and ::

This is a converter function to make a data-first and data-last function working with function-bind-operator

Install

$ npm install --save bind-it

Usage

import { bindFirst, bindLast } from 'bind-it';

const data = { id: 1, name: 'foo' };

const hasPropFirst = (data, prop) => !!data[prop];
const hasThisFirst = hasPropFirst::bindFirst()


assert.strictEqual(data::hasThisFirst('name'), true);
assert.strictEqual(data::hasThisFirst('nope'), false);


const hasPropLast = (prop, data) => !!data[prop];
const hasThisLast = hasPropLast::bindLast()

assert.strictEqual(data::hasThisLast('name'), true);
assert.strictEqual(data::hasThisLast('nope'), false);

:: huh?

If you’re wondering what the :: thing means, you’d better read this excellent overview by @jussi-kalliokoski or have a look at the function bind syntax proposal.

License

MIT © Stoeffel

Keywords

FAQs

Package last updated on 03 Aug 2015

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