{"id":18711548,"url":"https://github.com/bitmap/fp","last_synced_at":"2026-01-20T08:07:55.029Z","repository":{"id":45173625,"uuid":"296346968","full_name":"bitmap/fp","owner":"bitmap","description":"Functional programming utils lib in TypeScript","archived":false,"fork":false,"pushed_at":"2024-06-25T18:56:48.000Z","size":1008,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T19:57:49.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitmap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-17T14:13:02.000Z","updated_at":"2024-06-25T18:56:53.000Z","dependencies_parsed_at":"2024-10-21T12:06:33.022Z","dependency_job_id":null,"html_url":"https://github.com/bitmap/fp","commit_stats":{"total_commits":175,"total_committers":2,"mean_commits":87.5,"dds":0.005714285714285672,"last_synced_commit":"970aa363e243c38f37dbc0b4d80779d7f0cd88ba"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/bitmap/fp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Ffp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Ffp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Ffp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Ffp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitmap","download_url":"https://codeload.github.com/bitmap/fp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Ffp/sbom","scorecard":{"id":240381,"data":{"date":"2025-08-11","repo":{"name":"github.com/bitmap/fp","commit":"970aa363e243c38f37dbc0b4d80779d7f0cd88ba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish-package.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/bitmap/fp/publish-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/bitmap/fp/publish-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/bitmap/fp/publish-package.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish-package.yml:17","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T06:35:58.461Z","repository_id":45173625,"created_at":"2025-08-17T06:35:58.461Z","updated_at":"2025-08-17T06:35:58.461Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28598875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T12:39:26.936Z","updated_at":"2026-01-20T08:07:55.011Z","avatar_url":"https://github.com/bitmap.png","language":"TypeScript","readme":"# ƒp\n\nFunctional programming utilities for JavaScript.\n\n## Install\n\n```sh\nnpm install @bitmap/fp\n```\n\n## Functions\n\n**Arrays**\n\n- [reduce](#reduce)\n- [reduceRight](#reduceRight)\n- [map](#map)\n- [flat](#flat)\n- [flatMap](#flatMap)\n- [filter](#filter)\n- [filterMap](#filterMap)\n- [reject](#reject)\n- [rejectMap](#rejectMap)\n- [compact](#compact)\n- [concat](#concat)\n- [copy](#copy)\n- [slice](#slice)\n- [append](#append)\n- [prepend](#prepend)\n- [insert](#insert)\n- [insertAll](#insertAll)\n- [chunk](#chunk)\n- [reverse](#reverse)\n- [sort](#sort)\n- [first](#first)\n- [last](#last)\n- [drop](#drop)\n- [dropRight](#dropRight)\n- [dropFirst](#dropFirst)\n- [dropLast](#dropLast)\n- [take](#take)\n- [takeRight](#takeRight)\n- [any](#any)\n- [all](#all)\n- [find](#find)\n- [findLast](#findLast)\n- [includes](#includes)\n- [excludes](#excludes)\n- [position](#position)\n- [positionLast](#positionLast)\n- [groupBy](#groupBy)\n- [aperture](#aperture)\n\n**Objects**\n\n- [prop](#prop)\n- [pluck](#pluck)\n- [pick](#pick)\n- [omit](#omit)\n\n**Strings**\n\n- [split](#split)\n- [join](#join)\n- [reverse](#reverse)\n- [trim](#trim)\n\n**Math**\n\n- [add](#add)\n- [sum](#sum)\n- [multiply](#multiply)\n- [product](#product)\n- [subtract](#subtract)\n- [subtractBy](#subtractBy)\n- [divide](#divide)\n- [divideBy](#divideBy)\n- [clamp](#clamp)\n- [mean](#mean)\n- [median](#median)\n- [mode](#mode)\n- [remainder](#remainder)\n- [modulo](#modulo)\n\n**Utilities**\n\n- [compose](#compose)\n- [pipe](#pipe)\n- [curry](#curry)\n- [identity](#identity)\n- [isEqual](#isEqual)\n- [isTypeOf](#isTypeOf)\n  - [isBigInt](#isTypeOf)\n  - [isBoolean](#isTypeOf)\n  - [isFunction](#isTypeOf)\n  - [isNumber](#isTypeOf)\n  - [isObject](#isTypeOf)\n  - [isString](#isTypeOf)\n  - [isSymbol](#isTypeOf)\n  - [isUndefined](#isTypeOf)\n- [isArray](#isArray)\n- [isNull](#isNull)\n\n## reduce\n\nReduce values in a list according to a reducer function. `reduce` args are\ncurried.\n\n```js\nreduce(reducer, initialValue, list);\n```\n\n**Example**\n\n```js\nimport { reduce } from \"@bitmap/fp\";\n\nconst sum = (a, b) =\u003e a + b;\nconst items = [1, 2, 3, 4];\n\nreduce(sum, 0, items); // -\u003e 10\n```\n\n## reduceRight\n\nReduce values in a list according to a reducer function in reverse order.\n`reduceRight` args are curried.\n\n```js\nreduceRight(reducer, initialValue, list);\n```\n\n**Example**\n\n```js\nimport { reduceRight } from \"@bitmap/fp\";\n\nconst sum = (a, b) =\u003e a + b;\nconst items = [1, 2, 3, 4];\n\nreduceRight(sum, 0, items); // -\u003e 10\n```\n\n## map\n\nApply function to each items in a list, and return a new list. `map` args are\ncurried.\n\n```js\nmap(mapFunction, list);\n```\n\n**Example**\n\n```js\nimport { map } from \"@bitmap/fp\";\n\nconst double = (n) =\u003e n * 2;\nconst doubleAll = map(double);\n\ndoubleAll([1, 2, 3]); // -\u003e [2, 4, 6]\n```\n\n## flat\n\nReturn a flattened list.\n\n```js\nflat(list);\n```\n\n**Example**\n\n```js\nimport { flat } from \"@bitmap/fp\";\n\nflat([0, [1, 2], [3, 4], [5]]); // -\u003e [0, 1, 2, 3, 4, 5]\nflat([0, [1, 2, [3, 4, [5]]]]); // -\u003e [0, 1, 2, 3, 4, 5]\n```\n\n## flatMap\n\nApply function to each items in a list, and return a flattened list. `flatMap`\nargs are curried.\n\n```js\nflatMap(flatMapFunction, list);\n```\n\n**Example**\n\n```js\nimport { flatMap } from \"@bitmap/fp\";\n\nconst users = [\"@cabe\", \"@bitmap\"];\nconst indexUsers = flatMap((user, index) =\u003e [index, user]);\n\nindexUsers(users); // -\u003e [0, '@cabe', 1, '@bitmap']\n```\n\n## filter\n\nFilter items from a list, and return a new list. `filter` args are curried.\n\n```js\nfilter(predicate, list);\n```\n\n**Example**\n\n```js\nimport { filter } from \"@bitmap/fp\";\n\nconst isOdd = (n) =\u003e n % 2 !== 0;\nconst filterOdds = filter(isOdd);\n\nfilterOdds([1, 2, 3, 4]); // -\u003e [1, 3]\n```\n\n## filterMap\n\nApply filter and map to a list, and return a new list. `filterMap` args are\ncurried.\n\n```js\nfilterMap(predicate, mapFunction, list);\n```\n\n**Example**\n\n```js\nimport { filterMap } from \"@bitmap/fp\";\n\nconst isOdd = (n) =\u003e n % 2 !== 0;\nconst double = (n) =\u003e n * 2;\nconst doubleOdds = filterMap(isOdd, double);\n\ndoubleOdds([1, 2, 3, 4]); // -\u003e [3, 6]\n```\n\n## reject\n\nReject items from a list, and return a new list. The opposite of\n[filter](#filter). `reject` args are curried.\n\n```js\nreject(predicate, list);\n```\n\n**Example**\n\n```js\nimport { reject } from \"@bitmap/fp\";\n\nconst isOdd = (n) =\u003e n % 2 !== 0;\nconst rejectOdds = reject(isOdd);\n\nrejectOdds([1, 2, 3, 4]); // -\u003e [2, 4]\n```\n\n## rejectMap\n\nApply reject and map to a list, and return a new list. `rejectMap` args are\ncurried.\n\n```js\nrejectMap(predicate, mapFunction, list);\n```\n\n**Example**\n\n```js\nimport { rejectMap } from \"@bitmap/fp\";\n\nconst isOdd = (n) =\u003e n % 2 !== 0;\nconst double = (n) =\u003e n * 2;\nconst doubleEvens = rejectMap(isOdd, double);\n\ndoubleEvens([1, 2, 3, 4]); // -\u003e [4, 8]\n```\n\n## compact\n\nReturns list with all falsey values removed.\n\n```js\ncompact(list);\n```\n\n**Example**\n\n```js\nimport { compact } from \"@bitmap/fp\";\n\ncompact(0, 1, 2); // -\u003e [1, 2]\ncompact(\"\", \"hello\", \"\", \"world\", \"\"); // -\u003e [\"hello\", \"world\"]\n```\n\n## concat\n\nConcat `n` lists into one list.\n\n```js\nconcat(...lists);\n```\n\n**Example**\n\n```js\nimport { concat } from \"@bitmap/fp\";\n\nconst a = [1, 2, 3];\nconst b = [4, 5, 6];\n\nconcat(a, b); // -\u003e [1, 2, 3, 4, 5, 6]\n```\n\n## copy\n\nReturns a new copy of the list\n\n```js\ncopy(list);\n```\n\n**Example**\n\n```js\nimport { copy } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3];\n\ncopy(list); // -\u003e [1, 2, 3]\n```\n\n## slice\n\nReturn a sliced list. `slice` args are curried.\n\n```js\nslice(start, end, list);\n```\n\n**Example**\n\n```js\nimport { slice } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4, 5, 6];\n\nslice(2, 5, list); // -\u003e [3, 4, 5]\n```\n\n## append\n\nAppends item to the end of a list. Unlike `Array.prototype.push`, doesn't mutate\ntarget. `append` args are curried.\n\n```js\nappend(item, list);\n```\n\n**Example**\n\n```js\nimport { append } from \"@bitmap/fp\";\n\nconst list = [1, 2];\n\nappend(3, list); // -\u003e [1, 2, 3]\n```\n\n## prepend\n\nPrepends item to the beginning of a list. Unlike `Array.prototype.unshift`,\ndoesn't mutate target. `prepend` args are curried.\n\n```js\nprepend(item, list);\n```\n\n**Example**\n\n```js\nimport { prepend } from \"@bitmap/fp\";\n\nconst list = [1, 2];\n\nprepend(0, list); // -\u003e [0, 1, 2]\n```\n\n## insert\n\nInsert item into a list. Unlike `Array.prototype.splice`, doesn't mutate target.\n`insert` args are curried.\n\n```js\ninsert(start, item, list);\n```\n\n**Example**\n\n```js\nimport { insert } from \"@bitmap/fp\";\n\nconst list = [1, 3];\n\ninsert(1, 2, list); // -\u003e [1, 2, 3]\n```\n\n## insertAll\n\nInsert items into a list. Unlike `Array.prototype.splice`, doesn't mutate\ntarget. `insertAll` args are curried.\n\n```js\ninsertAll(start, items, list);\n```\n\n**Example**\n\n```js\nimport { insertAll } from \"@bitmap/fp\";\n\nconst list = [1, 4];\n\ninsertAll(1, [2, 3], list); // -\u003e [1, 2, 3, 4]\n```\n\n## chunk\n\nSplits a collection into slices of the specified length. `chunk` args are\ncurried.\n\n```js\nchunk(size, list);\n```\n\n**Example**\n\n```js\nimport { chunk } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4, 5];\n\nchunk(2, list); // -\u003e [[1, 2], [3, 4], [5]]\nchunk(3, list); // -\u003e [[1, 2, 3], [4, 5]]\n```\n\n## reverse\n\nReverse a string or items in a list. Unlike `Array.prototype.reverse`, doesn't\nmutate target.\n\n```js\nreverse(list);\n```\n\n**Example**\n\n```js\nimport { reverse } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\nreverse(list); // -\u003e [4, 3, 2, 1]\n\nconst string = \"functional\";\n\nreverse(string); // -\u003e 'lanoitcnuf'\n```\n\n## sort\n\nSorts items in a list according to comparator function. Unlike\n`Array.prototype.sort`, doesn't mutate target.\n\n```js\nsort(compareFunction, list);\n```\n\n**Example**\n\n```js\nimport { sort } from \"@bitmap/fp\";\n\nconst sortAscending = (a, b) =\u003e a - b;\nconst list = [40, 21, 32, 17];\n\nsort(sortAscending, list); // -\u003e [17, 21, 32, 40]\n```\n\n## first\n\nReturns first item in a list.\n\n```js\nfirst(list);\n```\n\n**Example**\n\n```js\nimport { first } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\nfirst(list); // -\u003e 1\n```\n\n## last\n\nReturns last item in a list.\n\n```js\nlast(list);\n```\n\n**Example**\n\n```js\nimport { last } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\nlast(list); // -\u003e 4\n```\n\n## drop\n\nDrops `n` items from left. `drop` args are curried.\n\n```js\ndrop(n, list);\n```\n\n**Example**\n\n```js\nimport { drop } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ndrop(2, list); // -\u003e [3, 4]\n```\n\n## dropRight\n\nDrops `n` items from right. `dropRight` args are curried.\n\n```js\ndropRight(n, list);\n```\n\n**Example**\n\n```js\nimport { dropRight } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ndropRight(2, list); // -\u003e [1, 2]\n```\n\n## dropFirst\n\nDrops first item from list.\n\n```js\ndropFirst(list);\n```\n\n**Example**\n\n```js\nimport { dropFirst } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ndropFirst(list); // -\u003e [2, 3, 4]\n```\n\n## dropLast\n\nDrops last item from list.\n\n```js\ndropLast(list);\n```\n\n**Example**\n\n```js\nimport { dropLast } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ndropLast(list); // -\u003e [1, 2, 3]\n```\n\n## take\n\nTakes `n` items from left. `take` args are curried.\n\n```js\ntake(n, list);\n```\n\n**Example**\n\n```js\nimport { take } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ntake(2, list); // -\u003e [1, 2]\n```\n\n## takeRight\n\nTakes `n` items from right. `takeRight` args are curried.\n\n```js\ntakeRight(n, list);\n```\n\n**Example**\n\n```js\nimport { takeRight } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4];\n\ntakeRight(2, list); // -\u003e [3, 4]\n```\n\n## any\n\nReturns true if any item in list meet the condition. `any` args are curried.\n\n```js\nany(predicate, list);\n```\n\n**Example**\n\n```js\nimport { any } from \"@bitmap/fp\";\n\nconst greaterThanTen = (x) =\u003e x \u003e 10;\nconst anyGreaterThanTen = any(greaterThanTen);\n\nanyGreaterThanTen([3, 5, 7, 9]); // -\u003e false\nanyGreaterThanTen([5, 20, 100]); // -\u003e true\n```\n\n## all\n\nReturns true if all item in list meet the condition. `all` args are curried.\n\n```js\nall(predicate, list);\n```\n\n**Example**\n\n```js\nimport { all } from \"@bitmap/fp\";\n\nconst greaterThanTen = (x) =\u003e x \u003e 10;\nconst allGreaterThanTen = all(greaterThanTen);\n\nallGreaterThanTen([3, 5, 7, 9]); // -\u003e false\nallGreaterThanTen([5, 20, 100]); // -\u003e false\nallGreaterThanTen([50, 15, 99]); // -\u003e true\n```\n\n## find\n\nReturns first item from list that meets predicate. `find` args are curried.\n\n```js\nfind(predicate, list);\n```\n\n**Example**\n\n```js\nimport { find } from \"@bitmap/fp\";\n\nconst greaterThanTen = (x) =\u003e x \u003e 10;\nconst findGreaterThanTen = find(greaterThanTen);\n\nfindGreaterThanTen([3, 5, 7, 9]); // -\u003e undefined\nfindGreaterThanTen([5, 20, 100]); // -\u003e 20\n```\n\n## findLast\n\nReturns last item from list that meets predicate. `findLast` args are curried.\n\n```js\nfindLast(predicate, list);\n```\n\n**Example**\n\n```js\nimport { findLast } from \"@bitmap/fp\";\n\nconst greaterThanTen = (x) =\u003e x \u003e 10;\nconst findLastGreaterThanTen = findLast(greaterThanTen);\n\nfindLastGreaterThanTen([3, 5, 7, 9]); // -\u003e undefined\nfindLastGreaterThanTen([5, 20, 100]); // -\u003e 100\n```\n\n## includes\n\nReturns true if item is in the list. `includes` args are curried.\n\n```js\nincludes(value, list);\n```\n\n**Example**\n\n```js\nimport { includes } from \"@bitmap/fp\";\n\nconst hasApple = includes(\"apple\");\n\nhasApple([\"orange\", \"banana\", \"pear\"]); // -\u003e false\nhasApple([\"kiwi\", \"apple\", \"coconut\"]); // -\u003e true\n```\n\n## excludes\n\nReturns true if item is not in the list. `excludes` args are curried.\n\n```js\nexcludes(value, list);\n```\n\n**Example**\n\n```js\nimport { excludes } from \"@bitmap/fp\";\n\nconst hasApple = excludes(\"apple\");\n\nhasApple([\"orange\", \"banana\", \"pear\"]); // -\u003e true\nhasApple([\"kiwi\", \"apple\", \"coconut\"]); // -\u003e false\n```\n\n## position\n\nReturn index of first found item in list. If arg is a predicate function,\nreturns index of the first item in a list that meets the condition. If no item\nmeets the criteria, it returns -1. `position` args are curried.\n\n```js\nposition(value, list);\nposition(predicate, list);\n```\n\n**Example**\n\n```js\nimport { position } from \"@bitmap/fp\";\n\nconst firstAppleIndex = position(\"apple\");\n\nfirstAppleIndex([\"orange\", \"banana\", \"pear\", \"lemon\"]); // -\u003e -1\nfirstAppleIndex([\"kiwi\", \"apple\", \"coconut\", \"apple\"]); // -\u003e 1\n```\n\n## positionLast\n\nReturn index of last found item in list. If arg is a predicate function, returns\nindex of the last item in a list that meets the condition. If no item meets the\ncriteria, it returns -1. `positionLast` args are curried.\n\n```js\npositionLast(value, list);\npositionLast(predicate, list);\n```\n\n**Example**\n\n```js\nimport { positionLast } from \"@bitmap/fp\";\n\nconst lastAppleIndex = positionLast(\"apple\");\n\nlastAppleIndex([\"orange\", \"banana\", \"pear\", \"lemon\"]); // -\u003e -1\nlastAppleIndex([\"kiwi\", \"apple\", \"coconut\", \"apple\"]); // -\u003e 3\n```\n\n## groupBy\n\nReturns an object with keys being the result of the given function and values\nbeing arrays of the items in the original array that produced the key.\n\n```js\ngroupBy(selector, list);\n```\n\n**Example**\n\n```js\nimport { groupBy } from \"@bitmap/fp\";\n\nconst foods = const foods = [\n    {\n      category: \"fruits\",\n      value: \"apple\",\n    },\n    {\n      category: \"fruits\",\n      value: \"banana\",\n    },\n    {\n      category: \"vegetable\",\n      value: \"spinach\",\n    },\n    {\n      category: \"fruits\",\n      value: \"orange\",\n    },\n    {\n      category: \"vegetable\",\n      value: \"broccoli\",\n    },\n  ];\n\nconst foodsByCategory = groupBy(obj =\u003e obj.category); /* -\u003e {\n  fruits: [\n    { category: \"fruits\", value: \"apple\" },\n    { category: \"fruits\", value: \"banana\" },\n    { category: \"fruits\", value: \"orange\" },\n  ],\n  vegetable: [\n    { category: \"vegetable\", value: \"spinach\" },\n    { category: \"vegetable\", value: \"broccoli\" },\n  ],\n} */\n```\n\n## aperture\n\nReturns a new list, composed of n-tuples of consecutive elements. `aperture` args are curried.\n\n```js\napeture(size, list);\n```\n\n**Example**\n\n```js\nimport { aperture } from \"@bitmap/fp\";\n\nconst list = [1, 2, 3, 4, 5]\n\nconst aperture2 = aperture(2, list) // -\u003e [[1, 2], [2, 3], [3, 4], [4, 5]]\nconst aperture2 = aperture(3, list) // -\u003e [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n\n```\n\n## prop\n\nReturns the value of `key` in object. `prop` args are curried.\n\n```js\nprop(key, object);\n```\n\n**Example**\n\n```js\nimport { prop } from \"@bitmap/fp\";\n\nconst data = {\n  name: \"Cabe\",\n  username: \"bitmap\",\n  title: \"Developer\",\n};\n\nprop(\"username\", data); // -\u003e 'bitmap'\n```\n\n## pluck\n\nReturns [map](#map) of `key` values from a list of objects. `pluck` args are\ncurried.\n\n```js\npluck(key, list);\n```\n\n**Example**\n\n```js\nimport { pluck } from \"@bitmap/fp\";\n\nconst data = [\n  {\n    city: \"New York\",\n    state: \"NY\",\n  },\n  {\n    city: \"San Francisco\",\n    state: \"CA\",\n  },\n  {\n    city: \"Portland\",\n    state: \"OR\",\n  },\n];\n\npluck(\"state\", data); // -\u003e ['NY', 'CA', 'OR']\n```\n\n## pick\n\nReturns copy of object with supplied `keys` and all other properties omitted.\n`pick` args are curried.\n\n```js\npick(keys, object);\n```\n\n**Example**\n\n```js\nimport { pick } from \"@bitmap/fp\";\n\nconst data = {\n  name: \"Cabe\",\n  age: 32,\n  position: \"Developer\",\n  state: \"NY\",\n  city: \"New York\",\n};\n\npick([\"name\", \"position\"], data); // -\u003e { name: 'Cabe', position: 'Developer' }\n```\n\n## omit\n\nReturns copy of object with supplied `keys` omitted. Opposite of [pick](#pick).\n`omit` args are curried.\n\n```js\nomit(keys, object);\n```\n\n**Example**\n\n```js\nimport { omit } from \"@bitmap/fp\";\n\nconst data = {\n  name: \"Cabe\",\n  age: 32,\n  position: \"Developer\",\n  state: \"NY\",\n  city: \"New York\",\n};\n\nomit([\"age\", \"state\", \"city\"], data); // -\u003e { name: 'Cabe', position: 'Developer' }\n```\n\n## split\n\nSplits a string by delimiter into a list. `split` args are curried.\n\n```js\nsplit(delimiter, string);\n```\n\n**Example**\n\n```js\nimport { split } from \"@bitmap/fp\";\n\nsplit(\":\", \"name:Cabe\"); // -\u003e ['name', 'Cabe']\n```\n\n## join\n\nJoins a list into a string, seperating each item by specified delimiter. `join`\nargs are curried.\n\n```js\njoin(delimiter, list);\n```\n\n**Example**\n\n```js\nimport { join } from \"@bitmap/fp\";\n\njoin(\"|\", [1, 2, 3, 4]); // -\u003e '1|2|3|4'\n```\n\n## trim\n\nTrims whitespace from both ends of a string.\n\n```js\ntrim(string);\n```\n\n**Example**\n\n```js\nimport { trim } from \"@bitmap/fp\";\n\ntrim(\"    hello, world    \"); // -\u003e hello, world\n```\n\n## add\n\nAdd two numbers together. `add` args are curried.\n\n```js\nadd(a, b);\n```\n\n**Example**\n\n```js\nimport { add } from \"@bitmap/fp\";\n\nadd(1, 1); // -\u003e 2\n\nconst add5 = add(5);\nconst nine = add5(4); // -\u003e 9\n```\n\n## sum\n\nReturns sum of all arguments.\n\n```js\nsum(a, b, c, ...)\n```\n\n**Example**\n\n```js\nimport { sum } from \"@bitmap/fp\";\n\nsum(1, 2, 3, 4); // -\u003e 10\n\nconst values = [17, 18, 11, -4];\n\nsum(...values); // -\u003e 42\n```\n\n## multiply\n\nMultiples two numbers. `multiply` args are curried.\n\n```js\nmultiply(a, b);\n```\n\n**Example**\n\n```js\nimport { multiply } from \"@bitmap/fp\";\n\nmultiply(12, 5); // -\u003e 60\n\nconst double = multiply(2);\nconst triple = multiply(3);\ndouble(10); // -\u003e 20\ntriple(double(10)); // -\u003e 60\n```\n\n## product\n\nReturns product of all arguments.\n\n```js\nproduct(a, b, c, ...)\n```\n\n**Example**\n\n```js\nimport { product } from \"@bitmap/fp\";\n\nproduct(1, 2, 3, 4); // -\u003e 24\n\nconst values = [17, 18, 11, -4];\n\nproduct(...values); // -\u003e -13464\n```\n\n## subtract\n\nSubracts second value from first. `subtract` args are curried.\n\n```js\nsubtract(a, b);\n```\n\n**Example**\n\n```js\nimport { subtract } from \"@bitmap/fp\";\n\nsubtract(8, 5); // -\u003e 3\n```\n\n## subtractBy\n\nSubracts first value from second. `subtractBy` args are curried.\n\n```js\nsubtractBy(a, b);\n```\n\n**Example**\n\n```js\nimport { subtractBy } from \"@bitmap/fp\";\n\nconst minus5 = subtractBy(5);\nconst value = minus5(10); // -\u003e 5\n```\n\n## divide\n\nDivides first value by second value. `divide` args are curried.\n\n```js\ndivide(a, b);\n```\n\n**Example**\n\n```js\nimport { divide } from \"@bitmap/fp\";\n\ndivide(12, 3); // -\u003e 4\n```\n\n## divideBy\n\nDivides second value by first value. `divideBy` args are curried.\n\n```js\ndivideBy(a, b);\n```\n\n**Example**\n\n```js\nimport { divideBy } from \"@bitmap/fp\";\n\nconst half = divideBy(2);\nconst value = half(10); // -\u003e 5\n```\n\n## clamp\n\nClips value in mix/max range. `clamp` args are curried.\n\n```js\nclamp(min, max, value);\n```\n\n**Example**\n\n```js\nimport { clamp } from \"@bitmap/fp\";\n\nconst percent = clamp(0, 1);\npercent(-1); // -\u003e 0\npercent(0.5); // -\u003e 0.5\npercent(1.5); // -\u003e 1\n```\n\n## mean\n\nReturns mean (average) of all arguments.\n\n```js\nmean(a, b, c, ...)\n```\n\n**Example**\n\n```js\nimport { mean } from \"@bitmap/fp\";\n\nmean(6, 11, 7); // -\u003e 8\n```\n\n## median\n\nReturns median of all arguments.\n\n```js\nmedian(a, b, c, ...)\n```\n\n**Example**\n\n```js\nimport { median } from \"@bitmap/fp\";\n\nmedian(3, 5, 7); // -\u003e 5\nmedian(19, 21, 23, 25); // -\u003e 22\n```\n\n## mode\n\nReturns mode (most frequent occuring value) of all arguments.\n\n```js\nmode(a, b, c, ...)\n```\n\n**Example**\n\n```js\nimport { mode } from \"@bitmap/fp\";\n\nmode(3, 1, 2, 1, 3, 2, 1, 1, 2); // -\u003e 1\n```\n\n## remainder\n\nReturns remainder of two operands. `remainder` args are curried.\n\n```js\nremainder(a, n);\n```\n\n**Example**\n\n```js\nimport { remainder } from \"@bitmap/fp\";\n\nremainder(6, 5); // -\u003e 1\n```\n\n## modulo\n\nReturns modulo of two operands. Note that this is different than the remainder\n(`%`) operator is JavaScript, and behaves like the mathmatical definition of\nmodulo or the `%` operator in Python. `modulo` args are curried.\n\n```js\nmodulo(a, n);\n```\n\n**Example**\n\n```js\nimport { modulo } from \"@bitmap/fp\";\n\nmodulo(5, 2); // -\u003e 1\n```\n\n## compose\n\nCompose functions from right to left.\n\n```js\ncompose(...functions)(value);\n```\n\n**Example**\n\n```js\nimport { compose } from \"@bitmap/fp\";\n\nconst addOne = (n) =\u003e n + 1;\nconst double = (n) =\u003e n * 2;\n\nconst addOneThenDouble = compose(double, addOne);\n\naddOneThenDouble(20); // 42\n```\n\n## pipe\n\nCompose functions from left to right.\n\n```js\npipe(...functions)(value);\n```\n\n**Example**\n\n```js\nimport { pipe } from \"@bitmap/fp\";\n\nconst addOne = (n) =\u003e n + 1;\nconst double = (n) =\u003e n * 2;\n\nconst doubleThenAddOne = pipe(double, addOne);\n\ndoubleThenAddOne(20); // 41\n```\n\n## curry\n\nCurry a function to allow it to be called partially.\n\n```js\ncurry(function)\n```\n\n**Example**\n\n```js\nimport { curry } from \"@bitmap/fp\";\n\nconst sum = curry((a, b, c) =\u003e a + b + c);\n\nsum(1)(2)(3); // -\u003e 6\n```\n\n## identity\n\nPass input as output.\n\n```js\nidendity(value);\n```\n\n**Example**\n\n```js\nimport { idenity } from \"@bitmap/fp\";\n\nconst id = idenity(\"hello, world\"); // -\u003e 'hello, world'\n```\n\n## isEqual\n\nCompares two items and returns true if equal. `isEqual` args are curried.\n\n```js\nisEqual(a, b);\n```\n\n**Example**\n\n```js\nimport { isEqual } from \"@bitmap/fp\";\n\nisEqual(2, 2); // -\u003e true\nisEqual(2, 3); // -\u003e false\n```\n\n## isTypeOf\n\nEvaluate the returned string from an operand. The first arguement `type` must be\na valid value of JavaScript's `typeof` function: `undefined`, `function`,\n`boolean`, `string`, `number`, `bigint`, `symbol`, or `object`.\n\n\u003e Note: Additional helper functions `isUndefined`, `isFunction`, `isBoolean`,\n\u003e `isString`, `isNumber`, `isBigInt`, `isSymbol`, and `isObject` are also\n\u003e exported for convenience.\n\n```js\nisTypeOf(type, value);\n```\n\n**Example**\n\n```js\nimport { isTypeOf } from \"@bitmap/fp\";\n\nisTypeOf(\"string\", \"hello world\"); // -\u003e true\nisTypeOf(\"object\", []); // -\u003e true\nisTypeOf(\"object\", {}); // -\u003e true\nisTypeOf(\"object\", null); // -\u003e true\nisTypeOf(\"number\", 138); // -\u003e true\nisTypeOf(\"number\", \"2\"); // -\u003e false\nisTypeOf(\"function\", (x) =\u003e x * x); // -\u003e true\n```\n\n## isArray\n\nReturns true if value is of the `Array` class.\n\n```js\nisArray(value);\n```\n\n**Example**\n\n```js\nimport { isArray } from \"@bitmap/fp\";\n\nisArray([1, 2, 3]); // -\u003e true\nisArray({ length: 3, 0: 1, 1: 2, 2: 3 }); // -\u003e false\n```\n\n## isNull\n\nReturns true if value is `null`\n\n```js\nisNull(value);\n```\n\n**Example**\n\n```js\nimport { isNull } from \"@bitmap/fp\";\n\nlet value = null;\nisNull(value); // -\u003e true\n\nvalue = \"hello, world\";\nisNull(value); // -\u003e false\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitmap%2Ffp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitmap%2Ffp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitmap%2Ffp/lists"}