just-demethodize
v3.2.0
Published
turn a method into a standalone function; the first arg becomes `this`
Downloads
18
Maintainers
Readme
just-demethodize
Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.
npm install just-demethodize
yarn add just-demethodize
Turn a method into a standalone function; the first arg becomes this
import demethodize from 'just-demethodize';
const trimFn = demethodize(''.trim);
['hello ', ' goodbye', 'hello again'].map(trimFn); // ['hello', 'goodbye', 'hello again']