UNPKG

froebel

Version:
25 lines (21 loc) 539 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Turns `fun` into a unary function (a function that only accepts one * argument). * * Note: `fun` must accept at least one argument and must not require more than * one argument. * * @example * ``` * ['1', '2', '3'].map(unary(parseInt)) // -> [1, 2, 3] * ``` */ const unary = fun => arg => fun(arg); var _default = unary; exports.default = _default; module.exports = Object.assign(exports.default || {}, exports);