{"_id":"fpu","_rev":"39-e637c28cfc8628c81262187663b8dd9c","name":"fpu","description":"Functional programming utilities","dist-tags":{"latest":"0.3.8"},"versions":{"0.3.7":{"author":{"name":"@littlepsylo"},"name":"fpu","version":"0.3.7","description":"Functional programming utilities","devDependencies":{"babel-cli":"~6.24.1","babel-loader":"~7.1.0","babel-plugin-transform-async-generator-functions":"~6.24.1","babel-plugin-transform-async-to-generator":"~6.24.1","babel-plugin-transform-class-properties":"~6.24.1","babel-plugin-transform-object-rest-spread":"~6.23.0","babel-polyfill":"~6.23.0","babel-preset-es2015":"~6.24.1","babel-register":"~6.24.1","expect":"~1.20.2","mocha":"~3.5.0","webpack":"~3.4.1"},"scripts":{"build":"NODE_ENV=prd webpack -p --colors --progress","test":"mocha --compilers js:babel-core/register --check-leaks test/index.js"},"gitHead":"55ddeae41e2ce1cc06f45e7946cc0b3a9d7a5a62","_id":"fpu@0.3.7","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"littlepsylo","email":"littlepsylo@gmail.com"},"dist":{"integrity":"sha512-xdMfRKU+gXSkdjxrOcK9xuuQlahA0L5EjA8sNlIMtCfJ07YXKgYR6kLuqRSDcbPh02ttuxwtN8svel+DG5WqVQ==","shasum":"755f3756751d1bb38e380ce0b8dd955ce7385040","tarball":"https://registry.npmjs.org/fpu/-/fpu-0.3.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJcrRH5T6B2ZPBiaYDzbJm0mvDm4oPeEXSRx5/YmZsvQIgWtSbK0Wy8u/VsbY1AvNY6Dk3KL/9gj/juk244CfNQ0I="}]},"maintainers":[{"name":"littlepsylo","email":"littlepsylo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fpu-0.3.7.tgz_1501740929376_0.7604565634392202"},"directories":{}},"0.3.8":{"author":{"name":"@littlepsylo"},"name":"fpu","version":"0.3.8","description":"Functional programming utilities","devDependencies":{"@babel/core":"^7.3.4","@babel/node":"^7.2.2","@babel/polyfill":"^7.2.5","@babel/preset-env":"^7.3.4","@babel/register":"^7.0.0","babel-loader":"^8.0.5","expect":"^24.5.0","mocha":"^6.0.2","webpack":"^4.29.6","webpack-cli":"^3.2.3"},"scripts":{"build":"webpack -p --colors --progress","test":"mocha --check-leaks test/index.js","start":"babel-node sandbox.js"},"gitHead":"d6089ab0a7b7c5d86afdfdbe4bfc1b2974af9d3a","_id":"fpu@0.3.8","_nodeVersion":"11.10.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yCI8O5k3OI37pxISsFDMrgBoF02dd3/LwHH/Vl6iW49ghmkxILnywdWE5QwO93DgXK/kgwim4V7zRQuJG2MOJg==","shasum":"3fef5cb39a26ccf7b7e51cad897eb4fab5dd2ca9","tarball":"https://registry.npmjs.org/fpu/-/fpu-0.3.8.tgz","fileCount":5,"unpackedSize":53998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckPK5CRA9TVsSAnZWagAAnC8QAJA4v1+cjREJS8Qnh67k\npBuLPIuKn7q7W2vza1CvOTRvhQWO7nRqju+TRrcU3S3eJgnbRvATlCNG94ti\nWiInToFhF7detqNh2NcVmNzxAcp+BMr0qhTKlK79pPEoN5JI6I4+LjjFOpHz\nSMwCivghe4qVZMUbkMVZvzwCIlW7//nwYiL1MyAIvv8Rmgap0hW8VUpcgMNT\n9Incr9EDnhnaJk/EK8eCAJeKIcjqEbOhZxfgqs0Mpja2r3vIWqFTSFE8qh6Q\ndwq1piAjpvbOhfobpmFi286XBgTGYJih1ZG1IvAZgKLUpilYQwZWz3NGQ0Rz\nLXgggKFsN2ehhodUwv1mf84dIqqQPTNnOA8QOPdNyAzGiG6bVgqAuArKbIvI\nltVDg8qcrEYc+Raxs6uPM6qr2+Zgor9fxgiqcZngmwYg9XYkwU5CWY4wKRFZ\nxRaEE45107iCXFwR/Ezd7bF1mOCHx7SOfxu7n7TroFJ/uDUkdESLpK8ScEHL\nfcq4EzB8Q+aOC43/emp/IHdJzwUcK5dlcS9eHEVvVImLnZDtUDfYL+pUIoOZ\nHIPFrYe+9opaNQpgWNCfqt/ZjR/8Am2flwRKESRm9eFghff3zJ+XSwFh9ae8\nG7isJf4I6K2/XcBKANq5eKsb6lp3uDaZV87CAvqHzzUfw8kfBTXZKv6/E3wg\n83h1\r\n=SPDM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7dI+sly6xUPOZu8ermsDBmlKliNlZ53zZELOSvbiW0gIgI/T0P4cHYrTXy6tpk+h+tht7jSFdb82f2Cs0O9ivyCM="}]},"maintainers":[{"name":"littlepsylo","email":"littlepsylo@gmail.com"}],"_npmUser":{"name":"littlepsylo","email":"littlepsylo@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fpu_0.3.8_1553003192271_0.35509620904047856"},"_hasShrinkwrap":false}},"readme":"# FPU\nFunctional programming utilities\n\n## Changelog\n### 0.3.8 (latest)\n> Upgrade babel, webpack and co, remove browser build\n\n### 0.3.7\n> Fix Factories::reduce and Immutables\n\n### 0.3.0\n> Add Factories\n\n### 0.2.0\n> Add Immutables\n\n### 0.1.0\n> Initial release : Curries, Functions, Helpers, Predicates & Types\n\n## Requirement\n> node >= 6\n\n## Installation\n```bash\nnpm install fpu\n```\n\n## Documentation\n### Usage\n```js\n// ES6-\nconst {\n  Curries,\n  Factories,\n  Functions,\n  Helpers,\n  Immutables,\n  Predicates,\n  Types\n} = require('fpu')\n\n// ES6+\nimport {\n  Curries,\n  Factories,\n  Functions,\n  Helpers,\n  Immutables,\n  Predicates,\n  Types\n} from 'fpu'\n```\n\n### Helpers\n#### apply\nPartial application\n```js\nimport { Functions, Helpers } from 'fpu'\n\nconst inc = Helpers.apply( Functions.add, 1 )\n\ninc( 4 )\n// 5\n```\n\n#### compose\nRight to left function composition\n```js\nimport { Functions, Helpers } from 'fpu'\n\nconst { add, multiply } = Functions,\n      dbl = Helpers.apply( multiply, 2 ),\n      inc = Helpers.apply( add, 1 )\n\nconst addIncThenDbl = Helpers.compose( dbl, inc, add )\n\naddIncThenDbl( 1, 2 )\n// 8\n```\n\n#### curry\nFunction currying\n```js\nimport { Functions, Helpers } from 'fpu'\n\nconst curriedAdd = Helpers.curry( Functions.add ),\n      add5 = curriedAdd( 5 )\n\ncurriedAdd( 1, 2 )\n// 3\n\nadd5( 3 )\n// 8\n```\n\n#### pipe\nLeft to right function composition\n```js\nimport { Functions, Helpers } from 'fpu'\n\nconst { add, multiply } = Functions,\n      dbl = Helpers.apply( multiply, 2 ),\n      inc = Helpers.apply( add, 1 )\n\nconst addIncThenDbl = Helpers.pipe( add, inc, dbl )\n\naddIncThenDbl( 1, 2 )\n// 8\n```\n\n### Immutables\nImmutables always return an immutable.\n#### array\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables( [] )\n\n// or\n\nconst a = Immutables()\n```\n\n##### append\nAppend items\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx' ])\n\na.append( 'doh', 'woo' )\n// [ 'foo', 'bar', 'qnx', 'doh', 'woo' ]\n```\n\n##### insert\nInsert item(s) at a position\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx' ])\n\na.insert( 2, 'doh', 'woo' )\n// [ 'foo','bar', 'doh', 'woo', 'qnx' ]\n```\n\n##### length\nLength of the array\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx' ])\n\na.length\n// 3\n```\n\n##### prepend\nPrepend item(s)\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx' ])\n\na.prepend( 'doh', 'woo' )\n// [ 'doh', 'woo', 'foo', 'bar', 'qnx' ]\n```\n\n##### remove\nRemove item(s) with position(s) and/or value(s)\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx', 'woo' ])\n\na.remove( 1 )\n// [ 'foo', 'qnx', woo' ]\n\na.remove( 1, 2 )\n// [ 'foo', woo' ]\n\na.remove( 'bar' )\n// [ 'foo', 'qnx', woo' ]\n\na.remove( 'bar', 'qnx' )\n// [ 'foo', 'woo' ]\n\na.remove( 'bar', 3 )\n// [ 'foo', 'qnx' ]\n```\n\n##### replace\nReplace item(s) from a position\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx', 'woo' ])\n\na.replace( 1, null, null )\n// [ 'foo', null, null, 'qnx', 'woo' ]\n```\n\n##### sort\nAka quick sort\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'woo', 'foo', 'doh', 'qnx', 'bar' ])\n\na.sort()\n// [ 'bar', 'doh', 'foo', 'qnx', 'woo' ]\n\na.sort( true )\n// [ 'woo', 'qnx', 'foo', 'doh', 'bar' ]\n```\n\n##### unique\nOnly unique values\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 17, 43, 10, 51, 10, 43, 28 ])\n\na.unique()\n// [ 17, 43, 10, 51, 28 ]\n```\n\n##### value\nReturn array's value\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables([ 'foo', 'bar', 'qnx' ])\n\na.value\n// [ 'foo', 'bar', 'qnx' ]\n```\n\n#### object\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables( {} )\n```\n\n##### keys\nKeys of the object\n```js\nimport { Immutables } from 'fpu'\n\nconst o = Immutables({ foo: 'bar', qnx: null, hello: 'world' })\n\no.keys\n// [ 'foo', 'qnx', 'hello' ]\n```\n\n##### set\nAdd and/or update property's values\n```js\nimport { Immutables } from 'fpu'\n\nconst o = Immutables({ foo: 'bar', qnx: null, hello: 'world' })\n\no.set({ pid: 0 })\n// { foo: 'bar', qnx: null, hello: 'world', pid: 0 }\n\no.set({ qnx: 'doh' })\n// { foo: 'bar', qnx: 'doh', hello: 'world' }\n\no.set({ qnx: 'doh', pid: 0 })\n// { foo: 'bar', qnx: 'doh', hello: 'world', pid: 0 }\n```\n\n##### unset\nUnset properties\n```js\nimport { Immutables } from 'fpu'\n\nconst o = Immutables({ foo: 'bar', qnx: null, hello: 'world' })\n\no.unset( 'qnx', 'hello' )\n// { foo: 'bar' }\n```\n\n##### value\nReturn object's value\n```js\nimport { Immutables } from 'fpu'\n\nconst a = Immutables({ foo: 'bar', qnx: null, hello: 'world' })\n\na.value\n// { foo: 'bar', qnx: null, hello: 'world' }\n```\n\n### Factories\n#### filter\nArray.filter factory\n```js\nimport { Factories } from 'fpu'\n\nconst a = [ 0, 1, 2, 3, 4, 5 ]\nconst oddOnly = (v) => v % 2 === 1\nconst oddFilter = Factories.filter( oddOnly )\n\noddFilter( a )\n// [ 1, 3, 5 ]\n```\n\n#### map\nArray.map factory\n```js\nimport { Factories } from 'fpu'\n\nconst a = [ 0, 1, 2, 3, 4, 5 ]\nconst dbl = (v) => v * 2\nconst dblMap = Factories.map( dbl )\n\ndblMap( a )\n// [ 0, 2, 4, 6, 8, 10 ]\n```\n\n#### reduce\nArray.reduce factory\n```js\nimport { Factories } from 'fpu'\n\nconst items = [\n  { foo: 'bar', woo: null },\n  { qnx: true },\n  { woo: false }\n]\n\nconst merge = (a, b) => ({ ...a, ...b })\nconst mergeObj = Factories.reduce( merge )\n\nmergeObj( items )\n// { foo: 'bar', woo: false, qnx: true }\n```\n\n### Functions\nAll this functions have an arity of 2.\n> add, and, divide, multiply, or, substract\n\n### Predicates\nAll this functions have an arity of 2.\n> eq, gt, gte, lt, lte, not\n\n### Curries\nCurried functions and predicates, with an arity of 1.\n> add, and, divide, eq, gt, gte, lt, lte, multiply, not, or, substract\n\n### Types\nTypes detection's functions, with and arity of 1.\n> isArray, isboolean, isNull, isNumber, isObject, isString, isUndefined\n","maintainers":[{"name":"littlepsylo","email":"littlepsylo@gmail.com"}],"time":{"modified":"2022-05-02T21:03:15.359Z","created":"2017-07-28T14:48:55.687Z","0.0.1":"2017-07-28T14:48:55.687Z","0.0.2":"2017-07-28T14:53:13.620Z","0.0.3":"2017-07-28T14:58:38.406Z","0.0.4":"2017-07-28T15:10:04.906Z","0.0.5":"2017-07-28T15:29:10.888Z","0.1.0":"2017-07-28T18:28:30.213Z","0.1.2":"2017-07-28T20:06:26.316Z","0.1.3":"2017-07-28T20:07:36.011Z","0.1.4":"2017-07-28T21:23:45.396Z","0.1.5":"2017-07-28T22:47:30.180Z","0.1.6":"2017-07-28T22:59:37.664Z","0.3.0":"2017-08-02T08:20:52.421Z","0.3.1":"2017-08-02T08:24:09.665Z","0.3.2":"2017-08-02T08:25:08.228Z","0.3.3":"2017-08-02T08:26:42.497Z","0.3.4":"2017-08-02T08:27:13.761Z","0.3.5":"2017-08-02T08:57:32.310Z","0.3.6":"2017-08-02T09:54:03.800Z","0.3.7":"2017-08-03T06:15:30.426Z","0.3.8":"2019-03-19T13:46:32.509Z"},"author":{"name":"@littlepsylo"},"readmeFilename":"README.md","users":{"littlepsylo":true}}