Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

f-bind

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

f-bind

Library mimicking the proposed function-bind operator

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

F-bind

Library mimicking the proposed function-bind operator (::)

Using bind operator

const {unique} = require('some-array-extras-lib')
console.log(
  [1, 2, 2, 4]
  ::unique() // call custom method
  .filter(n => n % 2 == 0) // call native method
  .map(n => n * 10)
) // prints [20, 40]

Using f-bind library

const {unique} = require('some-array-extras-lib')
const $ = require('f-bind')
console.log(
  $([1, 2, 2, 4]) // wrap
  .$(unique)() // call custom method
  .$('filter')(n => n % 2 == 0) // call native method
  .$('map')(n => n * 10)
  .$() // unwrap
) // prints [20, 40]

Keywords

function

FAQs

Package last updated on 22 Nov 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