Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

purified

WebReflection7ISC0.0.2

Purity and safety for methods invokes.

purity, safety, methods, trap, invoke, apply, Reflect

readme

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
);