UNPKG

stick-js

Version:

Fast toolkit for functional programming in JS. Provides idioms for referentially transparent expressions, clear separation of mutable and immutable operations, object factories, function calls based on English grammar, and pipe & compose operators.

1 lines 2.48 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.withFilter=exports.toPairs=exports.remapValuesWithFilter=exports.remapValues=exports.remapTuplesWithFilter=exports.remapTuples=exports.remapKeysWithFilter=exports.remapKeys=exports.mapValuesWithFilter=exports.mapValues=exports.mapTuplesWithFilter=exports.mapTuples=exports.mapKeysWithFilter=exports.mapKeys=exports.fromPairs=void 0;var _curry=require("./curry.js");var _mapManual=require("./map-manual.js");var remapKeys=exports.remapKeys=(0,_curry.recurry)(2)(_mapManual.remapKeys);var remapKeysWithFilter=exports.remapKeysWithFilter=(0,_curry.recurry)(3)(_mapManual._remapKeysWithFilter);var remapValues=exports.remapValues=(0,_curry.recurry)(2)(_mapManual.remapValues);var remapValuesWithFilter=exports.remapValuesWithFilter=(0,_curry.recurry)(3)(_mapManual._remapValuesWithFilter);var remapTuples=exports.remapTuples=(0,_curry.recurry)(2)(_mapManual.remapTuples);var remapTuplesWithFilter=exports.remapTuplesWithFilter=(0,_curry.recurry)(3)(_mapManual._remapTuplesWithFilter);var mapKeys=exports.mapKeys=(0,_curry.recurry)(2)(_mapManual.mapKeys);var mapKeysWithFilter=exports.mapKeysWithFilter=(0,_curry.recurry)(3)(_mapManual._mapKeysWithFilter);var mapValues=exports.mapValues=(0,_curry.recurry)(2)(_mapManual.mapValues);var mapValuesWithFilter=exports.mapValuesWithFilter=(0,_curry.recurry)(3)(_mapManual._mapValuesWithFilter);var mapTuples=exports.mapTuples=(0,_curry.recurry)(2)(_mapManual.mapTuples);var mapTuplesWithFilter=exports.mapTuplesWithFilter=(0,_curry.recurry)(3)(_mapManual._mapTuplesWithFilter);var fromPairs=exports.fromPairs=_mapManual.fromPairs;var toPairs=exports.toPairs=_mapManual.toPairs;var withFilter=exports.withFilter=(0,_curry.recurry)(2)(function(p){return function(mapper){var f=_withFilter.get(mapper);if(f==null)throw new Error('cannot augment mapper');return f(p);};});var _withFilter=new Map().set(remapKeys,remapKeysWithFilter).set(_mapManual.remapKeys,_mapManual._remapKeysWithFilter).set(remapValues,remapValuesWithFilter).set(_mapManual.remapValues,_mapManual._remapValuesWithFilter).set(remapTuples,remapTuplesWithFilter).set(_mapManual.remapTuples,_mapManual._remapTuplesWithFilter).set(mapKeys,mapKeysWithFilter).set(_mapManual.mapKeys,_mapManual._mapKeysWithFilter).set(mapValues,mapValuesWithFilter).set(_mapManual.mapValues,_mapManual._mapValuesWithFilter).set(mapTuples,mapTuplesWithFilter).set(_mapManual.mapTuples,_mapManual._mapTuplesWithFilter);