0.0.2 • Published 6 years ago

purified v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

purified donate Coverage Status License: ISC

Purity and safety for methods invokes.

The power of Reflect.apply brought through natural arguments order to every JS engine.

purified(context, method, args)

const $ = require('purified');

// trap ASAP methods to trust
const trim = ''.trim;
const fromCharCode = String.fromCharCode;
const hasOwnProperty = {}.hasOwnProperty;

// whenever is needed, you can trust your code
console.log(
  $(' abc ', trim),                 // "abc"
  $({z: 9}, hasOwnProperty, ['z']), // true
  $(String, fromCharCode, [79, 75]) // "OK
);