{"id":25836109,"url":"https://github.com/selfrefactor/rambda-v9","last_synced_at":"2026-03-04T02:32:36.421Z","repository":{"id":276013856,"uuid":"927922861","full_name":"selfrefactor/rambda-v9","owner":"selfrefactor","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-05T19:27:38.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T19:44:05.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://selfrefactor.github.io/rambda-v9/","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfrefactor.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"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":"2025-02-05T19:05:41.000Z","updated_at":"2025-02-05T19:27:41.000Z","dependencies_parsed_at":"2025-02-05T20:42:34.578Z","dependency_job_id":"9a5b5ab3-e1dd-41c4-b6b9-0646c2715568","html_url":"https://github.com/selfrefactor/rambda-v9","commit_stats":null,"previous_names":["selfrefactor/rambda-v9"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/selfrefactor/rambda-v9","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfrefactor%2Frambda-v9","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfrefactor%2Frambda-v9/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfrefactor%2Frambda-v9/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfrefactor%2Frambda-v9/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfrefactor","download_url":"https://codeload.github.com/selfrefactor/rambda-v9/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfrefactor%2Frambda-v9/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-03-01T01:39:58.446Z","updated_at":"2026-03-04T02:32:36.381Z","avatar_url":"https://github.com/selfrefactor.png","language":null,"readme":"# Rambda\n\n`Rambda` is smaller and faster alternative to the popular functional programming library **Ramda**. - [Documentation](https://selfrefactor.github.io/rambda/#/)\n\n[![codecov](https://codecov.io/gh/selfrefactor/rambda/branch/master/graph/badge.svg)](https://codecov.io/gh/selfrefactor/rambda)\n![Commit activity](https://img.shields.io/github/commit-activity/y/selfrefactor/rambda)\n![Library size](https://img.shields.io/bundlephobia/minzip/rambda)\n[![install size](https://packagephobia.com/badge?p=rambda)](https://packagephobia.com/result?p=rambda)\n[![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/selfrefactor/rambda/pulls)\n[![GitHub contributors](https://img.shields.io/github/contributors/selfrefactor/rambda.svg)](https://github.com/selfrefactor/rambda/graphs/contributors)\n\n## ❯ Example use\n\n```javascript\nimport { compose, map, filter } from 'rambda'\n\nconst result = compose(\n  map(x =\u003e x * 2),\n  filter(x =\u003e x \u003e 2)\n)([1, 2, 3, 4])\n// =\u003e [6, 8]\n```\n\nYou can test this example in \u003ca href=\"https://rambda.now.sh?const%20result%20%3D%20R.compose(%0A%20%20R.map(x%20%3D%3E%20x%20*%202)%2C%0A%20%20R.filter(x%20%3D%3E%20x%20%3E%202)%0A)(%5B1%2C%202%2C%203%2C%204%5D)%0A%0A%2F%2F%20%3D%3E%20%5B6%2C%208%5D\"\u003eRambda's REPL\u003c/a\u003e\n\n* [Differences between Rambda and Ramda](#differences-between-rambda-and-ramda)\n* [API](#api)\n* [Changelog](#-changelog)\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-example-use)\n\n## ❯ Rambda's advantages\n\n### TypeScript included\n\nTypeScript definitions are included in the library, in comparison to **Ramda**, where you need to additionally install `@types/ramda`.\n\nStill, you need to be aware that functional programming features in `TypeScript` are in development, which means that using **R.compose/R.pipe** can be problematic.\n\nImportant - Rambda version `7.1.0`(or higher) requires TypeScript version `4.3.3`(or higher).\n\n### Understandable source code due to little usage of internals\n\n`Ramda` uses a lot of internals, which hides a lot of logic. Reading the full source code of a method can be challenging.\n\n### Better VSCode experience\n\nIf the project is written in Javascript, then `go to source definition` action will lead you to actual implementation of the method.\n\n### Immutable TS definitions\n\nYou can use immutable version of Rambda definitions, which is linted with ESLint `functional/prefer-readonly-type` plugin.\n\n```\nimport {add} from 'rambda/immutable'\n```\n\n### Deno support\n\nLatest version of **Ramba** available for `Deno` users is 3 years old. This is not the case with **Rambda** as most of recent releases are available for `Deno` users.\n\nAlso, `Rambda` provides you with included TS definitions:\n\n```\n// Deno extension(https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno)\n// is installed and initialized\nimport * as R from \"https://deno.land/x/rambda/mod.ts\";\nimport * as Ramda from \"https://deno.land/x/ramda/mod.ts\";\n\nR.add(1)('foo') // =\u003e will trigger warning in VSCode as it should\nRamda.add(1)('foo') // =\u003e will not trigger warning in VSCode\n```\n\n### Dot notation for `R.path`, `R.paths`, `R.assocPath` and `R.lensPath`\n\nStandard usage of `R.path` is `R.path(['a', 'b'], {a: {b: 1} })`.\n\nIn **Rambda** you have the choice to use dot notation(which is arguably more readable):\n\n```\nR.path('a.b', {a: {b: 1} })\n```\n\nPlease note that since path input is turned into array, i.e. if you want `R.path(['a','1', 'b'], {a: {'1': {b: 2}}})` to return `2`, you will have to pass array path, not string path. If you pass `a.1.b`, it will turn path input to `['a', 1, 'b']`.\nThe other side effect is in `R.assocPath` and `R.dissocPath`, where inputs such as `['a', '1', 'b']` will be turned into `['a', 1, 'b']`.\n\n### Comma notation for `R.pick` and `R.omit`\n\nSimilar to dot notation, but the separator is comma(`,`) instead of dot(`.`).\n\n```\nR.pick('a,b', {a: 1 , b: 2, c: 3} })\n// No space allowed between properties\n```\n\n### Speed\n\n**Rambda** is generally more performant than `Ramda` as the [benchmarks](#-benchmarks) can prove that.\n\n### Support\n\nOne of the main issues with `Ramda` is the slow process of releasing new versions. This is not the case with **Rambda** as releases are made on regular basis.\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-rambdas-advantages)\n\n## ❯ Missing Ramda methods\n\n\u003cdetails\u003e\n\u003csummary\u003e\n  Click to see the full list of 46 Ramda methods not implemented in Rambda and their status.\n\u003c/summary\u003e\n\n- construct - Using classes is not very functional programming oriented.\n- constructN - same as above\n- into - no support for transducer as it is overly complex to implement, understand and read.\n- invert - overly complicated and limited use case\n- invertObj\n- invoker\n- keysIn - we shouldn't encourage extending object with `.prototype` \n- lift\n- liftN\n- mapAccum - `Ramda` example doesn't looks convincing\n- mapAccumRight\n- memoizeWith - hard to imagine its usage in context of `R.pipe`/`R.compose`\n- mergeDeepWith - limited use case\n- mergeDeepWithKey\n- mergeWithKey\n- nAry - hard to argument about and hard to create meaningful TypeScript definitions\n- nthArg - limited use case\n- o - enough TypeScript issues with `R.pipe`/`R.compose` to add more composition methods\n- otherwise - naming is confusing\n- pair - `left-pad` types of debacles happens partially because of such methods that should not be hidden, bur rather part of your code base even if they need to exist.\n- partialRight - I dislike `R.partial`, so I don't want to add more methods that are based on it\n- pipeWith\n- project - naming is confusing, but also limited use case\n- promap\n- reduceRight - I find `right/left` methods confusing so I added them only where it makes sense.\n- reduceWhile - functions with 4 inputs - I think that even 3 is too much\n- reduced\n- remove - nice name but it is too generic. Also, `Rambdax` has such method and there it works very differently\n- scan - hard to explain\n- sequence\n- splitWhenever\n- symmetricDifferenceWith\n- andThen\n- toPairsIn\n- transduce - currently is out of focus\n- traverse - same as above\n- unary\n- uncurryN\n- unfold - similar to `R.scan` and I find that it doesn't help with readability\n- unionWith - why it has its usage, I want to limit number of methods that accept more than 2 arguments\n- until\n- useWith - hard to explain\n- valuesIn\n- xprod - limited use case\n- thunkify\n- __ - placeholder method allows user to further customize the method call. While, it seems useful initially, the price is too high in terms of complexity for TypeScript definitions. If it is not easy exressable in TypeScript, it is not worth it as **Rambda** is a TypeScript first library.\n\nThe following methods are not going to be added(reason for exclusion is provided as a comment):\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-missing-ramda-methods)\n  \n## ❯ Install\n\n- **yarn add rambda**\n\n- For UMD usage either use `./dist/rambda.umd.js` or the following CDN link:\n\n```\nhttps://unpkg.com/rambda@CURRENT_VERSION/dist/rambda.umd.js\n```\n\n- with deno\n\n```\nimport {add} from \"https://deno.land/x/rambda/mod.ts\";\n```\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-install)\n\n## Differences between Rambda and Ramda\n\n- Rambda's **type** detects async functions and unresolved `Promises`. The returned values are `'Async'` and `'Promise'`.\n\n- Rambda's **type** handles *NaN* input, in which case it returns `NaN`.\n\n- Rambda's **forEach** can iterate over objects not only arrays.\n\n- Rambda's **map**, **filter**, **partition** when they iterate over objects, they pass property and input object as predicate's argument.\n\n- Rambda's **filter** returns empty array with bad input(`null` or `undefined`), while Ramda throws.\n\n- Ramda's **clamp** work with strings, while Rambda's method work only with numbers.\n\n- Ramda's **indexOf/lastIndexOf** work with strings and lists, while Rambda's method work only with lists as iterable input.\n\n- Error handling, when wrong inputs are provided, may not be the same. This difference will be better documented once all brute force tests are completed.\n\n- TypeScript definitions between `rambda` and `@types/ramda` may vary.\n\n\u003e If you need more **Ramda** methods in **Rambda**, you may either submit a `PR` or check the extended version of **Rambda** - [Rambdax](https://github.com/selfrefactor/rambdax). In case of the former, you may want to consult with [Rambda contribution guidelines.](CONTRIBUTING.md)\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-differences-between-rambda-and-ramda)\n\n## ❯ Benchmarks\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\nClick to expand all benchmark results\n\nThere are methods which are benchmarked only with `Ramda` and `Rambda`(i.e. no `Lodash`).\n\nNote that some of these methods, are called with and without curring. This is done in order to give more detailed performance feedback.\n\nThe benchmarks results are produced from latest versions of *Rambda*, *Lodash*(4.17.21) and *Ramda*(0.30.1).\n\n\u003c/summary\u003e\n\nmethod | Rambda | Ramda | Lodash\n--- |--- | --- | ---\n *add* | 🚀 Fastest | 21.52% slower | 82.15% slower\n *adjust* | 8.48% slower | 🚀 Fastest | 🔳\n *all* | 🚀 Fastest | 7.18% slower | 🔳\n *allPass* | 🚀 Fastest | 88.25% slower | 🔳\n *allPass* | 🚀 Fastest | 98.56% slower | 🔳\n *and* | 🚀 Fastest | 89.09% slower | 🔳\n *any* | 🚀 Fastest | 92.87% slower | 45.82% slower\n *anyPass* | 🚀 Fastest | 98.25% slower | 🔳\n *append* | 🚀 Fastest | 2.07% slower | 🔳\n *applySpec* | 🚀 Fastest | 80.43% slower | 🔳\n *assoc* | 72.32% slower | 60.08% slower | 🚀 Fastest\n *clone* | 🚀 Fastest | 91.86% slower | 86.48% slower\n *compose* | 6.07% slower | 16.89% slower | 🚀 Fastest\n *converge* | 78.63% slower | 🚀 Fastest | 🔳\n *curry* | 🚀 Fastest | 28.86% slower | 🔳\n *curryN* | 🚀 Fastest | 41.05% slower | 🔳\n *defaultTo* | 🚀 Fastest | 48.91% slower | 🔳\n *drop* | 🚀 Fastest | 82.35% slower | 🔳\n *dropLast* | 🚀 Fastest | 86.74% slower | 🔳\n *equals* | 58.37% slower | 96.73% slower | 🚀 Fastest\n *filter* | 6.7% slower | 72.03% slower | 🚀 Fastest\n *find* | 🚀 Fastest | 85.14% slower | 42.65% slower\n *findIndex* | 🚀 Fastest | 86.48% slower | 72.27% slower\n *flatten* | 🚀 Fastest | 85.68% slower | 3.57% slower\n *ifElse* | 🚀 Fastest | 58.56% slower | 🔳\n *includes* | 🚀 Fastest | 81.64% slower | 🔳\n *indexOf* | 🚀 Fastest | 80.17% slower | 🔳\n *indexOf* | 🚀 Fastest | 82.2% slower | 🔳\n *init* | 🚀 Fastest | 92.24% slower | 13.3% slower\n *is* | 🚀 Fastest | 57.69% slower | 🔳\n *isEmpty* | 🚀 Fastest | 97.14% slower | 54.99% slower\n *last* | 🚀 Fastest | 93.43% slower | 5.28% slower\n *lastIndexOf* | 🚀 Fastest | 85.19% slower | 🔳\n *map* | 🚀 Fastest | 86.6% slower | 11.73% slower\n *match* | 🚀 Fastest | 44.83% slower | 🔳\n *merge* | 🚀 Fastest | 12.21% slower | 55.76% slower\n *none* | 🚀 Fastest | 96.48% slower | 🔳\n *objOf* | 🚀 Fastest | 38.05% slower | 🔳\n *omit* | 🚀 Fastest | 69.95% slower | 97.34% slower\n *over* | 🚀 Fastest | 56.23% slower | 🔳\n *path* | 37.81% slower | 77.81% slower | 🚀 Fastest\n *pick* | 🚀 Fastest | 19.07% slower | 80.2% slower\n *pipe* | 🚀 Fastest | 0.11% slower | 🔳\n *prop* | 🚀 Fastest | 87.95% slower | 🔳\n *propEq* | 🚀 Fastest | 91.92% slower | 🔳\n *range* | 🚀 Fastest | 61.8% slower | 57.44% slower\n *reduce* | 60.48% slower | 77.1% slower | 🚀 Fastest\n *repeat* | 48.57% slower | 68.98% slower | 🚀 Fastest\n *replace* | 33.45% slower | 33.99% slower | 🚀 Fastest\n *set* | 🚀 Fastest | 50.35% slower | 🔳\n *sort* | 🚀 Fastest | 40.23% slower | 🔳\n *sortBy* | 🚀 Fastest | 25.29% slower | 56.88% slower\n *split* | 🚀 Fastest | 55.37% slower | 17.64% slower\n *splitEvery* | 🚀 Fastest | 71.98% slower | 🔳\n *take* | 🚀 Fastest | 91.96% slower | 4.72% slower\n *takeLast* | 🚀 Fastest | 93.39% slower | 19.22% slower\n *test* | 🚀 Fastest | 82.34% slower | 🔳\n *type* | 🚀 Fastest | 48.6% slower | 🔳\n *uniq* | 🚀 Fastest | 84.9% slower | 🔳\n *uniqBy* | 51.93% slower | 🚀 Fastest | 🔳\n *uniqWith* | 8.29% slower | 🚀 Fastest | 🔳\n *uniqWith* | 14.23% slower | 🚀 Fastest | 🔳\n *update* | 🚀 Fastest | 52.35% slower | 🔳\n *view* | 🚀 Fastest | 76.15% slower | 🔳\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-benchmarks)\n\n## ❯ Used by\n\n- [ESLint plugin Mocha](https://www.npmjs.com/package/eslint-plugin-mocha)\n\n- [WatermelonDB](https://github.com/Nozbe/WatermelonDB)\n\n- [Walmart Canada](https://www.walmart.ca) reported by [w-b-dev](https://github.com/w-b-dev) \n\n- [VSCode Slack integration](https://github.com/verydanny/vcslack)\n\n- [Webpack PostCSS](https://github.com/sectsect/webpack-postcss)\n\n- [MobX-State-Tree decorators](https://github.com/farwayer/mst-decorators)\n\n- [Rewrite of the Betaflight configurator](https://github.com/freshollie/fresh-configurator)\n\n- [MineFlayer plugin](https://github.com/G07cha/MineflayerArmorManager)\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-used-by)\n\n## API\n\n### add\n\n```typescript\n\nadd(a: number, b: number): number\n```\n\nIt adds `a` and `b`.\n\n\u003e :boom: It doesn't work with strings, as the inputs are parsed to numbers before calculation.\n\n```javascript\nR.add(2, 3) // =\u003e  5\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nadd(a: number, b: number): number;\nadd(a: number): (b: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.add\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function add(a, b){\n  if (arguments.length === 1) return _b =\u003e add(a, _b)\n\n  return Number(a) + Number(b)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add as addRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { add } from './add.js'\n\ntest('with number', () =\u003e {\n  expect(add(2, 3)).toBe(5)\n  expect(add(7)(10)).toBe(17)\n})\n\ntest('string is bad input', () =\u003e {\n  expect(add('foo', 'bar')).toBeNaN()\n})\n\ntest('ramda specs', () =\u003e {\n  expect(add('1', '2')).toBe(3)\n  expect(add(1, '2')).toBe(3)\n  expect(add(true, false)).toBe(1)\n  expect(add(null, null)).toBe(0)\n  expect(add(undefined, undefined)).toBeNaN()\n  expect(add(new Date(1), new Date(2))).toBe(3)\n})\n\nconst possibleInputs = [\n  /foo/,\n  'foo',\n  true,\n  3,\n  NaN,\n  4,\n  [],\n  Promise.resolve(1),\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : add,\n    fnRamda     : addRamda,\n    firstInput  : possibleInputs,\n    secondInput : possibleInputs,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 64,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {add} from 'rambda'\n\ndescribe('R.add', () =\u003e {\n  it('happy', () =\u003e {\n    const result = add(4, 1)\n\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = add(4)(1)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#add)\n\n### addIndex\n\n```typescript\n\naddIndex(originalFn: any): (fn: any) =\u003e (list: any[]) =\u003e any[]\n```\n\n```javascript\nconst result = R.addIndex(R.map)((val, idx) =\u003e val + idx + 1, [1, 2, 3])\n// =\u003e [2, 4, 6]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\naddIndex(originalFn: any): (fn: any) =\u003e (list: any[]) =\u003e any[];\naddIndex(originalFn: any): (fn: any, list: any[]) =\u003e any[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.addIndex\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _concat } from './_internals/utils.js'\nimport { curryN } from './curryN.js'\n\nexport function addIndex(\n  originalFunction,\n  initialIndexFn = () =\u003e 0,\n  loopIndexChange = x =\u003e x + 1\n){\n  return curryN(originalFunction.length, function (){\n    const origFn = arguments[ 0 ]\n    const list = arguments[ arguments.length - 1 ]\n    let idx = initialIndexFn(list.length)\n    const args = Array.prototype.slice.call(arguments, 0)\n    args[ 0 ] = function (){\n      const result = origFn.apply(this, _concat(arguments, [ idx, list ]))\n      idx = loopIndexChange(idx)\n\n      return result\n    }\n\n    return originalFunction.apply(this, args)\n  })\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport * as R from 'ramda'\n\nimport { addIndex } from './addIndex.js'\nimport { map } from './map.js'\n\ntest('with R.pipe', () =\u003e {\n  const result = R.pipe(R.addIndex(R.map)((x, i) =\u003e x + i))([ 1, 2, 3 ])\n  expect(result).toEqual([ 1, 3, 5 ])\n})\n\ntest('happy', () =\u003e {\n  function mapFn(fn, list){\n    const willReturn = []\n    list.forEach(item =\u003e {\n      willReturn.push(fn(item))\n    })\n\n    return willReturn\n  }\n  const mapIndexed = addIndex(mapFn)\n  const fn2 = (val, idx) =\u003e val + idx + 5\n  const result = mapIndexed(fn2, [ 1, 2, 3 ])\n  expect(result).toEqual([ 6, 8, 10 ])\n})\n\ndescribe('unary functions like `map`', () =\u003e {\n  const times2 = function (x){\n    return x * 2\n  }\n  const addIndexParam = function (x, idx){\n    return x + idx\n  }\n  const squareEnds = function (\n    x, idx, list\n  ){\n    return idx === 0 || idx === list.length - 1 ? x * x : x\n  }\n  const mapIndexed = addIndex(map)\n\n  it('works just like a normal map', () =\u003e {\n    expect(mapIndexed(times2, [ 1, 2, 3, 4 ])).toEqual([ 2, 4, 6, 8 ])\n  })\n\n  it('passes the index as a second parameter to the callback', () =\u003e {\n    expect(mapIndexed(addIndexParam, [ 8, 6, 7, 5, 3, 0, 9 ])).toEqual([\n      8, 7, 9, 8, 7, 5, 15,\n    ])\n  })\n\n  it('passes the entire list as a third parameter to the callback', () =\u003e {\n    expect(mapIndexed(squareEnds, [ 8, 6, 7, 5, 3, 0, 9 ])).toEqual([\n      64, 6, 7, 5, 3, 0, 81,\n    ])\n  })\n\n  it('acts as a curried function', () =\u003e {\n    const makeSquareEnds = mapIndexed(squareEnds)\n    expect(makeSquareEnds([ 8, 6, 7, 5, 3, 0, 9 ])).toEqual([\n      64, 6, 7, 5, 3, 0, 81,\n    ])\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {addIndex, map, pipe} from 'rambda'\n\ndescribe('R.addIndex', () =\u003e {\n  it('happy', () =\u003e {\n    function mapFn\u003cT\u003e(fn: (x: T) =\u003e T, list: T[]) {\n      const willReturn: T[] = []\n      list.forEach(item =\u003e {\n        willReturn.push(fn(item))\n      })\n\n      return willReturn\n    }\n    const mapIndexed = addIndex(mapFn)\n    const fn = (val: number, idx: number, list: number[]) =\u003e\n      val + idx + 5 + list[0]\n    const result = mapIndexed(fn)([1, 2, 3])\n    result // $ExpectType any[]\n  })\n  it('with pipe', () =\u003e {\n    const result = pipe(\n      addIndex(map)((x: number, i: number) =\u003e {\n        return x + i\n      })\n    )([1, 2, 3])\n    result // $ExpectType any[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#addIndex)\n\n### addIndexRight\n\n```typescript\n\naddIndexRight(originalFn: any): (fn: any) =\u003e (list: any[]) =\u003e any[]\n```\n\nSame as `R.addIndex`, but it will passed indexes are decreasing, instead of increasing.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\naddIndexRight(originalFn: any): (fn: any) =\u003e (list: any[]) =\u003e any[];\naddIndexRight(originalFn: any): (fn: any, list: any[]) =\u003e any[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.addIndexRight\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { addIndex } from './addIndex.js'\n\nexport function addIndexRight(originalFunction){\n  return addIndex(\n    originalFunction,\n    listLength =\u003e listLength - 1,\n    x =\u003e x - 1\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { addIndexRight } from './addIndexRight.js'\nimport { map } from './map.js'\n\ntest('happy', () =\u003e {\n  function mapFn(fn, list){\n    const willReturn = []\n    list.forEach(item =\u003e {\n      willReturn.push(fn(item))\n    })\n\n    return willReturn\n  }\n  const mapIndexed = addIndexRight(mapFn)\n  const fn2 = (val, idx) =\u003e val + idx + 5\n  expect(mapIndexed(fn2, [ 1, 2, 3 ])).toEqual([ 8, 8, 8 ])\n  const revmap = (fn, ary) =\u003e map(fn, ary)\n  const revmapIndexed = addIndexRight(revmap)\n  const result = revmapIndexed((val, idx) =\u003e idx + '-' + val,\n    [ 'f', 'o', 'o', 'b', 'a', 'r' ])\n\n  expect(result).toEqual([ '5-f', '4-o', '3-o', '2-b', '1-a', '0-r' ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#addIndexRight)\n\n### adjust\n\n```typescript\n\nadjust\u003cT\u003e(index: number, replaceFn: (x: T) =\u003e T, list: T[]): T[]\n```\n\nIt replaces `index` in array `list` with the result of `replaceFn(list[i])`.\n\n```javascript\nconst result = R.adjust(\n  0,\n  a =\u003e a + 1,\n  [0, 100]\n) // =\u003e [1, 100]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nadjust\u003cT\u003e(index: number, replaceFn: (x: T) =\u003e T, list: T[]): T[];\nadjust\u003cT\u003e(index: number, replaceFn: (x: T) =\u003e T): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.adjust\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { curry } from './curry.js'\n\nfunction adjustFn(\n  index, replaceFn, list\n){\n  const actualIndex = index \u003c 0 ? list.length + index : index\n  if (index \u003e= list.length || actualIndex \u003c 0) return list\n\n  const clone = cloneList(list)\n  clone[ actualIndex ] = replaceFn(clone[ actualIndex ])\n\n  return clone\n}\n\nexport const adjust = curry(adjustFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add } from './add.js'\nimport { adjust } from './adjust.js'\nimport { pipe } from './pipe.js'\n\nconst list = [ 0, 1, 2 ]\nconst expected = [ 0, 11, 2 ]\n\ntest('happy', () =\u003e {})\n\ntest('happy', () =\u003e {\n  expect(adjust(\n    1, add(10), list\n  )).toEqual(expected)\n})\n\ntest('with curring type 1 1 1', () =\u003e {\n  expect(adjust(1)(add(10))(list)).toEqual(expected)\n})\n\ntest('with curring type 1 2', () =\u003e {\n  expect(adjust(1)(add(10), list)).toEqual(expected)\n})\n\ntest('with curring type 2 1', () =\u003e {\n  expect(adjust(1, add(10))(list)).toEqual(expected)\n})\n\ntest('with negative index', () =\u003e {\n  expect(adjust(\n    -2, add(10), list\n  )).toEqual(expected)\n})\n\ntest('when index is out of bounds', () =\u003e {\n  const list = [ 0, 1, 2, 3 ]\n  expect(adjust(\n    4, add(1), list\n  )).toEqual(list)\n  expect(adjust(\n    -5, add(1), list\n  )).toEqual(list)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#adjust)\n\n### all\n\n```typescript\n\nall\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean\n```\n\nIt returns `true`, if all members of array `list` returns `true`, when applied as argument to `predicate` function.\n\n```javascript\nconst list = [ 0, 1, 2, 3, 4 ]\nconst predicate = x =\u003e x \u003e -1\n\nconst result = R.all(predicate, list)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nall\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean;\nall\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.all\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function all(predicate, list){\n  if (arguments.length === 1) return _list =\u003e all(predicate, _list)\n\n  for (let i = 0; i \u003c list.length; i++){\n    if (!predicate(list[ i ])) return false\n  }\n\n  return true\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { all } from './all.js'\n\nconst list = [ 0, 1, 2, 3, 4 ]\n\ntest('when true', () =\u003e {\n  const fn = x =\u003e x \u003e -1\n\n  expect(all(fn)(list)).toBeTrue()\n})\n\ntest('when false', () =\u003e {\n  const fn = x =\u003e x \u003e 2\n\n  expect(all(fn, list)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {all} from 'rambda'\n\ndescribe('all', () =\u003e {\n  it('happy', () =\u003e {\n    const result = all(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 0\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType boolean\n  })\n  it('curried needs a type', () =\u003e {\n    const result = all\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 0\n    })([1, 2, 3])\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#all)\n\n### allPass\n\n```typescript\n\nallPass\u003cT\u003e(predicates: ((x: T) =\u003e boolean)[]): (input: T) =\u003e boolean\n```\n\nIt returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.\n\n```javascript\nconst input = {\n  a : 1,\n  b : 2,\n}\nconst predicates = [\n  x =\u003e x.a === 1,\n  x =\u003e x.b === 2,\n]\nconst result = R.allPass(predicates)(input) // =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nallPass\u003cT\u003e(predicates: ((x: T) =\u003e boolean)[]): (input: T) =\u003e boolean;\nallPass\u003cT\u003e(predicates: ((...inputs: T[]) =\u003e boolean)[]): (...inputs: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.allPass\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function allPass(predicates){\n  return (...input) =\u003e {\n    let counter = 0\n    while (counter \u003c predicates.length){\n      if (!predicates[ counter ](...input)){\n        return false\n      }\n      counter++\n    }\n\n    return true\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { allPass } from './allPass.js'\n\ntest('happy', () =\u003e {\n  const rules = [ x =\u003e typeof x === 'number', x =\u003e x \u003e 10, x =\u003e x * 7 \u003c 100 ]\n\n  expect(allPass(rules)(11)).toBeTrue()\n\n  expect(allPass(rules)(undefined)).toBeFalse()\n})\n\ntest('when returns true', () =\u003e {\n  const conditionArr = [ val =\u003e val.a === 1, val =\u003e val.b === 2 ]\n\n  expect(allPass(conditionArr)({\n    a : 1,\n    b : 2,\n  })).toBeTrue()\n})\n\ntest('when returns false', () =\u003e {\n  const conditionArr = [ val =\u003e val.a === 1, val =\u003e val.b === 3 ]\n\n  expect(allPass(conditionArr)({\n    a : 1,\n    b : 2,\n  })).toBeFalse()\n})\n\ntest('works with multiple inputs', () =\u003e {\n  const fn = function (\n    w, x, y, z\n  ){\n    return w + x === y + z\n  }\n  expect(allPass([ fn ])(\n    3, 3, 3, 3\n  )).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {allPass, filter} from 'rambda'\n\ndescribe('allPass', () =\u003e {\n  it('happy', () =\u003e {\n    const x = allPass\u003cnumber\u003e([\n      y =\u003e {\n        y // $ExpectType number\n        return typeof y === 'number'\n      },\n      y =\u003e {\n        return y \u003e 0\n      },\n    ])(11)\n\n    x // $ExpectType boolean\n  })\n  it('issue #642', () =\u003e {\n    const isGreater = (num: number) =\u003e num \u003e 5\n    const pred = allPass([isGreater])\n    const xs = [0, 1, 2, 3]\n\n    const filtered1 = filter(pred)(xs)\n    filtered1 // $ExpectType number[]\n    const filtered2 = xs.filter(pred)\n    filtered2 // $ExpectType number[]\n  })\n  it('issue #604', () =\u003e {\n    const plusEq = function(w: number, x: number, y: number, z: number) {\n      return w + x === y + z\n    }\n    const result = allPass([plusEq])(3, 3, 3, 3)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#allPass)\n\n### always\n\n```typescript\n\nalways\u003cT\u003e(x: T): (...args: unknown[]) =\u003e T\n```\n\nIt returns function that always returns `x`.\n\n```javascript\nconst fn = R.always(7)\n\nconst result = fn()\n// =\u003e 7\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nalways\u003cT\u003e(x: T): (...args: unknown[]) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.always\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function always(x){\n  return _ =\u003e x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { always } from './always.js'\nimport { applySpec } from './applySpec.js'\n\ntest('happy', () =\u003e {\n  const fn = always(7)\n\n  expect(fn()).toBe(7)\n  expect(fn()).toBe(7)\n})\n\ntest('compatibility with applySpec', () =\u003e {\n  const spec = applySpec({ x : always('foo') })\n  expect(spec({})).toEqual({ x : 'foo' })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {always} from 'rambda'\n\ndescribe('R.always', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = always('foo')\n    fn // $ExpectType (...args: unknown[]) =\u003e string\n    const result = fn()\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#always)\n\n### and\n\n```typescript\n\nand\u003cT, U\u003e(x: T, y: U): T | U\n```\n\nLogical AND\n\n```javascript\nR.and(true, true); // =\u003e true\nR.and(false, true); // =\u003e false\nR.and(true, 'foo'); // =\u003e 'foo'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nand\u003cT, U\u003e(x: T, y: U): T | U;\nand\u003cT\u003e(x: T): \u003cU\u003e(y: U) =\u003e T | U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.and\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function and(a, b){\n  if (arguments.length === 1) return _b =\u003e and(a, _b)\n\n  return a \u0026\u0026 b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { and } from './and.js'\n\ntest('happy', () =\u003e {\n  expect(and(1, 'foo')).toBe('foo')\n  expect(and(true, true)).toBeTrue()\n  expect(and(true)(true)).toBeTrue()\n  expect(and(true, false)).toBeFalse()\n  expect(and(false, true)).toBeFalse()\n  expect(and(false, false)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {and} from 'rambda'\n\ndescribe('R.and', () =\u003e {\n  it('happy', () =\u003e {\n    const result = and(true, false)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = and('foo')(1)\n    result // $ExpectType string | 1\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#and)\n\n### any\n\n```typescript\n\nany\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean\n```\n\nIt returns `true`, if at least one member of `list` returns true, when passed to a `predicate` function.\n\n```javascript\nconst list = [1, 2, 3]\nconst predicate = x =\u003e x * x \u003e 8\nR.any(fn, list)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nany\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean;\nany\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.any\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function any(predicate, list){\n  if (arguments.length === 1) return _list =\u003e any(predicate, _list)\n\n  let counter = 0\n  while (counter \u003c list.length){\n    if (predicate(list[ counter ], counter)){\n      return true\n    }\n    counter++\n  }\n\n  return false\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { any } from './any.js'\n\nconst list = [ 1, 2, 3 ]\n\ntest('happy', () =\u003e {\n  expect(any(x =\u003e x \u003c 0, list)).toBeFalse()\n})\n\ntest('with curry', () =\u003e {\n  expect(any(x =\u003e x \u003e 2)(list)).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {any} from 'rambda'\n\ndescribe('R.any', () =\u003e {\n  it('happy', () =\u003e {\n    const result = any(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 2\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType boolean\n  })\n\n  it('when curried needs a type', () =\u003e {\n    const result = any\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 2\n    })([1, 2, 3])\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#any)\n\n### anyPass\n\n```typescript\n\nanyPass\u003cT\u003e(predicates: ((x: T) =\u003e boolean)[]): (input: T) =\u003e boolean\n```\n\nIt accepts list of `predicates` and returns a function. This function with its `input` will return `true`, if any of `predicates` returns `true` for this `input`.\n\n```javascript\nconst isBig = x =\u003e x \u003e 20\nconst isOdd = x =\u003e x % 2 === 1\nconst input = 11\n\nconst fn = R.anyPass(\n  [isBig, isOdd]\n)\n\nconst result = fn(input) \n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nanyPass\u003cT\u003e(predicates: ((x: T) =\u003e boolean)[]): (input: T) =\u003e boolean;\nanyPass\u003cT\u003e(predicates: ((...inputs: T[]) =\u003e boolean)[]): (...inputs: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.anyPass\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function anyPass(predicates){\n  return (...input) =\u003e {\n    let counter = 0\n    while (counter \u003c predicates.length){\n      if (predicates[ counter ](...input)){\n        return true\n      }\n      counter++\n    }\n\n    return false\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { anyPass } from './anyPass.js'\n\ntest('happy', () =\u003e {\n  const rules = [ x =\u003e typeof x === 'string', x =\u003e x \u003e 10 ]\n  const predicate = anyPass(rules)\n  expect(predicate('foo')).toBeTrue()\n  expect(predicate(6)).toBeFalse()\n})\n\ntest('happy', () =\u003e {\n  const rules = [ x =\u003e typeof x === 'string', x =\u003e x \u003e 10 ]\n\n  expect(anyPass(rules)(11)).toBeTrue()\n  expect(anyPass(rules)(undefined)).toBeFalse()\n})\n\nconst obj = {\n  a : 1,\n  b : 2,\n}\n\ntest('when returns true', () =\u003e {\n  const conditionArr = [ val =\u003e val.a === 1, val =\u003e val.a === 2 ]\n\n  expect(anyPass(conditionArr)(obj)).toBeTrue()\n})\n\ntest('when returns false + curry', () =\u003e {\n  const conditionArr = [ val =\u003e val.a === 2, val =\u003e val.b === 3 ]\n\n  expect(anyPass(conditionArr)(obj)).toBeFalse()\n})\n\ntest('with empty predicates list', () =\u003e {\n  expect(anyPass([])(3)).toBeFalse()\n})\n\ntest('works with multiple inputs', () =\u003e {\n  const fn = function (\n    w, x, y, z\n  ){\n    console.log(\n      w, x, y, z\n    )\n\n    return w + x === y + z\n  }\n  expect(anyPass([ fn ])(\n    3, 3, 3, 3\n  )).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {anyPass, filter} from 'rambda'\n\ndescribe('anyPass', () =\u003e {\n  it('happy', () =\u003e {\n    const x = anyPass\u003cnumber\u003e([\n      y =\u003e {\n        y // $ExpectType number\n        return typeof y === 'number'\n      },\n      y =\u003e {\n        return y \u003e 0\n      },\n    ])(11)\n\n    x // $ExpectType boolean\n  })\n  it('issue #604', () =\u003e {\n    const plusEq = function(w: number, x: number, y: number, z: number) {\n      return w + x === y + z\n    }\n    const result = anyPass([plusEq])(3, 3, 3, 3)\n\n    result // $ExpectType boolean\n  })\n  it('issue #642', () =\u003e {\n    const isGreater = (num: number) =\u003e num \u003e 5\n    const pred = anyPass([isGreater])\n    const xs = [0, 1, 2, 3]\n\n    const filtered1 = filter(pred)(xs)\n    filtered1 // $ExpectType number[]\n    const filtered2 = xs.filter(pred)\n    filtered2 // $ExpectType number[]\n  })\n  it('functions as a type guard', () =\u003e {\n    const isString = (x: unknown): x is string =\u003e typeof x === 'string'\n    const isNumber = (x: unknown): x is number =\u003e typeof x === 'number'\n    const isBoolean = (x: unknown): x is boolean =\u003e typeof x === 'boolean'\n\n    const isStringNumberOrBoolean = anyPass([isString, isNumber, isBoolean])\n\n    isStringNumberOrBoolean // $ExpectType (input: unknown) =\u003e boolean\n\n    const aValue: unknown = 1\n\n    if (isStringNumberOrBoolean(aValue)) {\n      aValue // $ExpectType unknown\n    }\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#anyPass)\n\n### ap\n\n```typescript\n\nap\u003cT, U\u003e(fns: Array\u003c(a: T) =\u003e U\u003e[], vs: T[]): U[]\n```\n\nIt takes a list of functions and a list of values. Then it returns a list of values obtained by applying each function to each value.\n\n```javascript\nconst result = R.ap(\n  [\n    x =\u003e x + 1,\n    x =\u003e x + 2,\n  ],\n  [1, 2, 3]\n)\n// =\u003e [2, 3, 4, 3, 4, 5]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nap\u003cT, U\u003e(fns: Array\u003c(a: T) =\u003e U\u003e[], vs: T[]): U[];\nap\u003cT, U\u003e(fns: Array\u003c(a: T) =\u003e U\u003e): (vs: T[]) =\u003e U[];\nap\u003cR, A, B\u003e(fn: (r: R, a: A) =\u003e B, fn1: (r: R) =\u003e A): (r: R) =\u003e B;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.ap\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function ap(functions, input){\n  if (arguments.length === 1){\n    return _inputs =\u003e ap(functions, _inputs)\n  }\n\n  return functions.reduce((acc, fn) =\u003e [ ...acc, ...input.map(fn) ], [])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { ap } from './ap.js'\n\nfunction mult2(x){\n  return x * 2\n}\nfunction plus3(x){\n  return x + 3\n}\n\ntest('happy', () =\u003e {\n  expect(ap([ mult2, plus3 ], [ 1, 2, 3 ])).toEqual([ 2, 4, 6, 4, 5, 6 ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#ap)\n\n### aperture\n\n```typescript\n\naperture\u003cN extends number, T\u003e(n: N, list: T[]): Array\u003cTuple\u003cT, N\u003e\u003e | []\n```\n\nIt returns a new list, composed of consecutive `n`-tuples from a `list`.\n\n```javascript\nconst result = R.aperture(2, [1, 2, 3, 4])\n// =\u003e [[1, 2], [2, 3], [3, 4]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\naperture\u003cN extends number, T\u003e(n: N, list: T[]): Array\u003cTuple\u003cT, N\u003e\u003e | [];\naperture\u003cN extends number\u003e(n: N): \u003cT\u003e(list: T[]) =\u003e Array\u003cTuple\u003cT, N\u003e\u003e | [];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.aperture\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function aperture(step, list){\n  if (arguments.length === 1){\n    return _list =\u003e aperture(step, _list)\n  }\n  if (step \u003e list.length) return []\n  let idx = 0\n  const limit = list.length - (step - 1)\n  const acc = new Array(limit)\n  while (idx \u003c limit){\n    acc[ idx ] = list.slice(idx, idx + step)\n    idx += 1\n  }\n\n  return acc\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { aperture } from './aperture.js'\n\nconst list = [ 1, 2, 3, 4, 5, 6, 7 ]\n\ntest('happy', () =\u003e {\n  expect(aperture(1, list)).toEqual([ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ] ])\n  expect(aperture(2, list)).toEqual([\n    [ 1, 2 ],\n    [ 2, 3 ],\n    [ 3, 4 ],\n    [ 4, 5 ],\n    [ 5, 6 ],\n    [ 6, 7 ],\n  ])\n  expect(aperture(3, list)).toEqual([\n    [ 1, 2, 3 ],\n    [ 2, 3, 4 ],\n    [ 3, 4, 5 ],\n    [ 4, 5, 6 ],\n    [ 5, 6, 7 ],\n  ])\n  expect(aperture(8, list)).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#aperture)\n\n### append\n\n```typescript\n\nappend\u003cT\u003e(xToAppend: T, iterable: T[]): T[]\n```\n\nIt adds element `x` at the end of `iterable`.\n\n```javascript\nconst x = 'foo'\n\nconst result = R.append(x, ['bar', 'baz'])\n// =\u003e ['bar', 'baz', 'foo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nappend\u003cT\u003e(xToAppend: T, iterable: T[]): T[];\nappend\u003cT, U\u003e(xToAppend: T, iterable: IsFirstSubtypeOfSecond\u003cT, U\u003e[]) : U[];\nappend\u003cT\u003e(xToAppend: T): \u003cU\u003e(iterable: IsFirstSubtypeOfSecond\u003cT, U\u003e[]) =\u003e U[];\nappend\u003cT\u003e(xToAppend: T): (iterable: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.append\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\n\nexport function append(x, input){\n  if (arguments.length === 1) return _input =\u003e append(x, _input)\n\n  if (typeof input === 'string') return input.split('').concat(x)\n\n  const clone = cloneList(input)\n  clone.push(x)\n\n  return clone\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { append } from './append.js'\n\ntest('happy', () =\u003e {\n  expect(append('tests', [ 'write', 'more' ])).toEqual([\n    'write',\n    'more',\n    'tests',\n  ])\n})\n\ntest('append to empty array', () =\u003e {\n  expect(append('tests')([])).toEqual([ 'tests' ])\n})\n\ntest('with strings', () =\u003e {\n  expect(append('o', 'fo')).toEqual([ 'f', 'o', 'o' ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {append, prepend} from 'rambda'\n\nconst listOfNumbers = [1, 2, 3]\nconst listOfNumbersAndStrings = [1, 'b', 3]\n\ndescribe('R.append/R.prepend', () =\u003e {\n  describe(\"with the same primitive type as the array's elements\", () =\u003e {\n    it('uncurried', () =\u003e {\n      // @ts-expect-error\n      append('d', listOfNumbers)\n      // @ts-expect-error\n      prepend('d', listOfNumbers)\n      append(4, listOfNumbers) // $ExpectType number[]\n      prepend(4, listOfNumbers) // $ExpectType number[]\n    })\n\n    it('curried', () =\u003e {\n      // @ts-expect-error\n      append('d')(listOfNumbers)\n      append(4)(listOfNumbers) // $ExpectType number[]\n      prepend(4)(listOfNumbers) // $ExpectType number[]\n    })\n  })\n\n  describe(\"with a subtype of the array's elements\", () =\u003e {\n    it('uncurried', () =\u003e {\n      // @ts-expect-error\n      append(true, listOfNumbersAndStrings)\n      append(4, listOfNumbersAndStrings) // $ExpectType (string | number)[]\n      prepend(4, listOfNumbersAndStrings) // $ExpectType (string | number)[]\n    })\n\n    it('curried', () =\u003e {\n      // @ts-expect-error\n      append(true)(listOfNumbersAndStrings)\n      append(4)(listOfNumbersAndStrings) // $ExpectType (string | number)[]\n      prepend(4)(listOfNumbersAndStrings) // $ExpectType (string | number)[]\n    })\n  })\n\n  describe(\"expanding the type of the array's elements\", () =\u003e {\n    it('uncurried', () =\u003e {\n      // @ts-expect-error\n      append('d', listOfNumbers)\n      append\u003cstring | number\u003e('d', listOfNumbers) // $ExpectType (string | number)[]\n      prepend\u003cstring | number\u003e('d', listOfNumbers) // $ExpectType (string | number)[]\n    })\n\n    it('curried', () =\u003e {\n      // @ts-expect-error\n      append('d')(listOfNumbers)\n      const appendD = append('d')\n      appendD\u003cstring | number\u003e(listOfNumbers) // $ExpectType (string | number)[]\n      const prependD = prepend('d')\n      prependD\u003cstring | number\u003e(listOfNumbers) // $ExpectType (string | number)[]\n    })\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#append)\n\n### apply\n\n```typescript\n\napply\u003cT = any\u003e(fn: (...args: any[]) =\u003e T, args: any[]): T\n```\n\nIt applies function `fn` to the list of arguments. \n\nThis is useful for creating a fixed-arity function from a variadic function. `fn` should be a bound function if context is significant.\n\n```javascript\nconst result = R.apply(Math.max, [42, -Infinity, 1337])\n// =\u003e 1337\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\napply\u003cT = any\u003e(fn: (...args: any[]) =\u003e T, args: any[]): T;\napply\u003cT = any\u003e(fn: (...args: any[]) =\u003e T): (args: any[]) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.apply\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function apply(fn, args){\n  if (arguments.length === 1){\n    return _args =\u003e apply(fn, _args)\n  }\n\n  return fn.apply(this, args)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { apply } from './apply.js'\nimport { bind } from './bind.js'\nimport { identity } from './identity.js'\n\ntest('happy', () =\u003e {\n  expect(apply(identity, [ 1, 2, 3 ])).toBe(1)\n})\n\ntest('applies function to argument list', () =\u003e {\n  expect(apply(Math.max, [ 1, 2, 3, -99, 42, 6, 7 ])).toBe(42)\n})\n\ntest('provides no way to specify context', () =\u003e {\n  const obj = {\n    method (){\n      return this === obj\n    },\n  }\n  expect(apply(obj.method, [])).toBeFalse()\n  expect(apply(bind(obj.method, obj), [])).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {apply, identity} from 'rambda'\n\ndescribe('R.apply', () =\u003e {\n  it('happy', () =\u003e {\n    const result = apply\u003cnumber\u003e(identity, [1, 2, 3])\n\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const fn = apply\u003cnumber\u003e(identity)\n    const result = fn([1, 2, 3])\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#apply)\n\n### applySpec\n\n```typescript\n\napplySpec\u003cSpec extends Record\u003cstring, AnyFunction\u003e\u003e(\n  spec: Spec\n): (\n  ...args: Parameters\u003cValueOfRecord\u003cSpec\u003e\u003e\n) =\u003e { [Key in keyof Spec]: ReturnType\u003cSpec[Key]\u003e }\n```\n\n\u003e :boom: The currying in this function works best with functions with 4 arguments or less. (arity of 4)\n\n```javascript\nconst fn = R.applySpec({\n  sum: R.add,\n  nested: { mul: R.multiply }\n})\nconst result = fn(2, 4) \n// =\u003e { sum: 6, nested: { mul: 8 } }\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\napplySpec\u003cSpec extends Record\u003cstring, AnyFunction\u003e\u003e(\n  spec: Spec\n): (\n  ...args: Parameters\u003cValueOfRecord\u003cSpec\u003e\u003e\n) =\u003e { [Key in keyof Spec]: ReturnType\u003cSpec[Key]\u003e };\napplySpec\u003cT\u003e(spec: any): (...args: unknown[]) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.applySpec\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\n// recursively traverse the given spec object to find the highest arity function\nexport function __findHighestArity(spec, max = 0){\n  for (const key in spec){\n    if (spec.hasOwnProperty(key) === false || key === 'constructor') continue\n\n    if (typeof spec[ key ] === 'object'){\n      max = Math.max(max, __findHighestArity(spec[ key ]))\n    }\n\n    if (typeof spec[ key ] === 'function'){\n      max = Math.max(max, spec[ key ].length)\n    }\n  }\n\n  return max\n}\n\nfunction __filterUndefined(){\n  const defined = []\n  let i = 0\n  const l = arguments.length\n  while (i \u003c l){\n    if (typeof arguments[ i ] === 'undefined') break\n    defined[ i ] = arguments[ i ]\n    i++\n  }\n\n  return defined\n}\n\nfunction __applySpecWithArity(\n  spec, arity, cache\n){\n  const remaining = arity - cache.length\n\n  if (remaining === 1)\n    return x =\u003e\n      __applySpecWithArity(\n        spec, arity, __filterUndefined(...cache, x)\n      )\n  if (remaining === 2)\n    return (x, y) =\u003e\n      __applySpecWithArity(\n        spec, arity, __filterUndefined(\n          ...cache, x, y\n        )\n      )\n  if (remaining === 3)\n    return (\n      x, y, z\n    ) =\u003e\n      __applySpecWithArity(\n        spec, arity, __filterUndefined(\n          ...cache, x, y, z\n        )\n      )\n  if (remaining === 4)\n    return (\n      x, y, z, a\n    ) =\u003e\n      __applySpecWithArity(\n        spec,\n        arity,\n        __filterUndefined(\n          ...cache, x, y, z, a\n        )\n      )\n  if (remaining \u003e 4)\n    return (...args) =\u003e\n      __applySpecWithArity(\n        spec, arity, __filterUndefined(...cache, ...args)\n      )\n\n  // handle spec as Array\n  if (isArray(spec)){\n    const ret = []\n    let i = 0\n    const l = spec.length\n    for (; i \u003c l; i++){\n      // handle recursive spec inside array\n      if (typeof spec[ i ] === 'object' || isArray(spec[ i ])){\n        ret[ i ] = __applySpecWithArity(\n          spec[ i ], arity, cache\n        )\n      }\n      // apply spec to the key\n      if (typeof spec[ i ] === 'function'){\n        ret[ i ] = spec[ i ](...cache)\n      }\n    }\n\n    return ret\n  }\n\n  // handle spec as Object\n  const ret = {}\n  // apply callbacks to each property in the spec object\n  for (const key in spec){\n    if (spec.hasOwnProperty(key) === false || key === 'constructor') continue\n\n    // apply the spec recursively\n    if (typeof spec[ key ] === 'object'){\n      ret[ key ] = __applySpecWithArity(\n        spec[ key ], arity, cache\n      )\n      continue\n    }\n\n    // apply spec to the key\n    if (typeof spec[ key ] === 'function'){\n      ret[ key ] = spec[ key ](...cache)\n    }\n  }\n\n  return ret\n}\n\nexport function applySpec(spec, ...args){\n  // get the highest arity spec function, cache the result and pass to __applySpecWithArity\n  const arity = __findHighestArity(spec)\n\n  if (arity === 0){\n    return () =\u003e ({})\n  }\n  const toReturn = __applySpecWithArity(\n    spec, arity, args\n  )\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { applySpec as applySpecRamda, nAry } from 'ramda'\n\nimport {\n  add,\n  always,\n  compose,\n  dec,\n  inc,\n  map,\n  path,\n  prop,\n  T,\n} from '../rambda.js'\nimport { applySpec } from './applySpec.js'\n\ntest('different than Ramda when bad spec', () =\u003e {\n  const result = applySpec({ sum : { a : 1 } })(1, 2)\n  const ramdaResult = applySpecRamda({ sum : { a : 1 } })(1, 2)\n  expect(result).toEqual({})\n  expect(ramdaResult).toEqual({ sum : { a : {} } })\n})\n\ntest('works with empty spec', () =\u003e {\n  expect(applySpec({})()).toEqual({})\n  expect(applySpec([])(1, 2)).toEqual({})\n  expect(applySpec(null)(1, 2)).toEqual({})\n})\n\ntest('works with unary functions', () =\u003e {\n  const result = applySpec({\n    v : inc,\n    u : dec,\n  })(1)\n  const expected = {\n    v : 2,\n    u : 0,\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('works with binary functions', () =\u003e {\n  const result = applySpec({ sum : add })(1, 2)\n  expect(result).toEqual({ sum : 3 })\n})\n\ntest('works with nested specs', () =\u003e {\n  const result = applySpec({\n    unnested : always(0),\n    nested   : { sum : add },\n  })(1, 2)\n  const expected = {\n    unnested : 0,\n    nested   : { sum : 3 },\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('works with arrays of nested specs', () =\u003e {\n  const result = applySpec({\n    unnested : always(0),\n    nested   : [ { sum : add } ],\n  })(1, 2)\n\n  expect(result).toEqual({\n    unnested : 0,\n    nested   : [ { sum : 3 } ],\n  })\n})\n\ntest('works with arrays of spec objects', () =\u003e {\n  const result = applySpec([ { sum : add } ])(1, 2)\n\n  expect(result).toEqual([ { sum : 3 } ])\n})\n\ntest('works with arrays of functions', () =\u003e {\n  const result = applySpec([ map(prop('a')), map(prop('b')) ])([\n    {\n      a : 'a1',\n      b : 'b1',\n    },\n    {\n      a : 'a2',\n      b : 'b2',\n    },\n  ])\n  const expected = [\n    [ 'a1', 'a2' ],\n    [ 'b1', 'b2' ],\n  ]\n  expect(result).toEqual(expected)\n})\n\ntest('works with a spec defining a map key', () =\u003e {\n  expect(applySpec({ map : prop('a') })({ a : 1 })).toEqual({ map : 1 })\n})\n\ntest('cannot retains the highest arity', () =\u003e {\n  const f = applySpec({\n    f1 : nAry(2, T),\n    f2 : nAry(5, T),\n  })\n  const fRamda = applySpecRamda({\n    f1 : nAry(2, T),\n    f2 : nAry(5, T),\n  })\n  expect(f).toHaveLength(0)\n  expect(fRamda).toHaveLength(5)\n})\n\ntest('returns a curried function', () =\u003e {\n  expect(applySpec({ sum : add })(1)(2)).toEqual({ sum : 3 })\n})\n\n// Additional tests\n// ============================================\ntest('arity', () =\u003e {\n  const spec = {\n    one   : x1 =\u003e x1,\n    two   : (x1, x2) =\u003e x1 + x2,\n    three : (\n      x1, x2, x3\n    ) =\u003e x1 + x2 + x3,\n  }\n  expect(applySpec(\n    spec, 1, 2, 3\n  )).toEqual({\n    one   : 1,\n    two   : 3,\n    three : 6,\n  })\n})\n\ntest('arity over 5 arguments', () =\u003e {\n  const spec = {\n    one   : x1 =\u003e x1,\n    two   : (x1, x2) =\u003e x1 + x2,\n    three : (\n      x1, x2, x3\n    ) =\u003e x1 + x2 + x3,\n    four : (\n      x1, x2, x3, x4\n    ) =\u003e x1 + x2 + x3 + x4,\n    five : (\n      x1, x2, x3, x4, x5\n    ) =\u003e x1 + x2 + x3 + x4 + x5,\n  }\n  expect(applySpec(\n    spec, 1, 2, 3, 4, 5\n  )).toEqual({\n    one   : 1,\n    two   : 3,\n    three : 6,\n    four  : 10,\n    five  : 15,\n  })\n})\n\ntest('curried', () =\u003e {\n  const spec = {\n    one   : x1 =\u003e x1,\n    two   : (x1, x2) =\u003e x1 + x2,\n    three : (\n      x1, x2, x3\n    ) =\u003e x1 + x2 + x3,\n  }\n  expect(applySpec(spec)(1)(2)(3)).toEqual({\n    one   : 1,\n    two   : 3,\n    three : 6,\n  })\n})\n\ntest('curried over 5 arguments', () =\u003e {\n  const spec = {\n    one   : x1 =\u003e x1,\n    two   : (x1, x2) =\u003e x1 + x2,\n    three : (\n      x1, x2, x3\n    ) =\u003e x1 + x2 + x3,\n    four : (\n      x1, x2, x3, x4\n    ) =\u003e x1 + x2 + x3 + x4,\n    five : (\n      x1, x2, x3, x4, x5\n    ) =\u003e x1 + x2 + x3 + x4 + x5,\n  }\n  expect(applySpec(spec)(1)(2)(3)(4)(5)).toEqual({\n    one   : 1,\n    two   : 3,\n    three : 6,\n    four  : 10,\n    five  : 15,\n  })\n})\n\ntest('undefined property', () =\u003e {\n  const spec = { prop : path([ 'property', 'doesnt', 'exist' ]) }\n  expect(applySpec(spec, {})).toEqual({ prop : undefined })\n})\n\ntest('restructure json object', () =\u003e {\n  const spec = {\n    id          : path('user.id'),\n    name        : path('user.firstname'),\n    profile     : path('user.profile'),\n    doesntExist : path('user.profile.doesntExist'),\n    info        : { views : compose(inc, prop('views')) },\n    type        : always('playa'),\n  }\n\n  const data = {\n    user : {\n      id        : 1337,\n      firstname : 'john',\n      lastname  : 'shaft',\n      profile   : 'shaft69',\n    },\n    views : 42,\n  }\n\n  expect(applySpec(spec, data)).toEqual({\n    id          : 1337,\n    name        : 'john',\n    profile     : 'shaft69',\n    doesntExist : undefined,\n    info        : { views : 43 },\n    type        : 'playa',\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {multiply, applySpec, inc, dec, add} from 'rambda'\n\ndescribe('applySpec', () =\u003e {\n  it('ramda 1', () =\u003e {\n    const result = applySpec({\n      v: inc,\n      u: dec,\n    })(1)\n    result // $ExpectType { v: number; u: number; }\n  })\n  it('ramda 1', () =\u003e {\n    interface Output {\n      sum: number,\n      multiplied: number,\n    }\n    const result = applySpec\u003cOutput\u003e({\n      sum: add,\n      multiplied: multiply,\n    })(1, 2)\n\n    result // $ExpectType Output\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#applySpec)\n\n### applyTo\n\n```typescript\n\napplyTo\u003cT, U\u003e(el: T, fn: (t: T) =\u003e U): U\n```\n\n```javascript\nconst result = R.applyTo(\n  1,\n  x =\u003e x + 1\n)\n// =\u003e 2\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\napplyTo\u003cT, U\u003e(el: T, fn: (t: T) =\u003e U): U;\napplyTo\u003cT\u003e(el: T): \u003cU\u003e(fn: (t: T) =\u003e U) =\u003e U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.applyTo\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function applyTo(input, fn){\n  if (arguments.length === 1){\n    return _fn =\u003e applyTo(input, _fn)\n  }\n\n  return fn(input)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { applyTo } from './applyTo.js'\nimport { multiply } from './multiply.js'\n\ntest('happy', () =\u003e {\n  expect(applyTo(21, multiply(2))).toBe(42)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#applyTo)\n\n### ascend\n\n```typescript\n\nascend\u003cT\u003e(fn: (obj: T) =\u003e Ord, a: T, b: T): Ordering\n```\n\n```javascript\nconst result = R.sort(R.descend(x =\u003e x), [2, 1])\n// =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nascend\u003cT\u003e(fn: (obj: T) =\u003e Ord, a: T, b: T): Ordering;\nascend\u003cT\u003e(fn: (obj: T) =\u003e Ord): (a: T, b: T) =\u003e Ordering;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.ascend\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function createCompareFunction(\n  a, b, winner, loser\n){\n  if (a === b) return 0\n\n  return a \u003c b ? winner : loser\n}\n\nexport function ascend(\n  getFunction, a, b\n){\n  if (arguments.length === 1){\n    return (_a, _b) =\u003e ascend(\n      getFunction, _a, _b\n    )\n  }\n  const aValue = getFunction(a)\n  const bValue = getFunction(b)\n\n  return createCompareFunction(\n    aValue, bValue, -1, 1\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { ascend } from './ascend.js'\nimport { descend } from './descend.js'\nimport { sort } from './sort.js'\n\nconst people = [\n  {\n    name : 'Emma',\n    age  : 70,\n  },\n  {\n    name : 'Peter',\n    age  : 78,\n  },\n  {\n    name : 'Mikhail',\n    age  : 62,\n  },\n]\n\ntest('ascend', () =\u003e {\n  const result = sort(ascend(x =\u003e x?.age),\n    people)\n  const expected = [\n    {\n      name : 'Mikhail',\n      age  : 62,\n    },\n    {\n      name : 'Emma',\n      age  : 70,\n    },\n    {\n      name : 'Peter',\n      age  : 78,\n    },\n  ]\n  expect(result).toEqual(expected)\n})\n\ntest('descend', () =\u003e {\n  const result = sort(descend(x =\u003e x?.age),\n    people)\n  const expected = [\n    {\n      name : 'Peter',\n      age  : 78,\n    },\n    {\n      name : 'Emma',\n      age  : 70,\n    },\n    {\n      name : 'Mikhail',\n      age  : 62,\n    },\n  ]\n\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#ascend)\n\n### assoc\n\n```typescript\n\nassoc\u003cK extends PropertyKey\u003e(prop: K): {\n  \u003cT\u003e(val: T): \u003cU extends Record\u003cK, T\u003e\u003e(obj: U) =\u003e U\n```\n\nIt makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.\n\n\u003e :boom: This copies and flattens prototype properties\nonto the new object as well. All non-primitive properties are copied by\nreference.\n\n```javascript\nR.assoc('c', 3, {a: 1, b: 2})\n// =\u003e {a: 1, b: 2, c: 3}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nassoc\u003cK extends PropertyKey\u003e(prop: K): {\n  \u003cT\u003e(val: T): \u003cU extends Record\u003cK, T\u003e\u003e(obj: U) =\u003e U;\n  \u003cU extends Record\u003cK, T\u003e, T\u003e(val: T, obj: U): U;\n};\nassoc\u003cT, K extends PropertyKey\u003e(prop: K, val: T): {\n  \u003cU\u003e(obj: U): U extends Record\u003cK, any\u003e ? U[K] extends T ? U : Record\u003cK, T\u003e \u0026 Omit\u003cU, K\u003e : U \u0026 Record\u003cK, T\u003e;\n};\nassoc\u003cU, K extends keyof U, T extends U[K]\u003e(prop: K, val: T, obj: U): U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.assoc\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nexport function assocFn(\n  prop, newValue, obj\n){\n  return Object.assign(\n    {}, obj, { [ prop ] : newValue }\n  )\n}\n\nexport const assoc = curry(assocFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { assoc } from './assoc.js'\n\ntest('adds a key to an empty object', () =\u003e {\n  expect(assoc(\n    'a', 1, {}\n  )).toEqual({ a : 1 })\n})\n\ntest('adds a key to a non-empty object', () =\u003e {\n  expect(assoc(\n    'b', 2, { a : 1 }\n  )).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('adds a key to a non-empty object - curry case 1', () =\u003e {\n  expect(assoc('b', 2)({ a : 1 })).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('adds a key to a non-empty object - curry case 2', () =\u003e {\n  expect(assoc('b')(2, { a : 1 })).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('adds a key to a non-empty object - curry case 3', () =\u003e {\n  const result = assoc('b')(2)({ a : 1 })\n\n  expect(result).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('changes an existing key', () =\u003e {\n  expect(assoc(\n    'a', 2, { a : 1 }\n  )).toEqual({ a : 2 })\n})\n\ntest('undefined is considered an empty object', () =\u003e {\n  expect(assoc(\n    'a', 1, undefined\n  )).toEqual({ a : 1 })\n})\n\ntest('null is considered an empty object', () =\u003e {\n  expect(assoc(\n    'a', 1, null\n  )).toEqual({ a : 1 })\n})\n\ntest('value can be null', () =\u003e {\n  expect(assoc(\n    'a', null, null\n  )).toEqual({ a : null })\n})\n\ntest('value can be undefined', () =\u003e {\n  expect(assoc(\n    'a', undefined, null\n  )).toEqual({ a : undefined })\n})\n\ntest('assignment is shallow', () =\u003e {\n  expect(assoc(\n    'a', { b : 2 }, { a : { c : 3 } }\n  )).toEqual({ a : { b : 2 } })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport { assoc } from 'rambda'\n\ntype Obj = {\n  str: string\n  num: number\n}\n\nconst obj: Obj = { str: 'foo', num: 1 }\nconst newValue = 2\nconst newProp = 'num'\n\ndescribe('R.assoc', () =\u003e {\n  it('happy', () =\u003e {\n    const result = assoc(newProp, newValue, obj)\n\n    result.num // $ExpectType number\n    result.str // $ExpectType string\n  })\n  it('curried 1', () =\u003e {\n    const result = assoc(newProp, newValue)(obj)\n\n    result.num // $ExpectType number\n    result.str // $ExpectType string\n  })\n  it('curried 2', () =\u003e {\n    const result = assoc(newProp)(newValue)(obj)\n\n    result.num // $ExpectType number\n    result.str // $ExpectType string\n  })\n  it('from @types/ramda', () =\u003e {\n    // @ts-expect-error\n    assoc('str')(2, obj)\n    // @ts-expect-error\n    assoc('what')('bar', obj)\n\n    const result1 = assoc('what')(2, {} as Record\u003cstring, number\u003e)\n    result1.what // $ExpectType number\n\n    const result2 = assoc('str')('bar')(obj)\n    result2.str // $ExpectType string\n    result2.num // $ExpectType number\n\n    // @ts-expect-error\n    assoc('str')(2)(obj)\n    // @ts-expect-error\n    assoc('what')('foo')(obj)\n\n    const result3 = assoc('what')(2)({} as Record\u003cstring, number\u003e)\n    result3.what // $ExpectType number\n\n    const result4 = assoc('str', 'bar')(obj)\n    result4.str // $ExpectType string\n    result4.num // $ExpectType number\n\n    assoc('str', 2)(obj)\n    assoc('what', 'bar')(obj)\n\n    const result5 = assoc('str', 2)({} as Record\u003cstring, number\u003e)\n    result5.str // $ExpectType number\n\n    const result6 = assoc('str', 'bar', obj)\n    result6.str // $ExpectType string\n    result6.num // $ExpectType number\n\n    // @ts-expect-error\n    assoc('str', 2, obj)\n    // @ts-expect-error\n\n    assoc('what', 'bar', obj)\n\n    const result7 = assoc('str', 2, {} as Record\u003cstring, number\u003e)\n    result7.str // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#assoc)\n\n### assocPath\n\n```typescript\n\nassocPath\u003cOutput\u003e(path: Path, newValue: any, obj: object): Output\n```\n\nIt makes a shallow clone of `obj` with setting or overriding with `newValue` the property found with `path`.\n\n```javascript\nconst path = 'b.c'\nconst newValue = 2\nconst obj = { a: 1 }\n\nconst result = R.assocPath(path, newValue, obj)\n// =\u003e { a : 1, b : { c : 2 }}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nassocPath\u003cOutput\u003e(path: Path, newValue: any, obj: object): Output;\nassocPath\u003cOutput\u003e(path: Path, newValue: any): (obj: object) =\u003e Output;\nassocPath\u003cOutput\u003e(path: Path): (newValue: any) =\u003e (obj: object) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.assocPath\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { createPath } from './_internals/createPath.js'\nimport { isArray } from './_internals/isArray.js'\nimport { isIndexInteger } from './_internals/isInteger.js'\nimport { assocFn } from './assoc.js'\nimport { curry } from './curry.js'\n\nexport function assocPathFn(\n  path, newValue, input\n){\n  const pathArrValue = createPath(path)\n  if (pathArrValue.length === 0) return newValue\n\n  const index = pathArrValue[ 0 ]\n  if (pathArrValue.length \u003e 1){\n    const condition =\n      typeof input !== 'object' ||\n      input === null ||\n      !input.hasOwnProperty(index)\n\n    const nextInput = condition ?\n      isIndexInteger(pathArrValue[ 1 ]) ?\n        [] :\n        {} :\n      input[ index ]\n\n    newValue = assocPathFn(\n      Array.prototype.slice.call(pathArrValue, 1),\n      newValue,\n      nextInput\n    )\n  }\n\n  if (isIndexInteger(index) \u0026\u0026 isArray(input)){\n    const arr = cloneList(input)\n    arr[ index ] = newValue\n\n    return arr\n  }\n\n  return assocFn(\n    index, newValue, input\n  )\n}\n\nexport const assocPath = curry(assocPathFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { assocPathFn } from './assocPath.js'\n\ntest('happy', () =\u003e {\n  const path = 'a.c.1'\n  const input = {\n    a : {\n      b : 1,\n      c : [ 1, 2 ],\n    },\n  }\n  assocPathFn(\n    path, 3, input\n  )\n  expect(input).toEqual({\n    a : {\n      b : 1,\n      c : [ 1, 2 ],\n    },\n  })\n})\n\ntest('string can be used as path input', () =\u003e {\n  const testObj = {\n    a : [ { b : 1 }, { b : 2 } ],\n    d : 3,\n  }\n  const result1 = assocPathFn(\n    [ 'a', 0, 'b' ], 10, testObj\n  )\n  const result2 = assocPathFn(\n    'a.0.b', 10, testObj\n  )\n\n  const expected = {\n    a : [ { b : 10 }, { b : 2 } ],\n    d : 3,\n  }\n  expect(result1).toEqual(expected)\n  expect(result2).toEqual(expected)\n})\n\ntest('difference with ramda - doesn\\'t overwrite primitive values with keys in the path', () =\u003e {\n  const obj = { a : 'str' }\n  const result = assocPathFn(\n    [ 'a', 'b' ], 42, obj\n  )\n\n  expect(result).toEqual({\n    a : {\n      0 : 's',\n      1 : 't',\n      2 : 'r',\n      b : 42,\n    },\n  })\n})\n\ntest('adds a key to an empty object', () =\u003e {\n  expect(assocPathFn(\n    [ 'a' ], 1, {}\n  )).toEqual({ a : 1 })\n})\n\ntest('adds a key to a non-empty object', () =\u003e {\n  expect(assocPathFn(\n    'b', 2, { a : 1 }\n  )).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('adds a nested key to a non-empty object', () =\u003e {\n  expect(assocPathFn(\n    'b.c', 2, { a : 1 }\n  )).toEqual({\n    a : 1,\n    b : { c : 2 },\n  })\n})\n\ntest('adds a nested key to a nested non-empty object', () =\u003e {\n  expect(assocPathFn('b.d',\n    3,{\n    a : 1,\n    b : { c : 2 },\n  })).toEqual({\n    a : 1,\n    b : {\n      c : 2,\n      d : 3,\n    },\n  })\n})\n\ntest('adds a key to a non-empty object', () =\u003e {\n  expect(assocPathFn('b', 2, { a : 1 })).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('adds a nested key to a non-empty object', () =\u003e {\n  expect(assocPathFn('b.c', 2, { a : 1 })).toEqual({\n    a : 1,\n    b : { c : 2 },\n  })\n})\n\ntest('changes an existing key', () =\u003e {\n  expect(assocPathFn(\n    'a', 2, { a : 1 }\n  )).toEqual({ a : 2 })\n})\n\ntest('undefined is considered an empty object', () =\u003e {\n  expect(assocPathFn(\n    'a', 1, undefined\n  )).toEqual({ a : 1 })\n})\n\ntest('null is considered an empty object', () =\u003e {\n  expect(assocPathFn(\n    'a', 1, null\n  )).toEqual({ a : 1 })\n})\n\ntest('value can be null', () =\u003e {\n  expect(assocPathFn(\n    'a', null, null\n  )).toEqual({ a : null })\n})\n\ntest('value can be undefined', () =\u003e {\n  expect(assocPathFn(\n    'a', undefined, null\n  )).toEqual({ a : undefined })\n})\n\ntest('assignment is shallow', () =\u003e {\n  expect(assocPathFn(\n    'a', { b : 2 }, { a : { c : 3 } }\n  )).toEqual({ a : { b : 2 } })\n})\n\ntest('empty array as path', () =\u003e {\n  const result = assocPathFn(\n    [], 3, {\n      a : 1,\n      b : 2,\n    }\n  )\n  expect(result).toBe(3)\n})\n\ntest('happy', () =\u003e {\n  const expected = { foo : { bar : { baz : 42 } } }\n  const result = assocPathFn(\n    [ 'foo', 'bar', 'baz' ], 42, { foo : null }\n  )\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {assocPath} from 'rambda'\n\ninterface Output {\n  a: number,\n  foo: {bar: number},\n}\n\ndescribe('R.assocPath - user must explicitly set type of output', () =\u003e {\n  it('with array as path input', () =\u003e {\n    const result = assocPath\u003cOutput\u003e(['foo', 'bar'], 2, {a: 1})\n\n    result // $ExpectType Output\n  })\n  it('with string as path input', () =\u003e {\n    const result = assocPath\u003cOutput\u003e('foo.bar', 2, {a: 1})\n\n    result // $ExpectType Output\n  })\n})\n\ndescribe('R.assocPath - curried', () =\u003e {\n  it('with array as path input', () =\u003e {\n    const result = assocPath\u003cOutput\u003e(['foo', 'bar'], 2)({a: 1})\n\n    result // $ExpectType Output\n  })\n  it('with string as path input', () =\u003e {\n    const result = assocPath\u003cOutput\u003e('foo.bar', 2)({a: 1})\n\n    result // $ExpectType Output\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#assocPath)\n\n### binary\n\n```typescript\n\nbinary\u003cT extends (...arg: any[]) =\u003e any\u003e(fn: T): (...args: any[]) =\u003e ReturnType\u003cT\u003e\n```\n\n```javascript\nconst result = R.binary(\n  (a, b, c) =\u003e a + b + c,\n)(1, 2, 3, 4)\n// =\u003e 3\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nbinary\u003cT extends (...arg: any[]) =\u003e any\u003e(fn: T): (...args: any[]) =\u003e ReturnType\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.binary\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function binary(fn){\n  if (fn.length \u003c= 2) return fn\n\n  return (a, b) =\u003e fn(a, b)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { binary } from './binary.js'\n\ntest('happy', () =\u003e {\n  const result = binary(function (\n    x, y, z\n  ){\n    expect(arguments).toHaveLength(2)\n    expect(z).toBeUndefined()\n    expect(x).toBe(10)\n    expect(y).toBe(20)\n\n    return x + y\n  })(\n    10, 20, 30\n  )\n  expect(result).toBe(30)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {binary} from 'rambda'\n\ndescribe('R.binary', () =\u003e {\n  it('happy', () =\u003e {\n    const result = binary(function(x: number, y: number, z) {\n      expect(arguments.length).toBe(2)\n      expect(z).toBeUndefined()\n      expect(x).toBe(10)\n      expect(y).toBe(20)\n      return x + y\n    })(10, 20, 30)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#binary)\n\n### bind\n\n```typescript\n\nbind\u003cF extends AnyFunction, T\u003e(fn: F, thisObj: T): (...args: Parameters\u003cF\u003e) =\u003e ReturnType\u003cF\u003e\n```\n\nCreates a function that is bound to a context.\n\n\u003e :boom: R.bind does not provide the additional argument-binding capabilities of `Function.prototype.bind`.\n\n```javascript\nconst log = R.bind(console.log, console)\nconst result = R.pipe(\n  R.assoc('a', 2), \n  R.tap(log), \n  R.assoc('a', 3)\n)({a: 1}); \n// =\u003e result - `{a: 3}`\n// =\u003e console log - `{a: 2}`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nbind\u003cF extends AnyFunction, T\u003e(fn: F, thisObj: T): (...args: Parameters\u003cF\u003e) =\u003e ReturnType\u003cF\u003e;\nbind\u003cF extends AnyFunction, T\u003e(fn: F): (thisObj: T) =\u003e (...args: Parameters\u003cF\u003e) =\u003e ReturnType\u003cF\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.bind\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curryN } from './curryN.js'\n\nexport function bind(fn, thisObj){\n  if (arguments.length === 1){\n    return _thisObj =\u003e bind(fn, _thisObj)\n  }\n\n  return curryN(fn.length, (...args) =\u003e fn.apply(thisObj, args))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { bind } from './bind.js'\n\nfunction Foo(x){\n  this.x = x\n}\nfunction add(x){\n  return this.x + x\n}\nfunction Bar(x, y){\n  this.x = x\n  this.y = y\n}\nBar.prototype = new Foo()\nBar.prototype.getX = function (){\n  return 'prototype getX'\n}\n\ntest('returns a function', () =\u003e {\n  expect(typeof bind(add)(Foo)).toBe('function')\n})\n\ntest('returns a function bound to the specified context object', () =\u003e {\n  const f = new Foo(12)\n  function isFoo(){\n    return this instanceof Foo\n  }\n  const isFooBound = bind(isFoo, f)\n  expect(isFoo()).toBeFalse()\n  expect(isFooBound()).toBeTrue()\n})\n\ntest('works with built-in types', () =\u003e {\n  const abc = bind(String.prototype.toLowerCase, 'ABCDEFG')\n  expect(typeof abc).toBe('function')\n  expect(abc()).toBe('abcdefg')\n})\n\ntest('works with user-defined types', () =\u003e {\n  const f = new Foo(12)\n  function getX(){\n    return this.x\n  }\n  const getXFooBound = bind(getX, f)\n  expect(getXFooBound()).toBe(12)\n})\n\ntest('works with plain objects', () =\u003e {\n  const pojso = { x : 100 }\n  function incThis(){\n    return this.x + 1\n  }\n  const incPojso = bind(incThis, pojso)\n  expect(typeof incPojso).toBe('function')\n  expect(incPojso()).toBe(101)\n})\n\ntest('does not interfere with existing object methods', () =\u003e {\n  const b = new Bar('a', 'b')\n  function getX(){\n    return this.x\n  }\n  const getXBarBound = bind(getX, b)\n  expect(b.getX()).toBe('prototype getX')\n  expect(getXBarBound()).toBe('a')\n})\n\ntest('preserves arity', () =\u003e {\n  const f0 = function (){\n    return 0\n  }\n  const f1 = function (a){\n    return a\n  }\n  const f2 = function (a, b){\n    return a + b\n  }\n  const f3 = function (\n    a, b, c\n  ){\n    return a + b + c\n  }\n\n  expect(bind(f0, {})).toHaveLength(0)\n  expect(bind(f1, {})).toHaveLength(1)\n  expect(bind(f2, {})).toHaveLength(2)\n  expect(bind(f3, {})).toHaveLength(3)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {bind} from 'rambda'\n\nclass Foo {}\nfunction isFoo\u003cT = any\u003e(this: T): boolean {\n  return this instanceof Foo\n}\n\ndescribe('R.bind', () =\u003e {\n  it('happy', () =\u003e {\n    const foo = new Foo()\n    const result = bind(isFoo, foo)()\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#bind)\n\n### both\n\n```typescript\n\nboth(pred1: Pred, pred2: Pred): Pred\n```\n\nIt returns a function with `input` argument. \n\nThis function will return `true`, if both `firstCondition` and `secondCondition` return `true` when `input` is passed as their argument.\n\n```javascript\nconst firstCondition = x =\u003e x \u003e 10\nconst secondCondition = x =\u003e x \u003c 20\nconst fn = R.both(firstCondition, secondCondition)\n\nconst result = [fn(15), fn(30)]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nboth(pred1: Pred, pred2: Pred): Pred;\nboth\u003cT\u003e(pred1: Predicate\u003cT\u003e, pred2: Predicate\u003cT\u003e): Predicate\u003cT\u003e;\nboth\u003cT\u003e(pred1: Predicate\u003cT\u003e): (pred2: Predicate\u003cT\u003e) =\u003e Predicate\u003cT\u003e;\nboth(pred1: Pred): (pred2: Pred) =\u003e Pred;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.both\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function both(f, g){\n  if (arguments.length === 1) return _g =\u003e both(f, _g)\n\n  return (...input) =\u003e f(...input) \u0026\u0026 g(...input)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { both } from './both.js'\n\nconst firstFn = val =\u003e val \u003e 0\nconst secondFn = val =\u003e val \u003c 10\n\ntest('with curry', () =\u003e {\n  expect(both(firstFn)(secondFn)(17)).toBeFalse()\n})\n\ntest('without curry', () =\u003e {\n  expect(both(firstFn, secondFn)(7)).toBeTrue()\n})\n\ntest('with multiple inputs', () =\u003e {\n  const between = function (\n    a, b, c\n  ){\n    return a \u003c b \u0026\u0026 b \u003c c\n  }\n  const total20 = function (\n    a, b, c\n  ){\n    return a + b + c === 20\n  }\n  const fn = both(between, total20)\n  expect(fn(\n    5, 7, 8\n  )).toBeTrue()\n})\n\ntest('skip evaluation of the second expression', () =\u003e {\n  let effect = 'not evaluated'\n  const F = function (){\n    return false\n  }\n  const Z = function (){\n    effect = 'Z got evaluated'\n  }\n  both(F, Z)()\n\n  expect(effect).toBe('not evaluated')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {both} from 'rambda'\n\ndescribe('R.both', () =\u003e {\n  it('with passed type', () =\u003e {\n    const fn = both\u003cnumber\u003e(\n      x =\u003e x \u003e 1,\n      x =\u003e x % 2 === 0\n    )\n    fn // $ExpectType Predicate\u003cnumber\u003e\n    const result = fn(2) // $ExpectType boolean\n    result // $ExpectType boolean\n  })\n  it('with passed type - curried', () =\u003e {\n    const fn = both\u003cnumber\u003e(x =\u003e x \u003e 1)(x =\u003e x % 2 === 0)\n    fn // $ExpectType Predicate\u003cnumber\u003e\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n  it('no type passed', () =\u003e {\n    const fn = both(\n      x =\u003e {\n        x // $ExpectType any\n        return x \u003e 1\n      },\n      x =\u003e {\n        x // $ExpectType any\n        return x % 2 === 0\n      }\n    )\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n  it('no type passed - curried', () =\u003e {\n    const fn = both((x: number) =\u003e {\n      x // $ExpectType number\n      return x \u003e 1\n    })((x: number) =\u003e {\n      x // $ExpectType number\n      return x % 2 === 0\n    })\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#both)\n\n### call\n\n```typescript\n\ncall\u003cT extends (...args: any[]) =\u003e any\u003e(fn: T, ...args: Parameters\u003cT\u003e): ReturnType\u003cT\u003e\n```\n\n```javascript\nconst result = R.call(\n  (a, b) =\u003e a + b,\n  1,\n  2\n)\n// =\u003e 3\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncall\u003cT extends (...args: any[]) =\u003e any\u003e(fn: T, ...args: Parameters\u003cT\u003e): ReturnType\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.call\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport const call = (fn, ...inputs) =\u003e fn(...inputs)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { bind } from './bind.js'\nimport { call } from './call.js'\n\ntest('happy', () =\u003e {\n  expect(call(\n    Math.max, 1, 2, 3, -99, 42, 6, 7\n  )).toBe(42)\n})\n\ntest('accepts one or more arguments', () =\u003e {\n  const fn = function (){\n    return arguments.length\n  }\n  expect(call(fn)).toBe(0)\n  expect(call(fn, 'x')).toBe(1)\n  expect(call(\n    fn, 'x', 'y'\n  )).toBe(2)\n  expect(call(\n    fn, 'x', 'y', 'z'\n  )).toBe(3)\n})\n\ntest('provides no way to specify context', () =\u003e {\n  var obj = {\n    method (){\n      return this === obj\n    },\n  }\n  expect(call(obj.method)).toBe(false)\n  expect(call(bind(obj.method, obj))).toBe(true)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#call)\n\n### chain\n\n```typescript\n\nchain\u003cT, U\u003e(fn: (n: T) =\u003e U[], list: T[]): U[]\n```\n\nThe method is also known as `flatMap`.\n\n```javascript\nconst duplicate = n =\u003e [ n, n ]\nconst list = [ 1, 2, 3 ]\n\nconst result = chain(duplicate, list)\n// =\u003e [ 1, 1, 2, 2, 3, 3 ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nchain\u003cT, U\u003e(fn: (n: T) =\u003e U[], list: T[]): U[];\nchain\u003cT, U\u003e(fn: (n: T) =\u003e U[]): (list: T[]) =\u003e U[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.chain\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function chain(fn, list){\n  if (arguments.length === 1){\n    return _list =\u003e chain(fn, _list)\n  }\n\n  return [].concat(...list.map(fn))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { chain as chainRamda } from 'ramda'\n\nimport { chain } from './chain.js'\n\nconst duplicate = n =\u003e [ n, n ]\n\ntest('happy', () =\u003e {\n  const fn = x =\u003e [ x * 2 ]\n  const list = [ 1, 2, 3 ]\n\n  const result = chain(fn, list)\n\n  expect(result).toEqual([ 2, 4, 6 ])\n})\n\ntest('maps then flattens one level', () =\u003e {\n  expect(chain(duplicate, [ 1, 2, 3 ])).toEqual([ 1, 1, 2, 2, 3, 3 ])\n})\n\ntest('maps then flattens one level - curry', () =\u003e {\n  expect(chain(duplicate)([ 1, 2, 3 ])).toEqual([ 1, 1, 2, 2, 3, 3 ])\n})\n\ntest('flattens only one level', () =\u003e {\n  const nest = n =\u003e [ [ n ] ]\n  expect(chain(nest, [ 1, 2, 3 ])).toEqual([ [ 1 ], [ 2 ], [ 3 ] ])\n})\n\ntest('can compose', () =\u003e {\n  function dec(x){\n    return [ x - 1 ]\n  }\n  function times2(x){\n    return [ x * 2 ]\n  }\n\n  const mdouble = chain(times2)\n  const mdec = chain(dec)\n  expect(mdec(mdouble([ 10, 20, 30 ]))).toEqual([ 19, 39, 59 ])\n})\n\ntest('@types/ramda broken test', () =\u003e {\n  const score = {\n    maths   : 90,\n    physics : 80,\n  }\n\n  const calculateTotal = score =\u003e {\n    const { maths, physics } = score\n\n    return maths + physics\n  }\n\n  const assocTotalToScore = (total, score) =\u003e ({\n    ...score,\n    total,\n  })\n\n  const calculateAndAssocTotalToScore = chainRamda(assocTotalToScore,\n    calculateTotal)\n  expect(() =\u003e\n    calculateAndAssocTotalToScore(score)).toThrowErrorMatchingInlineSnapshot('\"fn(...) is not a function\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {chain} from 'rambda'\n\nconst list = [1, 2, 3]\nconst fn = (x: number) =\u003e [`${x}`, `${x}`]\n\ndescribe('R.chain', () =\u003e {\n  it('without passing type', () =\u003e {\n    const result = chain(fn, list)\n    result // $ExpectType string[]\n\n    const curriedResult = chain(fn)(list)\n    curriedResult // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#chain)\n\n### clamp\n\n```typescript\n\nclamp(min: number, max: number, input: number): number\n```\n\nRestrict a number `input` to be within `min` and `max` limits.\n\nIf `input` is bigger than `max`, then the result is `max`.\n\nIf `input` is smaller than `min`, then the result is `min`.\n\n```javascript\nconst result = [\n  R.clamp(0, 10, 5), \n  R.clamp(0, 10, -1),\n  R.clamp(0, 10, 11)\n]\n// =\u003e [5, 0, 10]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nclamp(min: number, max: number, input: number): number;\nclamp(min: number, max: number): (input: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.clamp\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction clampFn(\n  min, max, input\n){\n  if (min \u003e max){\n    throw new Error('min must not be greater than max in clamp(min, max, value)')\n  }\n  if (input \u003e= min \u0026\u0026 input \u003c= max) return input\n\n  if (input \u003e max) return max\n  if (input \u003c min) return min\n}\n\nexport const clamp = curry(clampFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { clamp } from './clamp.js'\n\ntest('when min is greater than max', () =\u003e {\n  expect(() =\u003e clamp(\n    -5, -10, 5\n  )).toThrowErrorMatchingInlineSnapshot('\"min must not be greater than max in clamp(min, max, value)\"')\n})\n\ntest('rambda specs', () =\u003e {\n  expect(clamp(\n    1, 10, 0\n  )).toBe(1)\n  expect(clamp(\n    3, 12, 1\n  )).toBe(3)\n  expect(clamp(\n    -15, 3, -100\n  )).toBe(-15)\n  expect(clamp(\n    1, 10, 20\n  )).toBe(10)\n  expect(clamp(\n    3, 12, 23\n  )).toBe(12)\n  expect(clamp(\n    -15, 3, 16\n  )).toBe(3)\n  expect(clamp(\n    1, 10, 4\n  )).toBe(4)\n  expect(clamp(\n    3, 12, 6\n  )).toBe(6)\n  expect(clamp(\n    -15, 3, 0\n  )).toBe(0)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {clamp} from 'rambda'\n\ndescribe('R.clamp', () =\u003e {\n  it('happy', () =\u003e {\n    const result = clamp(1, 10, 20)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#clamp)\n\n### clone\n\n```typescript\n\nclone\u003cT\u003e(input: T): T\n```\n\nIt creates a deep copy of the `input`, which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates.\n\n\u003e :boom: It doesn't work with very specific types, such as MongoDB's ObjectId.\n\n```javascript\nconst objects = [{a: 1}, {b: 2}];\nconst objectsClone = R.clone(objects);\n\nconst result = [\n  R.equals(objects, objectsClone),\n  R.equals(objects[0], objectsClone[0]),\n] // =\u003e [ true, true ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nclone\u003cT\u003e(input: T): T;\nclone\u003cT\u003e(input: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.clone\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function clone(input){\n  const out = isArray(input) ? Array(input.length) : {}\n  if (input \u0026\u0026 input.getTime) return new Date(input.getTime())\n\n  for (const key in input){\n    const v = input[ key ]\n    out[ key ] =\n      typeof v === 'object' \u0026\u0026 v !== null ?\n        v.getTime ?\n          new Date(v.getTime()) :\n          clone(v) :\n        v\n  }\n\n  return out\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport assert from 'assert'\nimport { clone as cloneRamda } from 'ramda'\n\nimport {\n  compareCombinations,\n  EXTRA_BUILD_IN_OBJECTS,\n  FALSY_VALUES,\n} from './_internals/testUtils.js'\nimport { clone } from './clone.js'\nimport { equals } from './equals.js'\n\ntest('with array', () =\u003e {\n  const arr = [\n    {\n      b : 2,\n      c : 'foo',\n      d : [ 1, 2, 3 ],\n    },\n    1,\n    new Date(),\n    null,\n  ]\n  expect(clone(arr)).toEqual(arr)\n})\n\ntest('with object', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n    c : 3,\n    d : [ 1, 2, 3 ],\n    e : new Date(),\n  }\n  expect(clone(obj)).toEqual(obj)\n})\n\ntest('with date', () =\u003e {\n  const date = new Date(\n    2014, 10, 14, 23, 59, 59, 999\n  )\n\n  const cloned = clone(date)\n  assert.notStrictEqual(date, cloned)\n  expect(cloned).toEqual(new Date(\n    2014, 10, 14, 23, 59, 59, 999\n  ))\n\n  expect(cloned.getDay()).toBe(5)\n})\n\ntest('with R.equals', () =\u003e {\n  const objects = [ { a : 1 }, { b : 2 } ]\n\n  const objectsClone = clone(objects)\n\n  const result = [\n    equals(objects, objectsClone),\n    equals(objects[ 0 ], objectsClone[ 0 ]),\n  ]\n  expect(result).toEqual([ true, true ])\n})\n\ndescribe('brute force', () =\u003e {\n  const possibleInputs = [ ...FALSY_VALUES, ...EXTRA_BUILD_IN_OBJECTS ]\n  compareCombinations({\n    fn         : clone,\n    fnRamda    : cloneRamda,\n    firstInput : possibleInputs,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 15,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 15,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {clone} from 'rambda'\n\ndescribe('R.clone', () =\u003e {\n  it('happy', () =\u003e {\n    const obj = {a: 1, b: 2}\n    const result = clone(obj)\n    result // $ExpectType { a: number; b: number; }\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#clone)\n\n### collectBy\n\n```typescript\n\ncollectBy\u003cT, K extends PropertyKey\u003e(keyFn: (value: T) =\u003e K, list: T[]): T[][]\n```\n\n```javascript\nconst result = R.collectBy(\n  x =\u003e x % 2,\n  [1, 2, 3, 4]\n)\n// =\u003e [[2, 4], [1, 3]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncollectBy\u003cT, K extends PropertyKey\u003e(keyFn: (value: T) =\u003e K, list: T[]): T[][];\ncollectBy\u003cT, K extends PropertyKey\u003e(keyFn: (value: T) =\u003e K): (list: T[]) =\u003e T[][];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.collectBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { reduce } from './reduce.js'\n\nexport function collectBy(fn, list){\n  if (arguments.length === 1){\n    return _list =\u003e collectBy(fn, _list)\n  }\n\n  const group = reduce(\n    (o, x) =\u003e {\n      const tag = fn(x)\n      if (o[ tag ] === undefined){\n        o[ tag ] = []\n      }\n      o[ tag ].push(x)\n\n      return o\n    },\n    {},\n    list\n  )\n  const newList = []\n  for (const tag in group){\n    newList.push(group[ tag ])\n  }\n\n  return newList\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport fc from 'fast-check'\nimport {\n  all,\n  compose,\n  difference,\n  equals,\n  head,\n  identity,\n  is,\n  isEmpty,\n  length,\n  uniq,\n  unnest,\n} from 'rambdax'\n\nimport { collectBy } from './collectBy.js'\n\ntest('returns a list of lists', () =\u003e {\n  fc.assert(fc.property(fc.array(fc.nat()), xs =\u003e {\n    const check = all(is(Array))\n    const ys = collectBy(identity)(xs)\n\n    return check(ys)\n  }))\n})\n\ntest('groups items but neither adds new ones nor removes any', () =\u003e {\n  fc.assert(fc.property(fc.array(fc.nat()), xs =\u003e {\n    const check = compose(\n      isEmpty, difference(xs), unnest\n    )\n    const ys = collectBy(identity)(xs)\n\n    return check(ys)\n  }))\n})\n\ntest('groups related items together', () =\u003e {\n  fc.assert(fc.property(fc.array(fc.boolean()), xs =\u003e {\n    const ys = collectBy(identity)(xs)\n    const check = all(compose(\n      equals(1), length, uniq\n    ))\n\n    return check(ys)\n  }))\n})\n\ntest('invokes the tag function for each item in the list', () =\u003e {\n  fc.assert(fc.property(fc.array(fc.nat()), xs =\u003e {\n    const id = jest.fn(x =\u003e 42)\n    collectBy(id)(xs)\n    const check = compose(isEmpty, difference(xs))\n\n    return check(id.mock.calls.map(call =\u003e call[ 0 ]))\n  }))\n})\n\ntest('groups items according to the tag value', () =\u003e {\n  fc.assert(fc.property(fc.array(fc.nat()), xs =\u003e {\n    const ys = collectBy(x =\u003e 42)(xs)\n    const check = compose(\n      isEmpty, difference(xs), head\n    )\n\n    return isEmpty(xs) \u0026\u0026 isEmpty(ys) ? true : check(ys)\n  }))\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#collectBy)\n\n### comparator\n\n```typescript\n\ncomparator\u003cT\u003e(pred: (a: T, b: T) =\u003e boolean): (x: T, y: T) =\u003e Ordering\n```\n\nIt returns a comparator function that can be used in `sort` method.\n\n```javascript\nconst result = R.sort(\n  R.comparator((a, b) =\u003e a.x \u003c b.x),\n  [{x: 2}, {x: 1}]\n)\n// =\u003e [{x: 1}, {x: 2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncomparator\u003cT\u003e(pred: (a: T, b: T) =\u003e boolean): (x: T, y: T) =\u003e Ordering;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.comparator\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function comparator(fn){\n  return function (a, b){\n    return fn(a, b) ? -1 : fn(b, a) ? 1 : 0\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { comparator } from './comparator.js'\n\ntest('happy', () =\u003e {\n  expect([ 3, 1, 8, 1, 2, 5 ].sort(comparator((a, b) =\u003e a \u003c b))).toEqual([\n    1, 1, 2, 3, 5, 8,\n  ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#comparator)\n\n### complement\n\n```typescript\n\ncomplement\u003cT extends any[]\u003e(predicate: (...args: T) =\u003e unknown): (...args: T) =\u003e boolean\n```\n\nIt returns `inverted` version of `origin` function that accept `input` as argument.\n\nThe return value of `inverted` is the negative boolean value of `origin(input)`.\n\n```javascript\nconst origin = x =\u003e x \u003e 5\nconst inverted = complement(origin)\n\nconst result = [\n  origin(7),\n  inverted(7)\n] =\u003e [ true, false ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncomplement\u003cT extends any[]\u003e(predicate: (...args: T) =\u003e unknown): (...args: T) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.complement\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function complement(fn){\n  return (...input) =\u003e !fn(...input)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { complement } from './complement.js'\n\ntest('happy', () =\u003e {\n  const fn = complement(x =\u003e x.length === 0)\n\n  expect(fn([ 1, 2, 3 ])).toBeTrue()\n})\n\ntest('with multiple parameters', () =\u003e {\n  const between = function (\n    a, b, c\n  ){\n    return a \u003c b \u0026\u0026 b \u003c c\n  }\n  const f = complement(between)\n  expect(f(\n    4, 5, 11\n  )).toBeFalse()\n  expect(f(\n    12, 2, 6\n  )).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {complement, isNil} from 'rambda'\n\ndescribe('R.complement', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = complement(isNil)\n    const result = fn(null)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#complement)\n\n### compose\n\n```typescript\n\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult\u003e(\n  ...func: [\n      fnLast: (a: any) =\u003e TResult,\n      ...func: Array\u003c(a: any) =\u003e any\u003e,\n      f7: (a: R6) =\u003e R7,\n      f6: (a: R5) =\u003e R6,\n      f5: (a: R4) =\u003e R5,\n      f4: (a: R3) =\u003e R4,\n      f3: (a: R2) =\u003e R3,\n      f2: (a: R1) =\u003e R2,\n      f1: (...args: TArgs) =\u003e R1\n  ]\n): (...args: TArgs) =\u003e TResult\n```\n\nIt performs right-to-left function composition.\n\n```javascript\nconst result = R.compose(\n  R.map(x =\u003e x * 2),\n  R.filter(x =\u003e x \u003e 2)\n)([1, 2, 3, 4])\n\n// =\u003e [6, 8]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult\u003e(\n  ...func: [\n      fnLast: (a: any) =\u003e TResult,\n      ...func: Array\u003c(a: any) =\u003e any\u003e,\n      f7: (a: R6) =\u003e R7,\n      f6: (a: R5) =\u003e R6,\n      f5: (a: R4) =\u003e R5,\n      f4: (a: R3) =\u003e R4,\n      f3: (a: R2) =\u003e R3,\n      f2: (a: R1) =\u003e R2,\n      f1: (...args: TArgs) =\u003e R1\n  ]\n): (...args: TArgs) =\u003e TResult;\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult\u003e(\n  f7: (a: R6) =\u003e R7,\n  f6: (a: R5) =\u003e R6,\n  f5: (a: R4) =\u003e R5,\n  f4: (a: R3) =\u003e R4,\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R7;\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7\u003e(\n  f7: (a: R6) =\u003e R7,\n  f6: (a: R5) =\u003e R6,\n  f5: (a: R4) =\u003e R5,\n  f4: (a: R3) =\u003e R4,\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R7;\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6\u003e(\n  f6: (a: R5) =\u003e R6,\n  f5: (a: R4) =\u003e R5,\n  f4: (a: R3) =\u003e R4,\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R6;\ncompose\u003cTArgs extends any[], R1, R2, R3, R4, R5\u003e(\n  f5: (a: R4) =\u003e R5,\n  f4: (a: R3) =\u003e R4,\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R5;\ncompose\u003cTArgs extends any[], R1, R2, R3, R4\u003e(\n  f4: (a: R3) =\u003e R4,\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R4;\ncompose\u003cTArgs extends any[], R1, R2, R3\u003e(\n  f3: (a: R2) =\u003e R3,\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R3;\ncompose\u003cTArgs extends any[], R1, R2\u003e(\n  f2: (a: R1) =\u003e R2,\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R2;\ncompose\u003cTArgs extends any[], R1\u003e(\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R1;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.compose\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { pipe } from './pipe.js'\n\nexport function compose(){\n  if (arguments.length === 0){\n    throw new Error('compose requires at least one argument')\n  }\n\n  return pipe.apply(this, Array.prototype.slice.call(arguments, 0).reverse())\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { compose as composeRamda } from 'ramda'\n\nimport { add } from './add.js'\nimport { compose } from './compose.js'\nimport { filter } from './filter.js'\nimport { last } from './last.js'\nimport { map } from './map.js'\n\ntest('happy', () =\u003e {\n  const result = compose(\n    last, map(add(10)), map(add(1))\n  )([ 1, 2, 3 ])\n\n  expect(result).toBe(14)\n})\n\ntest('can accepts initially two arguments', () =\u003e {\n  const result = compose(map(x =\u003e x * 2),\n    (list, limit) =\u003e filter(x =\u003e x \u003e limit, list))([ 1, 2, 3, 4, false ], 2)\n\n  expect(result).toEqual([ 6, 8 ])\n})\n\ntest('when no arguments is passed', () =\u003e {\n  expect(() =\u003e compose()).toThrowErrorMatchingInlineSnapshot('\"compose requires at least one argument\"')\n})\n\ntest('ramda spec', () =\u003e {\n  const f = function (\n    a, b, c\n  ){\n    return [ a, b, c ]\n  }\n  const g = compose(f)\n\n  expect(g(\n    1, 2, 3\n  )).toEqual([ 1, 2, 3 ])\n})\n\ntest('does return correct length of composed function', () =\u003e {\n  expect(compose(\n    map, map, map\n  )).toHaveLength(2)\n  expect(composeRamda(\n    map, map, map\n  )).toHaveLength(2)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {\n  add,\n  subtract,\n  compose,\n  map,\n  filter,\n  identity,\n  inc,\n  negate,\n  dissoc,\n} from 'rambda'\n\ninterface Input {\n  a: string,\n  b: string,\n}\ninterface Output {\n  c: string,\n}\n\ndescribe('R.compose with explicit types', () =\u003e {\n  it('with explicit types - complex', () =\u003e {\n    const obj = {\n      a: 'foo',\n      b: 'bar',\n    }\n    interface AfterInput {\n      a: number,\n    }\n    interface BeforeOutput {\n      b: string,\n    }\n\n    const result = compose\u003cInput[], AfterInput, BeforeOutput, Output\u003e(\n      x =\u003e ({c: x.b + 'bar'}),\n      x =\u003e ({b: x.a + 'foo'}),\n      x =\u003e ({a: x.a.length + x.b.length})\n    )(obj)\n\n    result // $ExpectType Output\n  })\n  it('with explicit types - correct', () =\u003e {\n    const obj = {\n      a: 'foo',\n      b: 'bar',\n    }\n    const result = compose\u003cInput[], Output, Output\u003e(identity, input =\u003e {\n      input // $ExpectType Input\n      return input as unknown as Output\n    })(obj)\n    result // $ExpectType Output\n  })\n  it('with explicit types - wrong', () =\u003e {\n    const obj: Input = {\n      a: 'foo',\n      b: 'bar',\n    }\n\n    // @ts-expect-error\n    compose\u003cstring, number, Output\u003e(identity, dissoc('b'))(obj)\n  })\n})\n\ndescribe('R.compose', () =\u003e {\n  it('happy', () =\u003e {\n    const result = compose(subtract(11), add(1), add(1))(1)\n    result // $ExpectType number\n  })\n  it('happy - more complex', () =\u003e {\n    const result = compose(\n      (x: number) =\u003e x + 1,\n      (x: string) =\u003e x.length + 1\n    )('foo')\n    result // $ExpectType number\n  })\n\n  it('with R.filter', () =\u003e {\n    const result = compose(\n      filter\u003cnumber\u003e(x =\u003e x \u003e 2),\n      map(add(1))\n    )([1, 2, 3])\n    result // $ExpectType number[]\n  })\n\n  it('with native filter', () =\u003e {\n    const result = compose(\n      (list: number[]) =\u003e list.filter(x =\u003e x \u003e 2),\n      (list: number[]) =\u003e {\n        list // $ExpectType number[]\n        return list\n      },\n      map(add(1))\n    )([1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n\n  it('with void', () =\u003e {\n    const result = compose(\n      () =\u003e {},\n      () =\u003e {}\n    )()\n    result // $ExpectType void\n  })\n})\n\ndescribe('R.compose - @types/ramda tests', () =\u003e {\n  test('complex', () =\u003e {\n    const fn = compose(\n      inc,\n      inc,\n      inc,\n      inc,\n      inc,\n      inc,\n      inc,\n      inc,\n      negate,\n      Math.pow\n    )\n    const result = fn(3, 4)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#compose)\n\n### composeWith\n\n```typescript\n\ncomposeWith\u003cTArgs extends any[], TResult\u003e(\n  transformer: (fn: (...args: any[]) =\u003e any, intermediatResult: any) =\u003e any,\n  fns: AtLeastOneFunctionsFlowFromRightToLeft\u003cTArgs, TResult\u003e,\n): (...args: TArgs) =\u003e TResult\n```\n\n```javascript\nconst result = R.composeWith(\n  (fn, intermediateResult) =\u003e fn(intermediateResult),\n  [\n    R.map(x =\u003e x + 1),\n    R.map(x =\u003e x * 2),\n  ]\n)([1, 2, 3])\n// =\u003e [3, 5, 7]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncomposeWith\u003cTArgs extends any[], TResult\u003e(\n  transformer: (fn: (...args: any[]) =\u003e any, intermediatResult: any) =\u003e any,\n  fns: AtLeastOneFunctionsFlowFromRightToLeft\u003cTArgs, TResult\u003e,\n): (...args: TArgs) =\u003e TResult;\ncomposeWith(\n  transformer: (fn: (...args: any[]) =\u003e any, intermediatResult: any) =\u003e any,\n): \u003cTArgs extends any[], TResult\u003e(\n  fns: AtLeastOneFunctionsFlowFromRightToLeft\u003cTArgs, TResult\u003e,\n) =\u003e (...args: TArgs) =\u003e TResult;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.composeWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _arity } from './_internals/_arity.js'\nimport { head } from './head.js'\nimport { identity } from './identity.js'\nimport { reduce } from './reduce.js'\nimport { reverse } from './reverse.js'\nimport { tail } from './tail.js'\n\nexport function pipeWith(xf, list){\n  if (list.length \u003c= 0){\n    return identity\n  }\n\n  const headList = head(list)\n  const tailList = tail(list)\n\n  return _arity(headList.length, function (){\n    return reduce(\n      function (result, f){\n        return xf.call(\n          this, f, result\n        )\n      },\n      headList.apply(this, arguments),\n      tailList\n    )\n  })\n}\n\nexport function composeWith(xf, list){\n  if (arguments.length === 1) return _list =\u003e composeWith(xf, _list)\n\n  return pipeWith.apply(this, [ xf, reverse(list) ])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { always, identity, inc, isNil, map, modulo, multiply } from 'rambdax'\nimport { composeWith as composeWithRamda, concat, flip, ifElse } from 'ramda'\n\nimport { composeWith } from './composeWith.js'\n\ntest('performs right-to-left function composition with function applying', () =\u003e {\n  const f = composeWith((f, res) =\u003e f(res))([ map, multiply, parseInt ])\n\n  expect(f).toHaveLength(2)\n  expect(f('10')([ 1, 2, 3 ])).toEqual([ 10, 20, 30 ])\n  expect(f('10', 2)([ 1, 2, 3 ])).toEqual([ 2, 4, 6 ])\n})\n\ntest('performs right-to-left function while not nil result', () =\u003e {\n  const isOdd = flip(modulo)(2)\n  const composeWhenNotNil = composeWithRamda((f, res) =\u003e\n    isNil(res) ? null : f(res))\n\n  const f = composeWhenNotNil([\n    inc,\n    ifElse(\n      isOdd, identity, always(null)\n    ),\n    parseInt,\n  ])\n  expect(f).toHaveLength(2)\n  expect(f('1')).toBe(2)\n  expect(f('2')).toBeNull()\n})\n\ntest('performs right-to-left function using promise chaining', () =\u003e {\n  const then = function (f, p){\n    return p.then(f)\n  }\n  const composeP = composeWithRamda(then)\n  const toListPromise = function (a){\n    return new Promise(res =\u003e {\n      res([ a ])\n    })\n  }\n  const doubleListPromise = function (a){\n    return new Promise(res =\u003e {\n      res(concat(a, a))\n    })\n  }\n  const f = composeP([ doubleListPromise, toListPromise ])\n\n  return f(1).then(res =\u003e {\n    expect(res).toEqual([ 1, 1 ])\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#composeWith)\n\n### concat\n\n```typescript\n\nconcat\u003cT\u003e(x: T[], y: T[]): T[]\n```\n\nIt returns a new string or array, which is the result of merging `x` and `y`.\n\n```javascript\nR.concat([1, 2])([3, 4]) // =\u003e [1, 2, 3, 4]\nR.concat('foo', 'bar') // =\u003e 'foobar'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nconcat\u003cT\u003e(x: T[], y: T[]): T[];\nconcat\u003cT\u003e(x: T[]): (y: T[]) =\u003e T[];\nconcat(x: string, y: string): string;\nconcat(x: string): (y: string) =\u003e string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.concat\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function concat(x, y){\n  if (arguments.length === 1) return _y =\u003e concat(x, _y)\n\n  return typeof x === 'string' ? `${ x }${ y }` : [ ...x, ...y ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { concat } from './concat.js'\n\ntest('happy', () =\u003e {\n  const arr1 = [ 'a', 'b', 'c' ]\n  const arr2 = [ 'd', 'e', 'f' ]\n\n  const a = concat(arr1, arr2)\n  const b = concat(arr1)(arr2)\n  const expectedResult = [ 'a', 'b', 'c', 'd', 'e', 'f' ]\n\n  expect(a).toEqual(expectedResult)\n  expect(b).toEqual(expectedResult)\n})\n\ntest('with strings', () =\u003e {\n  expect(concat('ABC', 'DEF')).toBe('ABCDEF')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {concat} from 'rambda'\n\nconst list1 = [1, 2, 3]\nconst list2 = [4, 5, 6]\n\ndescribe('R.concat', () =\u003e {\n  it('happy', () =\u003e {\n    const result = concat(list1, list2)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = concat(list1)(list2)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#concat)\n\n### cond\n\n```typescript\n\ncond\u003cT extends any[], R\u003e(conditions: Array\u003cCondPair\u003cT, R\u003e\u003e): (...args: T) =\u003e R\n```\n\nIt takes list with `conditions` and returns a new function `fn` that expects `input` as argument. \n\nThis function will start evaluating the `conditions` in order to find the first winner(order of conditions matter). \n\nThe winner is this condition, which left side returns `true` when `input` is its argument. Then the evaluation of the right side of the winner will be the final result.\n\nIf no winner is found, then `fn` returns `undefined`.\n\n```javascript\nconst fn = R.cond([\n  [ x =\u003e x \u003e 25, R.always('more than 25') ],\n  [ x =\u003e x \u003e 15, R.always('more than 15') ],\n  [ R.T, x =\u003e `${x} is nothing special` ],\n])\n\nconst result = [\n  fn(30),\n  fn(20),\n  fn(10),\n] \n// =\u003e ['more than 25', 'more than 15', '10 is nothing special']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncond\u003cT extends any[], R\u003e(conditions: Array\u003cCondPair\u003cT, R\u003e\u003e): (...args: T) =\u003e R;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.cond\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function cond(conditions){\n  return (...input) =\u003e {\n    let done = false\n    let toReturn\n    conditions.forEach(([ predicate, getResult ]) =\u003e {\n      if (!done \u0026\u0026 predicate(...input)){\n        done = true\n        toReturn = getResult(...input)\n      }\n    })\n\n    return toReturn\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { always } from './always.js'\nimport { cond } from './cond.js'\nimport { equals } from './equals.js'\nimport { T } from './T.js'\n\ntest('returns a function', () =\u003e {\n  expect(typeof cond([])).toBe('function')\n})\n\ntest('returns a conditional function', () =\u003e {\n  const fn = cond([\n    [ equals(0), always('water freezes at 0°C') ],\n    [ equals(100), always('water boils at 100°C') ],\n    [\n      T,\n      function (temp){\n        return 'nothing special happens at ' + temp + '°C'\n      },\n    ],\n  ])\n  expect(fn(0)).toBe('water freezes at 0°C')\n  expect(fn(50)).toBe('nothing special happens at 50°C')\n  expect(fn(100)).toBe('water boils at 100°C')\n})\n\ntest('no winner', () =\u003e {\n  const fn = cond([\n    [ equals('foo'), always(1) ],\n    [ equals('bar'), always(2) ],\n  ])\n  expect(fn('quux')).toBeUndefined()\n})\n\ntest('predicates are tested in order', () =\u003e {\n  const fn = cond([\n    [ T, always('foo') ],\n    [ T, always('bar') ],\n    [ T, always('baz') ],\n  ])\n  expect(fn()).toBe('foo')\n})\n\ntest('pass all inputs',() =\u003e {\n  cond([ [()=\u003e true, (...x) =\u003e {\n    expect(x).toEqual([1,2,3])\n  }] ])(1,2,3)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {cond, always, equals} from 'rambda'\n\ndescribe('R.cond', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = cond\u003cnumber[], string\u003e([\n      [equals(0), always('water freezes at 0°C')],\n      [equals(100), always('water boils at 100°C')],\n      [\n        () =\u003e true,\n        function(temp) {\n          temp // $ExpectType number\n          return 'nothing special happens at ' + temp + '°C'\n        },\n      ],\n    ])\n\n    const result = fn(0)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#cond)\n\n### converge\n\n```typescript\n\nconverge(after: ((...a: any[]) =\u003e any), fns: ((...x: any[]) =\u003e any)[]): (...y: any[]) =\u003e any\n```\n\nAccepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value.\n\n\u003e :boom: Explanation is taken from `Ramda` documentation\n\n```javascript\nconst result = R.converge(R.multiply)([ R.add(1), R.add(3) ])(2)\n// =\u003e 15\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nconverge(after: ((...a: any[]) =\u003e any), fns: ((...x: any[]) =\u003e any)[]): (...y: any[]) =\u003e any;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.converge\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curryN } from './curryN.js'\nimport { map } from './map.js'\nimport { max } from './max.js'\nimport { reduce } from './reduce.js'\n\nexport function converge(fn, transformers){\n  if (arguments.length === 1)\n    return _transformers =\u003e converge(fn, _transformers)\n\n  const highestArity = reduce(\n    (a, b) =\u003e max(a, b.length), 0, transformers\n  )\n\n  return curryN(highestArity, function (){\n    return fn.apply(this,\n      map(g =\u003e g.apply(this, arguments), transformers))\n  })\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add } from './add.js'\nimport { converge } from './converge.js'\nimport { multiply } from './multiply.js'\n\nconst f1 = converge(multiply, [ a =\u003e a + 1, a =\u003e a + 10 ])\nconst f2 = converge(multiply, [ a =\u003e a + 1, (a, b) =\u003e a + b + 10 ])\nconst f3 = converge(multiply, [ a =\u003e a + 1, (\n  a, b, c\n) =\u003e a + b + c + 10 ])\n\ntest('happy', () =\u003e {\n  expect(f2(6, 7)).toBe(161)\n})\n\ntest('passes the results of applying the arguments individually', () =\u003e {\n  const result = converge(multiply)([ add(1), add(3) ])(2)\n  expect(result).toBe(15)\n})\n\ntest('returns a function with the length of the longest argument', () =\u003e {\n  expect(f1).toHaveLength(1)\n  expect(f2).toHaveLength(2)\n  expect(f3).toHaveLength(3)\n})\n\ntest('passes context to its functions', () =\u003e {\n  const a = function (x){\n    return this.f1(x)\n  }\n  const b = function (x){\n    return this.f2(x)\n  }\n  const c = function (x, y){\n    return this.f3(x, y)\n  }\n  const d = converge(c, [ a, b ])\n  const context = {\n    f1 : add(1),\n    f2 : add(2),\n    f3 : add,\n  }\n  expect(a.call(context, 1)).toBe(2)\n  expect(b.call(context, 1)).toBe(3)\n  expect(d.call(context, 1)).toBe(5)\n})\n\ntest('works with empty functions list', () =\u003e {\n  const fn = converge(function (){\n    return arguments.length\n  }, [])\n  expect(fn).toHaveLength(0)\n  expect(fn()).toBe(0)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {converge} from 'rambda'\n\nconst mult = (a: number, b: number) =\u003e {\n  return a * b\n}\nconst fn = converge(mult, [\n  (a: number) =\u003e {\n    return a\n  },\n  (a: number, b: number) =\u003e {\n    return b\n  },\n])\n\ndescribe('R.converge', () =\u003e {\n  it('happy', () =\u003e {\n    const result = fn(2, 3)\n    const curriedResult = fn(2)(3)\n\n    result // $ExpectType any\n    curriedResult // $ExpectType any\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#converge)\n\n### count\n\n```typescript\n\ncount\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number\n```\n\nIt counts how many times `predicate` function returns `true`, when supplied with iteration of `list`.\n\n```javascript\nconst list = [{a: 1}, 1, {a:2}]\nconst result = R.count(x =\u003e x.a !== undefined, list)\n// =\u003e 2\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncount\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number;\ncount\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.count\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function count(predicate, list){\n  if (arguments.length === 1){\n    return _list =\u003e count(predicate, _list)\n  }\n  if (!isArray(list)) return 0\n\n  return list.filter(x =\u003e predicate(x)).length\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { count as countRamda } from 'ramda'\n\nimport { count } from './count.js'\n\nconst predicate = x =\u003e x.a !== undefined\n\ntest('with empty list', () =\u003e {\n  expect(count(predicate, [])).toBe(0)\n})\n\ntest('happy', () =\u003e {\n  const list = [ 1, 2, { a : 1 }, 3, { a : 1 } ]\n\n  expect(count(predicate)(list)).toBe(2)\n})\n\ntest('rambdax/issues/86', () =\u003e {\n  const arr = [ true, false, true, false ]\n  expect(count(Boolean, arr)).toBe(countRamda(Boolean, arr))\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {count} from 'rambda'\n\nconst list = [1, 2, 3]\nconst predicate = (x: number) =\u003e x \u003e 1\n\ndescribe('R.count', () =\u003e {\n  it('happy', () =\u003e {\n    const result = count(predicate, list)\n\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = count(predicate)(list)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#count)\n\n### countBy\n\n```typescript\n\ncountBy\u003cT extends unknown\u003e(transformFn: (x: T) =\u003e any, list: T[]): Record\u003cstring, number\u003e\n```\n\nIt counts elements in a list after each instance of the input list is passed through `transformFn` function.\n\n```javascript\nconst list = [ 'a', 'A', 'b', 'B', 'c', 'C' ]\n\nconst result = countBy(R.toLower, list)\nconst expected = { a: 2, b: 2, c: 2 }\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncountBy\u003cT extends unknown\u003e(transformFn: (x: T) =\u003e any, list: T[]): Record\u003cstring, number\u003e;\ncountBy\u003cT extends unknown\u003e(transformFn: (x: T) =\u003e any): (list: T[]) =\u003e Record\u003cstring, number\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.countBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function countBy(fn, list){\n  if (arguments.length === 1){\n    return _list =\u003e countBy(fn, _list)\n  }\n  const willReturn = {}\n\n  list.forEach(item =\u003e {\n    const key = fn(item)\n    if (!willReturn[ key ]){\n      willReturn[ key ] = 1\n    } else {\n      willReturn[ key ]++\n    }\n  })\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { countBy } from './countBy.js'\n\nconst list = [ 'a', 'A', 'b', 'B', 'c', 'C' ]\n\ntest('happy', () =\u003e {\n  const result = countBy(x =\u003e x.toLowerCase(), list)\n  expect(result).toEqual({\n    a : 2,\n    b : 2,\n    c : 2,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {countBy} from 'rambda'\n\nconst transformFn = (x: string) =\u003e x.toLowerCase()\nconst list = ['a', 'A', 'b', 'B', 'c', 'C']\n\ndescribe('R.countBy', () =\u003e {\n  it('happy', () =\u003e {\n    const result = countBy(transformFn, list)\n\n    result // $ExpectType Record\u003cstring, number\u003e\n  })\n  it('curried', () =\u003e {\n    const result = countBy(transformFn)(list)\n\n    result // $ExpectType Record\u003cstring, number\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#countBy)\n\n### curry\n\n```typescript\n\ncurry(fn: AnyFunction): (...a: any[]) =\u003e any\n```\n\nIt expects a function as input and returns its curried version.\n\n```javascript\nconst fn = (a, b, c) =\u003e a + b + c\nconst curried = R.curry(fn)\nconst sum = curried(1,2)\n\nconst result = sum(3) // =\u003e 6\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncurry(fn: AnyFunction): (...a: any[]) =\u003e any;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.curry\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function curry(fn, args = []){\n  return (..._args) =\u003e\n    (rest =\u003e rest.length \u003e= fn.length ? fn(...rest) : curry(fn, rest))([\n      ...args,\n      ..._args,\n    ])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\ntest('happy', () =\u003e {\n  const addFourNumbers = (\n    a, b, c, d\n  ) =\u003e a + b + c + d\n  const curriedAddFourNumbers = curry(addFourNumbers)\n  const f = curriedAddFourNumbers(1, 2)\n  const g = f(3)\n\n  expect(g(4)).toBe(10)\n})\n\ntest('when called with more arguments', () =\u003e {\n  const add = curry((n, n2) =\u003e n + n2)\n\n  expect(add(\n    1, 2, 3\n  )).toBe(3)\n})\n\ntest('when called with zero arguments', () =\u003e {\n  const sub = curry((a, b) =\u003e a - b)\n  const s0 = sub()\n\n  expect(s0(5, 2)).toBe(3)\n})\n\ntest('when called via multiple curry stages', () =\u003e {\n  const join = curry((\n    a, b, c, d\n  ) =\u003e [ a, b, c, d ].join('-'))\n\n  const stage1 = join('A')\n  const stage2 = stage1('B', 'C')\n\n  expect(stage2('D')).toBe('A-B-C-D')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {curry} from 'rambda'\n\nfunction source(a: number, b: number, c: number, d: number) {\n  void d\n\n  return a * b * c\n}\n\ndescribe('R.curry', () =\u003e {\n  it('happy', () =\u003e {\n    const curried = curry(source)\n\n    const result1 = curried(1)(2)(3)\n    const result2 = curried(1, 2)(3)\n    const result3 = curried(1)(2, 3)\n    const result4 = curried(1, 2, 3)\n\n    result1 // $ExpectType any\n    result2 // $ExpectType any\n    result3 // $ExpectType any\n    result4 // $ExpectType any\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#curry)\n\n### curryN\n\n```typescript\n\ncurryN(length: number, fn: AnyFunction): (...a: any[]) =\u003e any\n```\n\nIt returns a curried equivalent of the provided function, with the specified arity.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ncurryN(length: number, fn: AnyFunction): (...a: any[]) =\u003e any;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.curryN\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _arity } from './_internals/_arity.js'\n\nfunction _curryN(\n  n, cache, fn\n){\n  return function (){\n    let ci = 0\n    let ai = 0\n    const cl = cache.length\n    const al = arguments.length\n    const args = new Array(cl + al)\n    while (ci \u003c cl){\n      args[ ci ] = cache[ ci ]\n      ci++\n    }\n    while (ai \u003c al){\n      args[ cl + ai ] = arguments[ ai ]\n      ai++\n    }\n    const remaining = n - args.length\n\n    return args.length \u003e= n ?\n      fn.apply(this, args) :\n      _arity(remaining, _curryN(\n        n, args, fn\n      ))\n  }\n}\n\nexport function curryN(n, fn){\n  if (arguments.length === 1) return _fn =\u003e curryN(n, _fn)\n\n  if (n \u003e 10){\n    throw new Error('First argument to _arity must be a non-negative integer no greater than ten')\n  }\n\n  return _arity(n, _curryN(\n    n, [], fn\n  ))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { curryN } from './curryN.js'\n\nfunction multiply(\n  a, b, c, d, e, f, g, h, i, j, k, l\n){\n  if (l){\n    return a * b * c * d * e * f * g * h * i * j * k * l\n  }\n  if (k){\n    return a * b * c * d * e * f * g * h * i * j * k\n  }\n  if (j){\n    return a * b * c * d * e * f * g * h * i * j\n  }\n  if (i){\n    return a * b * c * d * e * f * g * h * i\n  }\n  if (h){\n    return a * b * c * d * e * f * g * h\n  }\n  if (g){\n    return a * b * c * d * e * f * g\n  }\n  if (f){\n    return a * b * c * d * e * f\n  }\n  if (e){\n    return a * b * c * d * e\n  }\n\n  return a * b * c\n}\n\ntest('accepts an arity', () =\u003e {\n  const curried = curryN(3, multiply)\n  expect(curried(1)(2)(3)).toBe(6)\n  expect(curried(1, 2)(3)).toBe(6)\n  expect(curried(1)(2, 3)).toBe(6)\n  expect(curried(\n    1, 2, 3\n  )).toBe(6)\n})\n\ntest('can be partially applied', () =\u003e {\n  const curry3 = curryN(3)\n  const curried = curry3(multiply)\n  expect(curried).toHaveLength(3)\n  expect(curried(1)(2)(3)).toBe(6)\n  expect(curried(1, 2)(3)).toBe(6)\n  expect(curried(1)(2, 3)).toBe(6)\n  expect(curried(\n    1, 2, 3\n  )).toBe(6)\n})\n\ntest('preserves context', () =\u003e {\n  const ctx = { x : 10 }\n  const f = function (a, b){\n    return a + b * this.x\n  }\n  const g = curryN(2, f)\n\n  expect(g.call(\n    ctx, 2, 4\n  )).toBe(42)\n  expect(g.call(ctx, 2).call(ctx, 4)).toBe(42)\n})\n\ntest('number of arguments is 4', () =\u003e {\n  const fn = curryN(4, multiply)\n  expect(fn(\n    1, 2, 3, 4\n  )).toBe(6)\n})\n\ntest('number of arguments is 5', () =\u003e {\n  const fn = curryN(5, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5\n  )).toBe(120)\n})\n\ntest('number of arguments is 6', () =\u003e {\n  const fn = curryN(6, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5, 6\n  )).toBe(720)\n})\n\ntest('number of arguments is 7', () =\u003e {\n  const fn = curryN(7, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5, 6, 7\n  )).toBe(5040)\n})\n\ntest('number of arguments is 8', () =\u003e {\n  const fn = curryN(8, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5, 6, 7, 8\n  )).toBe(40320)\n})\n\ntest('number of arguments is 9', () =\u003e {\n  const fn = curryN(9, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5, 6, 7, 8, 9\n  )).toBe(362880)\n})\n\ntest('number of arguments is 10', () =\u003e {\n  const fn = curryN(10, multiply)\n  expect(fn(\n    1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n  )).toBe(3628800)\n})\n\ntest('number of arguments is 11', () =\u003e {\n  expect(() =\u003e {\n    const fn = curryN(11, multiply)\n    fn(\n      1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n    )\n  }).toThrowWithMessage(Error,\n    'First argument to _arity must be a non-negative integer no greater than ten')\n})\n\ntest('forwards extra arguments', () =\u003e {\n  const createArray = function (){\n    return Array.prototype.slice.call(arguments)\n  }\n  const fn = curryN(3, createArray)\n\n  expect(fn(\n    1, 2, 3\n  )).toEqual([ 1, 2, 3 ])\n  expect(fn(\n    1, 2, 3, 4\n  )).toEqual([ 1, 2, 3, 4 ])\n  expect(fn(1, 2)(3, 4)).toEqual([ 1, 2, 3, 4 ])\n  expect(fn(1)(\n    2, 3, 4\n  )).toEqual([ 1, 2, 3, 4 ])\n  expect(fn(1)(2)(3, 4)).toEqual([ 1, 2, 3, 4 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {curryN} from 'rambda'\n\nfunction source(a: number, b: number, c: number, d: number) {\n  void d\n\n  return a * b * c\n}\n\ndescribe('R.curryN', () =\u003e {\n  it('happy', () =\u003e {\n    const curried = curryN(3, source)\n\n    const result1 = curried(1)(2)(3)\n    const result2 = curried(1, 2)(3)\n    const result3 = curried(1)(2, 3)\n    const result4 = curried(1, 2, 3)\n\n    result1 // $ExpectType any\n    result2 // $ExpectType any\n    result3 // $ExpectType any\n    result4 // $ExpectType any\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#curryN)\n\n### dec\n\n```typescript\n\ndec(x: number): number\n```\n\nIt decrements a number.\n\n```javascript\nconst result = R.dec(2) // =\u003e 1\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndec(x: number): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dec\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport const dec = x =\u003e x - 1\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dec } from './dec.js'\n\ntest('happy', () =\u003e {\n  expect(dec(2)).toBe(1)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dec)\n\n### defaultTo\n\n```typescript\n\ndefaultTo\u003cT\u003e(defaultValue: T, input: T | null | undefined): T\n```\n\nIt returns `defaultValue`, if all of `inputArguments` are `undefined`, `null` or `NaN`.\n\nElse, it returns the first truthy `inputArguments` instance(from left to right).\n\n\u003e :boom: Rambda's **defaultTo** accept indefinite number of arguments when non curried, i.e. `R.defaultTo(2, foo, bar, baz)`.\n\n```javascript\nR.defaultTo('foo', 'bar') // =\u003e 'bar'\nR.defaultTo('foo', undefined) // =\u003e 'foo'\n\n// Important - emtpy string is not falsy value(same as Ramda)\nR.defaultTo('foo', '') // =\u003e 'foo'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndefaultTo\u003cT\u003e(defaultValue: T, input: T | null | undefined): T;\ndefaultTo\u003cT\u003e(defaultValue: T): (input: T | null | undefined) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.defaultTo\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nfunction isFalsy(input){\n  return (\n    input === undefined || input === null || Number.isNaN(input) === true\n  )\n}\n\nexport function defaultTo(defaultArgument, input){\n  if (arguments.length === 1){\n    return _input =\u003e defaultTo(defaultArgument, _input)\n  }\n\n  return isFalsy(input) ? defaultArgument : input\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { defaultTo } from './defaultTo.js'\n\ntest('with undefined', () =\u003e {\n  expect(defaultTo('foo')(undefined)).toBe('foo')\n})\n\ntest('with null', () =\u003e {\n  expect(defaultTo('foo')(null)).toBe('foo')\n})\n\ntest('with NaN', () =\u003e {\n  expect(defaultTo('foo')(NaN)).toBe('foo')\n})\n\ntest('with empty string', () =\u003e {\n  expect(defaultTo('foo', '')).toBe('')\n})\n\ntest('with false', () =\u003e {\n  expect(defaultTo('foo', false)).toBeFalse()\n})\n\ntest('when inputArgument passes initial check', () =\u003e {\n  expect(defaultTo('foo', 'bar')).toBe('bar')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {defaultTo} from 'rambda'\n\ndescribe('R.defaultTo with Ramda spec', () =\u003e {\n  it('happy', () =\u003e {\n    const result = defaultTo('foo', '')\n    result // $ExpectType \"\" | \"foo\"\n  })\n  it('with explicit type', () =\u003e {\n    const result = defaultTo\u003cstring\u003e('foo', null)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#defaultTo)\n\n### descend\n\n```typescript\n\ndescend\u003cT\u003e(fn: (obj: T) =\u003e Ord, a: T, b: T): Ordering\n```\n\n```javascript\nconst result = R.sort(R.descend(x =\u003e x), [1, 2])\n// =\u003e [2, 1]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndescend\u003cT\u003e(fn: (obj: T) =\u003e Ord, a: T, b: T): Ordering;\ndescend\u003cT\u003e(fn: (obj: T) =\u003e Ord): (a: T, b: T) =\u003e Ordering;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.descend\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createCompareFunction } from './ascend.js'\n\nexport function descend(\n  getFunction, a, b\n){\n  if (arguments.length === 1){\n    return (_a, _b) =\u003e descend(\n      getFunction, _a, _b\n    )\n  }\n  const aValue = getFunction(a)\n  const bValue = getFunction(b)\n\n  return createCompareFunction(\n    aValue, bValue, 1, -1\n  )\n}\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#descend)\n\n### difference\n\n```typescript\n\ndifference\u003cT\u003e(a: T[], b: T[]): T[]\n```\n\nIt returns the uniq set of all elements in the first list `a` not contained in the second list `b`.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst a = [ 1, 2, 3, 4 ]\nconst b = [ 3, 4, 5, 6 ]\n\nconst result = R.difference(a, b)\n// =\u003e [ 1, 2 ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndifference\u003cT\u003e(a: T[], b: T[]): T[];\ndifference\u003cT\u003e(a: T[]): (b: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.difference\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { includes } from './includes.js'\nimport { uniq } from './uniq.js'\n\nexport function difference(a, b){\n  if (arguments.length === 1) return _b =\u003e difference(a, _b)\n\n  return uniq(a).filter(aInstance =\u003e !includes(aInstance, b))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { difference as differenceRamda } from 'ramda'\n\nimport { difference } from './difference.js'\n\ntest('difference', () =\u003e {\n  const a = [ 1, 2, 3, 4 ]\n  const b = [ 3, 4, 5, 6 ]\n  expect(difference(a)(b)).toEqual([ 1, 2 ])\n\n  expect(difference([], [])).toEqual([])\n})\n\ntest('difference with objects', () =\u003e {\n  const a = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]\n  const b = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]\n  expect(difference(a, b)).toEqual([ { id : 1 }, { id : 2 } ])\n})\n\ntest('no duplicates in first list', () =\u003e {\n  const M2 = [ 1, 2, 3, 4, 1, 2, 3, 4 ]\n  const N2 = [ 3, 3, 4, 4, 5, 5, 6, 6 ]\n  expect(difference(M2, N2)).toEqual([ 1, 2 ])\n})\n\ntest('should use R.equals', () =\u003e {\n  expect(difference([ 1 ], [ 1 ])).toHaveLength(0)\n  expect(differenceRamda([ NaN ], [ NaN ])).toHaveLength(0)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {difference} from 'rambda'\n\nconst list1 = [1, 2, 3]\nconst list2 = [1, 2, 4]\n\ndescribe('R.difference', () =\u003e {\n  it('happy', () =\u003e {\n    const result = difference(list1, list2)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = difference(list1)(list2)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#difference)\n\n### differenceWith\n\n```typescript\n\ndifferenceWith\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n  list1: T1[],\n  list2: T2[],\n): T1[]\n```\n\n```javascript\nconst result = R.differenceWith(\n  (a, b) =\u003e a.x === b.x,\n  [{x: 1}, {x: 2}],\n  [{x: 1}, {x: 3}]\n)\n// =\u003e [{x: 2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndifferenceWith\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n  list1: T1[],\n  list2: T2[],\n): T1[];\ndifferenceWith\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n): (list1: T1[], list2: T2[]) =\u003e T1[];\ndifferenceWith\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n  list1: T1[],\n): (list2: T2[]) =\u003e T1[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.differenceWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { _indexOf } from './equals.js'\n\nexport function differenceWithFn(\n  fn, a, b\n){\n  const willReturn = []\n  const [ first, second ] = a.length \u003e= b.length ? [ a, b ] : [ b, a ]\n\n  first.forEach(item =\u003e {\n    const hasItem = second.some(secondItem =\u003e fn(item, secondItem))\n    if (!hasItem \u0026\u0026 _indexOf(item, willReturn) === -1){\n      willReturn.push(item)\n    }\n  })\n\n  return willReturn\n}\n\nexport const differenceWith = curry(differenceWithFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { differenceWith } from './differenceWith.js';\n\nconst fn = (a, b) =\u003e a.x === b.x;\n\ntest('same length of list', () =\u003e {\n\tconst result = differenceWith(fn, [{ x: 1 }, { x: 2 }], [{ x: 1 }, { x: 3 }]);\n\texpect(result).toEqual([{ x: 2 }]);\n});\n\ntest('different length of list', () =\u003e {\n\tconst foo = [{ x: 1 }, { x: 2 }, { x: 3 }];\n\tconst bar = [{ x: 3 }, { x: 4 }];\n\tconst result = differenceWith(fn, foo, bar);\n\texpect(result).toEqual([{ x: 1 }, { x: 2 }]);\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#differenceWith)\n\n### dissoc\n\n```typescript\n\ndissoc\u003cK extends PropertyKey\u003e(prop: K): \u003cU extends { [P in K]?: any}\u003e(obj: string extends keyof U ? U : undefined extends U[K] ? U : never) =\u003e U\n```\n\nIt returns a new object that does not contain property `prop`.\n\n```javascript\nR.dissoc('b', {a: 1, b: 2, c: 3})\n// =\u003e {a: 1, c: 3}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndissoc\u003cK extends PropertyKey\u003e(prop: K): \u003cU extends { [P in K]?: any}\u003e(obj: string extends keyof U ? U : undefined extends U[K] ? U : never) =\u003e U;\ndissoc\u003cU, K extends keyof U\u003e(prop: string extends keyof U ? K : undefined extends U[K] ? K : never, obj: U): U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dissoc\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function dissoc(prop, obj){\n  if (arguments.length === 1) return _obj =\u003e dissoc(prop, _obj)\n\n  if (obj === null || obj === undefined) return {}\n\n  const willReturn = {}\n  for (const p in obj){\n    willReturn[ p ] = obj[ p ]\n  }\n  delete willReturn[ prop ]\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dissoc } from './dissoc.js'\n\ntest('input is null or undefined', () =\u003e {\n  expect(dissoc('b', null)).toEqual({})\n  expect(dissoc('b', undefined)).toEqual({})\n})\n\ntest('property exists curried', () =\u003e {\n  expect(dissoc('b')({\n    a : 1,\n    b : 2,\n  })).toEqual({ a : 1 })\n})\n\ntest('property doesn\\'t exists', () =\u003e {\n  expect(dissoc('c', {\n    a : 1,\n    b : 2,\n  })).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('works with non-string property', () =\u003e {\n  expect(dissoc(42, {\n    a  : 1,\n    42 : 2,\n  })).toEqual({ a : 1 })\n\n  expect(dissoc(null, {\n    a    : 1,\n    null : 2,\n  })).toEqual({ a : 1 })\n\n  expect(dissoc(undefined, {\n    a         : 1,\n    undefined : 2,\n  })).toEqual({ a : 1 })\n})\n\ntest('includes prototype properties', () =\u003e {\n  function Rectangle(width, height){\n    this.width = width\n    this.height = height\n  }\n  const area = Rectangle.prototype.area = function (){\n    return this.width * this.height\n  }\n  const rect = new Rectangle(7, 6)\n\n  expect(dissoc('area', rect)).toEqual({\n    width  : 7,\n    height : 6,\n  })\n\n  expect(dissoc('width', rect)).toEqual({\n    height : 6,\n    area,\n  })\n\n  expect(dissoc('depth', rect)).toEqual({\n    width  : 7,\n    height : 6,\n    area,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport { dissoc } from 'rambda';\n\ntype Obj = {\n\tstr: string;\n\tnum: number;\n\topt?: boolean;\n\torUndefined: boolean | undefined;\n\torNull: boolean | null;\n};\n\nconst obj: Obj = { str: 'foo', num: 1, orUndefined: true, orNull: true };\n\ndescribe('R.dissoc', () =\u003e {\n\tit('ramda tests', () =\u003e {\n\t\t// @ts-expect-error\n\t\tdissoc('str', obj);\n\t\t// @ts-expect-error\n\t\tdissoc('num', obj);\n\t\t// @ts-expect-error\n\t\tdissoc('orNull', obj);\n\n\t\tconst result1 = dissoc('opt', obj);\n\t\tresult1; // $ExpectType Obj\n\t\t// @ts-expect-error\n\t\tdissoc('num')(obj);\n\t\tconst result2 = dissoc('orUndefined', obj);\n\t\tresult2; // $ExpectType Obj\n\t\tconst result3 = dissoc('opt')(obj);\n\t\tresult3; // $ExpectType Obj\n\t});\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dissoc)\n\n### dissocPath\n\n```typescript\n\ndissocPath\u003cT\u003e(path: Path, obj: any): T\n```\n\n```javascript\nconst result = R.dissocPath(['a', 'b'], {a: {b: 1, c: 2}})\n// =\u003e {a: {c: 2}}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndissocPath\u003cT\u003e(path: Path, obj: any): T;\ndissocPath\u003cT\u003e(path: Path): (obj: any) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dissocPath\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from '../src/_internals/createPath.js'\nimport { isArray } from './_internals/isArray.js'\nimport { isIndexInteger } from './_internals/isInteger.js'\nimport { omit } from './omit.js'\nimport { path } from './path.js'\nimport { removeIndex } from './removeIndex.js'\nimport { update } from './update.js'\n\nexport function dissocPath(pathInput, input){\n  if (arguments.length === 1) return _obj =\u003e dissocPath(pathInput, _obj)\n\n  const pathArrValue = createPath(pathInput)\n  // this {...input} spread could be done to satisfy ramda specs, but this is done on so many places\n  // TODO: add warning that Rambda simply returns input if path is empty\n  if (pathArrValue.length === 0) return input\n\n  const pathResult = path(pathArrValue, input)\n  if (pathResult === undefined) return input\n\n  const index = pathArrValue[ 0 ]\n  const condition =\n    typeof input !== 'object' ||\n    input === null ||\n    !input.hasOwnProperty(index)\n  if (pathArrValue.length \u003e 1){\n    const nextInput = condition ?\n      isIndexInteger(pathArrValue[ 1 ]) ?\n        [] :\n        {} :\n      input[ index ]\n    const nextPathInput = Array.prototype.slice.call(pathArrValue, 1)\n    const intermediateResult = dissocPath(\n      nextPathInput, nextInput, input\n    )\n    if (isArray(input)) return update(\n      index, intermediateResult, input\n    )\n\n    return {\n      ...input,\n      [ index ] : intermediateResult,\n    }\n  }\n  if (isArray(input)) return removeIndex(index, input)\n\n  return omit([ index ], input)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nconst assert = require('assert')\nimport { eq } from './_internals/testUtils.js'\nimport { dissocPath } from './dissocPath.js'\n\nconst testInput = {\n  a : {\n    b : 1,\n    c : 2,\n    d : { e : 3 },\n  },\n  f : [\n    { g : 4 },\n    {\n      h : 5,\n      i : 6,\n      j : {\n        k : 7,\n        l : 8,\n      },\n    },\n  ],\n  m : 9,\n}\n\ntest('update array', () =\u003e {\n  const expected = {\n    a : {\n      b : 1,\n      c : 2,\n      d : { e : 3 },\n    },\n    f : [\n      { g : 4 },\n      {\n        h : 5,\n        j : {\n          k : 7,\n          l : 8,\n        },\n      },\n    ],\n    m : 9,\n  }\n  const result = dissocPath('f.1.i', testInput)\n  expect(result).toEqual(expected)\n})\n\ntest('update object', () =\u003e {\n  const result = dissocPath('a.b', testInput)\n  const expected = {\n    a : {\n      c : 2,\n      d : { e : 3 },\n    },\n    f : [\n      { g : 4 },\n      {\n        h : 5,\n        i : 6,\n        j : {\n          k : 7,\n          l : 8,\n        },\n      },\n    ],\n    m : 9,\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('does not try to omit inner properties that do not exist', () =\u003e {\n  const obj1 = {\n    a : 1,\n    b : {\n      c : 2,\n      d : 3,\n    },\n    e : 4,\n    f : 5,\n  }\n  const obj2 = dissocPath([ 'x', 0, 'z' ], obj1)\n  eq(obj2, {\n    a : 1,\n    b : {\n      c : 2,\n      d : 3,\n    },\n    e : 4,\n    f : 5,\n  })\n  // Note: reference equality below!\n  assert.strictEqual(obj2.a, obj1.a)\n  assert.strictEqual(obj2.b, obj1.b)\n  assert.strictEqual(obj2.f, obj1.f)\n})\n\ntest('leaves an empty object when all properties omitted', () =\u003e {\n  const obj1 = {\n    a : 1,\n    b : { c : 2 },\n    d : 3,\n  }\n  const obj2 = dissocPath([ 'b', 'c' ], obj1)\n  eq(obj2, {\n    a : 1,\n    b : {},\n    d : 3,\n  })\n})\n\ntest('leaves an empty array when all indexes are omitted', () =\u003e {\n  const obj1 = {\n    a : 1,\n    b : [ 2 ],\n    d : 3,\n  }\n  const obj2 = dissocPath([ 'b', 0 ], obj1)\n  eq(obj2, {\n    a : 1,\n    b : [],\n    d : 3,\n  })\n})\n\ntest('accepts empty path', () =\u003e {\n  eq(dissocPath([], {\n    a : 1,\n    b : 2,\n  }),\n  {\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('allow integer to be used as key for object', () =\u003e {\n  eq(dissocPath([ 42 ], {\n    42 : 3,\n    a  : 1,\n    b  : 2,\n  }),\n  {\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('support remove null/undefined value path', () =\u003e {\n  eq(dissocPath([ 'c', 'd' ], {\n    a : 1,\n    b : 2,\n    c : null,\n  }),\n  {\n    a : 1,\n    b : 2,\n    c : null,\n  })\n  eq(dissocPath([ 'c', 'd' ], {\n    a : 1,\n    b : 2,\n    c : undefined,\n  }),\n  {\n    a : 1,\n    b : 2,\n    c : undefined,\n  })\n\n  const obj1 = {\n    a : 1,\n    b : 2,\n  }\n  const obj2 = dissocPath([ 'c', 'd' ], obj1)\n\n  eq(obj2, obj1)\n\n  // NOTE: commented out on purpose\n  // assert.notStrictEqual(obj2, obj1)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dissocPath)\n\n### divide\n\n```typescript\n\ndivide(x: number, y: number): number\n```\n\n```javascript\nR.divide(71, 100) // =\u003e 0.71\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndivide(x: number, y: number): number;\ndivide(x: number): (y: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.divide\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function divide(a, b){\n  if (arguments.length === 1) return _b =\u003e divide(a, _b)\n\n  return a / b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { divide } from './divide.js'\n\ntest('happy', () =\u003e {\n  expect(divide(71, 100)).toBe(0.71)\n  expect(divide(71)(100)).toBe(0.71)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#divide)\n\n### drop\n\n```typescript\n\ndrop\u003cT\u003e(howMany: number, input: T[]): T[]\n```\n\nIt returns `howMany` items dropped from beginning of list or string `input`.\n\n```javascript\nR.drop(2, ['foo', 'bar', 'baz']) // =\u003e ['baz']\nR.drop(2, 'foobar')  // =\u003e 'obar'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndrop\u003cT\u003e(howMany: number, input: T[]): T[];\ndrop(howMany: number, input: string): string;\ndrop\u003cT\u003e(howMany: number): {\n  \u003cT\u003e(input: T[]): T[];\n  (input: string): string;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.drop\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function drop(howManyToDrop, listOrString){\n  if (arguments.length === 1) return _list =\u003e drop(howManyToDrop, _list)\n\n  return listOrString.slice(howManyToDrop \u003e 0 ? howManyToDrop : 0)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport assert from 'assert'\n\nimport { drop } from './drop.js'\n\ntest('with array', () =\u003e {\n  expect(drop(2)([ 'foo', 'bar', 'baz' ])).toEqual([ 'baz' ])\n  expect(drop(3, [ 'foo', 'bar', 'baz' ])).toEqual([])\n  expect(drop(4, [ 'foo', 'bar', 'baz' ])).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  expect(drop(3, 'rambda')).toBe('bda')\n})\n\ntest('with non-positive count', () =\u003e {\n  expect(drop(0, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(drop(-1, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(drop(-Infinity, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n})\n\ntest('should return copy', () =\u003e {\n  const xs = [ 1, 2, 3 ]\n\n  assert.notStrictEqual(drop(0, xs), xs)\n  assert.notStrictEqual(drop(-1, xs), xs)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {drop} from 'rambda'\n\nconst list = [1, 2, 3, 4]\nconst str = 'foobar'\nconst howMany = 2\n\ndescribe('R.drop - array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = drop(howMany, list)\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = drop(howMany)(list)\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.drop - string', () =\u003e {\n  it('happy', () =\u003e {\n    const result = drop(howMany, str)\n    result // $ExpectType string\n  })\n  it('curried', () =\u003e {\n    const result = drop(howMany)(str)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#drop)\n\n### dropLast\n\n```typescript\n\ndropLast\u003cT\u003e(howMany: number, input: T[]): T[]\n```\n\nIt returns `howMany` items dropped from the end of list or string `input`.\n\n```javascript\nR.dropLast(2, ['foo', 'bar', 'baz']) // =\u003e ['foo']\nR.dropLast(2, 'foobar')  // =\u003e 'foob'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropLast\u003cT\u003e(howMany: number, input: T[]): T[];\ndropLast(howMany: number, input: string): string;\ndropLast\u003cT\u003e(howMany: number): {\n  \u003cT\u003e(input: T[]): T[];\n  (input: string): string;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropLast\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function dropLast(howManyToDrop, listOrString){\n  if (arguments.length === 1){\n    return _listOrString =\u003e dropLast(howManyToDrop, _listOrString)\n  }\n\n  return howManyToDrop \u003e 0 ?\n    listOrString.slice(0, -howManyToDrop) :\n    listOrString.slice()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport assert from 'assert'\n\nimport { dropLast } from './dropLast.js'\n\ntest('with array', () =\u003e {\n  expect(dropLast(2)([ 'foo', 'bar', 'baz' ])).toEqual([ 'foo' ])\n  expect(dropLast(3, [ 'foo', 'bar', 'baz' ])).toEqual([])\n  expect(dropLast(4, [ 'foo', 'bar', 'baz' ])).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  expect(dropLast(3, 'rambda')).toBe('ram')\n})\n\ntest('with non-positive count', () =\u003e {\n  expect(dropLast(0, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(dropLast(-1, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(dropLast(-Infinity, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n})\n\ntest('should return copy', () =\u003e {\n  const xs = [ 1, 2, 3 ]\n\n  assert.notStrictEqual(dropLast(0, xs), xs)\n  assert.notStrictEqual(dropLast(-1, xs), xs)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {dropLast} from 'rambda'\n\nconst list = [1, 2, 3, 4]\nconst str = 'foobar'\nconst howMany = 2\n\ndescribe('R.dropLast - array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = dropLast(howMany, list)\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = dropLast(howMany)(list)\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.dropLast - string', () =\u003e {\n  it('happy', () =\u003e {\n    const result = dropLast(howMany, str)\n    result // $ExpectType string\n  })\n  it('curried', () =\u003e {\n    const result = dropLast(howMany)(str)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropLast)\n\n### dropLastWhile\n\n```typescript\n\ndropLastWhile(predicate: (x: string) =\u003e boolean, iterable: string): string\n```\n\n```javascript\nconst list = [1, 2, 3, 4, 5];\nconst predicate = x =\u003e x \u003e= 3\n\nconst result = dropLastWhile(predicate, list);\n// =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropLastWhile(predicate: (x: string) =\u003e boolean, iterable: string): string;\ndropLastWhile(predicate: (x: string) =\u003e boolean): (iterable: string) =\u003e string;\ndropLastWhile\u003cT\u003e(predicate: (x: T) =\u003e boolean, iterable: T[]): T[];\ndropLastWhile\u003cT\u003e(predicate: (x: T) =\u003e boolean): \u003cT\u003e(iterable: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropLastWhile\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray as isArrayMethod } from './_internals/isArray.js'\n\nexport function dropLastWhile(predicate, iterable){\n  if (arguments.length === 1){\n    return _iterable =\u003e dropLastWhile(predicate, _iterable)\n  }\n  if (iterable.length === 0) return iterable\n  const isArray = isArrayMethod(iterable)\n\n  if (typeof predicate !== 'function'){\n    throw new Error(`'predicate' is from wrong type ${ typeof predicate }`)\n  }\n  if (!isArray \u0026\u0026 typeof iterable !== 'string'){\n    throw new Error(`'iterable' is from wrong type ${ typeof iterable }`)\n  }\n\n  const toReturn = []\n  let counter = iterable.length\n\n  while (counter){\n    const item = iterable[ --counter ]\n    if (!predicate(item)){\n      toReturn.push(item)\n      break\n    }\n  }\n\n  while (counter){\n    toReturn.push(iterable[ --counter ])\n  }\n\n  return isArray ? toReturn.reverse() : toReturn.reverse().join('')\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dropLastWhile as dropLastWhileRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { dropLastWhile } from './dropLastWhile.js'\n\nconst list = [ 1, 2, 3, 4, 5 ]\nconst str = 'foobar'\n\ntest('with list', () =\u003e {\n  const result = dropLastWhile(x =\u003e x \u003e= 3, list)\n  expect(result).toEqual([ 1, 2 ])\n})\n\ntest('with string', () =\u003e {\n  const result = dropLastWhile(x =\u003e x !== 'b')(str)\n  expect(result).toBe('foob')\n})\n\ntest('with empty list', () =\u003e {\n  expect(dropLastWhile(() =\u003e true, [])).toEqual([])\n  expect(dropLastWhile(() =\u003e false, [])).toEqual([])\n})\n\nconst possiblePredicates = [\n  x =\u003e x \u003e 2,\n  x =\u003e x \u003c 2,\n  x =\u003e x \u003c -2,\n  x =\u003e x \u003e 10,\n  '',\n  [],\n  [ 1 ],\n]\n\nconst possibleIterables = [\n  list,\n  [ {}, '1', 2 ],\n  str,\n  `${ str }${ str }`,\n  /foo/g,\n  Promise.resolve('foo'),\n  2,\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : dropLastWhile,\n    fnRamda     : dropLastWhileRamda,\n    firstInput  : possiblePredicates,\n    secondInput : possibleIterables,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 12,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 21,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 49,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {dropLastWhile} from 'rambda'\n\nconst list = [1, 2, 3]\nconst str = 'FOO'\n\ndescribe('R.dropLastWhile', () =\u003e {\n  it('with array', () =\u003e {\n    const result = dropLastWhile(x =\u003e x \u003e 1, list)\n\n    result // $ExpectType number[]\n  })\n  it('with array - curried', () =\u003e {\n    const result = dropLastWhile(x =\u003e x \u003e 1, list)\n\n    result // $ExpectType number[]\n  })\n  it('with string', () =\u003e {\n    const result = dropLastWhile(x =\u003e x !== 'F', str)\n\n    result // $ExpectType string\n  })\n  it('with string - curried', () =\u003e {\n    const result = dropLastWhile(x =\u003e x !== 'F')(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropLastWhile)\n\n### dropRepeats\n\n```typescript\n\ndropRepeats\u003cT\u003e(list: T[]): T[]\n```\n\nIt removes any successive duplicates according to `R.equals`.\n\n```javascript\nconst result = R.dropRepeats([\n  1, \n  1, \n  {a: 1}, \n  {a:1}, \n  1\n])\n// =\u003e [1, {a: 1}, 1]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropRepeats\u003cT\u003e(list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropRepeats\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { equals } from './equals.js'\n\nexport function dropRepeats(list){\n  if (!isArray(list)){\n    throw new Error(`${ list } is not a list`)\n  }\n\n  const toReturn = []\n\n  list.reduce((prev, current) =\u003e {\n    if (!equals(prev, current)){\n      toReturn.push(current)\n    }\n\n    return current\n  }, undefined)\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dropRepeats as dropRepeatsRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { add } from './add.js'\nimport { dropRepeats } from './dropRepeats.js'\n\nconst list = [ 1, 2, 2, 2, 3, 4, 4, 5, 5, 3, 2, 2, { a : 1 }, { a : 1 } ]\nconst listClean = [ 1, 2, 3, 4, 5, 3, 2, { a : 1 } ]\n\ntest('happy', () =\u003e {\n  const result = dropRepeats(list)\n  expect(result).toEqual(listClean)\n})\n\nconst possibleLists = [\n  [ add(1), async () =\u003e {}, [ 1 ], [ 1 ], [ 2 ], [ 2 ] ],\n  [ add(1), add(1), add(2) ],\n  [],\n  1,\n  /foo/g,\n  Promise.resolve(1),\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    firstInput : possibleLists,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 1,\n          \"SHOULD_NOT_THROW\": 3,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 6,\n        }\n      `)\n    },\n    fn      : dropRepeats,\n    fnRamda : dropRepeatsRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {dropRepeats} from 'rambda'\n\ndescribe('R.dropRepeats', () =\u003e {\n  it('happy', () =\u003e {\n    const result = dropRepeats([1, 2, 2, 3])\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropRepeats)\n\n### dropRepeatsBy\n\n```typescript\n\ndropRepeatsBy\u003cT, U\u003e(fn: (a: T) =\u003e U, list: T[]): T[]\n```\n\n```javascript\nconst result = R.dropRepeatsBy(\n  Math.abs,\n  [1, -1, 2, 3, -3]\n)\n// =\u003e [1, 2, 3]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropRepeatsBy\u003cT, U\u003e(fn: (a: T) =\u003e U, list: T[]): T[];\ndropRepeatsBy\u003cT, U\u003e(\n  fn: (a: T) =\u003e U\n): (list: T[]) =\u003e T[];\ndropRepeatsBy(fn: any): \u003cT\u003e(list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropRepeatsBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\n\nexport function dropRepeatsBy(fn, list){\n  if (arguments.length === 1) return _list =\u003e dropRepeatsBy(fn, _list)\n\n  let lastEvaluated = null\n\n  return list.slice().filter(item =\u003e {\n    if (lastEvaluated === null){\n      lastEvaluated = fn(item)\n\n      return true\n    }\n    const evaluatedResult = fn(item)\n    if (equals(lastEvaluated, evaluatedResult)) return false\n\n    lastEvaluated = evaluatedResult\n\n    return true\n  })\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dropRepeatsBy } from './dropRepeatsBy.js'\n\ntest('happy', () =\u003e {\n  const fn = ({ i }) =\u003e ({ i : Math.abs(i) })\n  const objs = [ { i : 1 }, { i : 2 }, { i : 3 }, { i : -4 }, { i : 5 }, { i : 3 } ]\n  const objs2 = [\n    { i : 1 },\n    { i : -1 },\n    { i : 1 },\n    { i : 2 },\n    { i : 3 },\n    { i : 3 },\n    { i : -4 },\n    { i : 4 },\n    { i : 5 },\n    { i : 3 },\n  ]\n  expect(dropRepeatsBy(fn, objs2)).toEqual(objs)\n  expect(dropRepeatsBy(fn, objs)).toEqual(objs)\n})\n\ntest('keeps elements from the left', () =\u003e {\n  expect(dropRepeatsBy(({ n, ...rest }) =\u003e ({ ...rest }),\n    [\n      {\n        i : 1,\n        n : 1,\n      },\n      {\n        i : 1,\n        n : 2,\n      },\n      {\n        i : 1,\n        n : 3,\n      },\n      {\n        i : 4,\n        n : 1,\n      },\n      {\n        i : 4,\n        n : 2,\n      },\n    ])).toEqual([\n    {\n      i : 1,\n      n : 1,\n    },\n    {\n      i : 4,\n      n : 1,\n    },\n  ])\n})\n\ntest('returns an empty array for an empty array', () =\u003e {\n  expect(dropRepeatsBy(() =\u003e {}, [])).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropRepeatsBy)\n\n### dropRepeatsWith\n\n```typescript\n\ndropRepeatsWith\u003cT\u003e(predicate: (x: T, y: T) =\u003e boolean, list: T[]): T[]\n```\n\n```javascript\nconst list = [{a:1,b:2}, {a:1,b:3}, {a:2, b:4}]\nconst result = R.dropRepeatsWith(R.prop('a'), list)\n\n// =\u003e [{a:1,b:2}, {a:2, b:4}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropRepeatsWith\u003cT\u003e(predicate: (x: T, y: T) =\u003e boolean, list: T[]): T[];\ndropRepeatsWith\u003cT\u003e(predicate: (x: T, y: T) =\u003e boolean): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropRepeatsWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function dropRepeatsWith(predicate, list){\n  if (arguments.length === 1){\n    return _iterable =\u003e dropRepeatsWith(predicate, _iterable)\n  }\n\n  if (!isArray(list)){\n    throw new Error(`${ list } is not a list`)\n  }\n\n  const toReturn = []\n\n  list.reduce((prev, current) =\u003e {\n    if (prev === undefined){\n      toReturn.push(current)\n\n      return current\n    }\n    if (!predicate(prev, current)){\n      toReturn.push(current)\n    }\n\n    return current\n  }, undefined)\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dropRepeatsWith as dropRepeatsWithRamda, eqProps } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { dropRepeatsWith } from './dropRepeatsWith.js'\nimport { path } from './path.js'\nimport { prop } from './prop.js'\n\nconst eqI = eqProps('i')\n\ntest('happy', () =\u003e {\n  const list = [ { i : 1 }, { i : 2 }, { i : 2 }, { i : 3 } ]\n  const expected = [ { i : 1 }, { i : 2 }, { i : 3 } ]\n  const result = dropRepeatsWith(eqI, list)\n  expect(result).toEqual(expected)\n})\n\ntest('readme example', () =\u003e {\n  const list = [\n    {\n      a : 1,\n      b : 2,\n    },\n    {\n      a : 1,\n      b : 3,\n    },\n    {\n      a : 2,\n      b : 4,\n    },\n  ]\n  const result = dropRepeatsWith(prop('a'), list)\n  expect(result).toEqual([\n    {\n      a : 1,\n      b : 2,\n    },\n  ])\n})\n\ntest('keeps elements from the left predicate input', () =\u003e {\n  const list = [\n    {\n      i : 1,\n      n : 1,\n    },\n    {\n      i : 1,\n      n : 2,\n    },\n    {\n      i : 1,\n      n : 3,\n    },\n    {\n      i : 4,\n      n : 1,\n    },\n    {\n      i : 4,\n      n : 2,\n    },\n  ]\n  const expected = [\n    {\n      i : 1,\n      n : 1,\n    },\n    {\n      i : 4,\n      n : 1,\n    },\n  ]\n  const result = dropRepeatsWith(eqI)(list)\n  expect(result).toEqual(expected)\n})\n\nconst possiblePredicates = [\n  null,\n  undefined,\n  x =\u003e x + 1,\n  x =\u003e true,\n  x =\u003e false,\n  x =\u003e '',\n  path([ 'a', 'b' ]),\n]\nconst possibleLists = [\n  null,\n  undefined,\n  [],\n  [ 1 ],\n  [ { a : { b : 1 } }, { a : { b : 1 } } ],\n  [ /foo/g, /foo/g ],\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    firstInput  : possiblePredicates,\n    secondInput : possibleLists,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 4,\n          \"ERRORS_TYPE_MISMATCH\": 14,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 42,\n        }\n      `)\n    },\n    fn      : dropRepeatsWith,\n    fnRamda : dropRepeatsWithRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {dropRepeatsWith} from 'rambda'\n\ninterface Foo {\n  a: number,\n}\n\ndescribe('R.dropRepeatsWith', () =\u003e {\n  it('happy', () =\u003e {\n    const result = dropRepeatsWith(\n      (x: Foo, y: Foo) =\u003e {\n        return x.a \u003e y.a\n      },\n      [{a: 2}, {a: 1}]\n    )\n\n    result // $ExpectType { a: number; }[]\n    result[0].a // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = dropRepeatsWith((x: Foo, y: Foo) =\u003e {\n      return x.a \u003e y.a\n    })([{a: 2}, {a: 1}])\n\n    result // $ExpectType Foo[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropRepeatsWith)\n\n### dropWhile\n\n```typescript\n\ndropWhile(fn: Predicate\u003cstring\u003e, iterable: string): string\n```\n\n```javascript\nconst list = [1, 2, 3, 4]\nconst predicate = x =\u003e x \u003c 3\nconst result = R.dropWhile(predicate, list)\n// =\u003e [3, 4]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ndropWhile(fn: Predicate\u003cstring\u003e, iterable: string): string;\ndropWhile(fn: Predicate\u003cstring\u003e): (iterable: string) =\u003e string;\ndropWhile\u003cT\u003e(fn: Predicate\u003cT\u003e, iterable: T[]): T[];\ndropWhile\u003cT\u003e(fn: Predicate\u003cT\u003e): (iterable: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.dropWhile\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray as isArrayMethod } from './_internals/isArray.js'\n\nexport function dropWhile(predicate, iterable){\n  if (arguments.length === 1){\n    return _iterable =\u003e dropWhile(predicate, _iterable)\n  }\n  const isArray = isArrayMethod(iterable)\n  if (!isArray \u0026\u0026 typeof iterable !== 'string'){\n    throw new Error('`iterable` is neither list nor a string')\n  }\n\n  const toReturn = []\n  let counter = 0\n\n  while (counter \u003c iterable.length){\n    const item = iterable[ counter++ ]\n    if (!predicate(item)){\n      toReturn.push(item)\n      break\n    }\n  }\n\n  while (counter \u003c iterable.length){\n    toReturn.push(iterable[ counter++ ])\n  }\n\n  return isArray ? toReturn : toReturn.join('')\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { dropWhile as dropWhileRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { dropWhile } from './dropWhile.js'\n\nconst list = [ 1, 2, 3, 4 ]\n\ntest('happy', () =\u003e {\n  const predicate = x =\u003e x \u003c 3\n  const result = dropWhile(predicate, list)\n  expect(result).toEqual([ 3, 4 ])\n})\n\ntest('always true', () =\u003e {\n  const predicate = () =\u003e true\n  const result = dropWhileRamda(predicate, list)\n  expect(result).toEqual([])\n})\n\ntest('always false', () =\u003e {\n  const predicate = () =\u003e 0\n  const result = dropWhile(predicate)(list)\n  expect(result).toEqual(list)\n})\n\ntest('works with string as iterable', () =\u003e {\n  const iterable = 'foobar'\n  const predicate = x =\u003e x !== 'b'\n  const result = dropWhile(predicate, iterable)\n  expect(result).toBe('bar')\n})\n\nconst possiblePredicates = [\n  null,\n  undefined,\n  () =\u003e 0,\n  () =\u003e true,\n  /foo/g,\n  {},\n  [],\n]\n\nconst possibleIterables = [\n  null,\n  undefined,\n  [],\n  {},\n  1,\n  '',\n  'foobar',\n  [ '' ],\n  [ 1, 2, 3, 4, 5 ],\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    firstInput : possiblePredicates,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 15,\n          \"ERRORS_TYPE_MISMATCH\": 14,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 14,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 63,\n        }\n      `)\n    },\n    secondInput : possibleIterables,\n    fn          : dropWhile,\n    fnRamda     : dropWhileRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {dropWhile} from 'rambda'\n\nconst list = [1, 2, 3, 4]\n\ndescribe('R.dropWhile', () =\u003e {\n  it('happy', () =\u003e {\n    const result = dropWhile(x =\u003e x \u003e 2, list)\n\n    result // $ExpectType number[]\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = dropWhile\u003cnumber\u003e(x =\u003e x \u003e 2)(list)\n\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('with string as iterable', () =\u003e {\n  const str = 'foobar'\n  it('happy', () =\u003e {\n    const result = dropWhile(x =\u003e x !== 'b', str)\n\n    result // $ExpectType string\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = dropWhile(x =\u003e x !== 'b')(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#dropWhile)\n\n### either\n\n```typescript\n\neither(firstPredicate: Pred, secondPredicate: Pred): Pred\n```\n\nIt returns a new `predicate` function from `firstPredicate` and `secondPredicate` inputs.\n\nThis `predicate` function will return `true`, if any of the two input predicates return `true`.\n\n```javascript\nconst firstPredicate = x =\u003e x \u003e 10\nconst secondPredicate = x =\u003e x % 2 === 0\nconst predicate = R.either(firstPredicate, secondPredicate)\n\nconst result = [\n  predicate(15),\n  predicate(8),\n  predicate(7),\n]\n// =\u003e [true, true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\neither(firstPredicate: Pred, secondPredicate: Pred): Pred;\neither\u003cT\u003e(firstPredicate: Predicate\u003cT\u003e, secondPredicate: Predicate\u003cT\u003e): Predicate\u003cT\u003e;\neither\u003cT\u003e(firstPredicate: Predicate\u003cT\u003e): (secondPredicate: Predicate\u003cT\u003e) =\u003e Predicate\u003cT\u003e;\neither(firstPredicate: Pred): (secondPredicate: Pred) =\u003e Pred;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.either\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function either(firstPredicate, secondPredicate){\n  if (arguments.length === 1){\n    return _secondPredicate =\u003e either(firstPredicate, _secondPredicate)\n  }\n\n  return (...input) =\u003e\n    Boolean(firstPredicate(...input) || secondPredicate(...input))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { either } from './either.js'\n\ntest('with multiple inputs', () =\u003e {\n  const between = function (\n    a, b, c\n  ){\n    return a \u003c b \u0026\u0026 b \u003c c\n  }\n  const total20 = function (\n    a, b, c\n  ){\n    return a + b + c === 20\n  }\n  const fn = either(between, total20)\n  expect(fn(\n    7, 8, 5\n  )).toBeTrue()\n})\n\ntest('skip evaluation of the second expression', () =\u003e {\n  let effect = 'not evaluated'\n  const F = function (){\n    return true\n  }\n  const Z = function (){\n    effect = 'Z got evaluated'\n  }\n  either(F, Z)()\n\n  expect(effect).toBe('not evaluated')\n})\n\ntest('case 1', () =\u003e {\n  const firstFn = val =\u003e val \u003e 0\n  const secondFn = val =\u003e val * 5 \u003e 10\n\n  expect(either(firstFn, secondFn)(1)).toBeTrue()\n})\n\ntest('case 2', () =\u003e {\n  const firstFn = val =\u003e val \u003e 0\n  const secondFn = val =\u003e val === -10\n  const fn = either(firstFn)(secondFn)\n\n  expect(fn(-10)).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {either} from 'rambda'\n\ndescribe('R.either', () =\u003e {\n  it('with passed type', () =\u003e {\n    const fn = either\u003cnumber\u003e(\n      x =\u003e x \u003e 1,\n      x =\u003e x % 2 === 0\n    )\n    fn // $ExpectType Predicate\u003cnumber\u003e\n    const result = fn(2) // $ExpectType boolean\n    result // $ExpectType boolean\n  })\n  it('with passed type - curried', () =\u003e {\n    const fn = either\u003cnumber\u003e(x =\u003e x \u003e 1)(x =\u003e x % 2 === 0)\n    fn // $ExpectType Predicate\u003cnumber\u003e\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n  it('no type passed', () =\u003e {\n    const fn = either(\n      x =\u003e {\n        x // $ExpectType any\n        return x \u003e 1\n      },\n      x =\u003e {\n        x // $ExpectType any\n        return x % 2 === 0\n      }\n    )\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n  it('no type passed - curried', () =\u003e {\n    const fn = either((x: number) =\u003e {\n      x // $ExpectType number\n      return x \u003e 1\n    })((x: number) =\u003e {\n      x // $ExpectType number\n      return x % 2 === 0\n    })\n    const result = fn(2)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#either)\n\n### empty\n\n```typescript\n\nempty\u003cT\u003e(x: T): T\n```\n\n```javascript\nconst result = [R.empty([1,2,3]), R.empty('foo'), R.empty({x: 1, y: 2})]\n// =\u003e [[], '', {}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nempty\u003cT\u003e(x: T): T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.empty\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { type } from './type.js'\n\nexport function empty(list){\n  if (typeof list === 'string') return ''\n\n  if (Array.isArray(list)){\n    const { name } = list.constructor\n    if (name === 'Uint8Array') return Uint8Array.from('')\n\n    if (name === 'Float32Array') return new Float32Array([])\n\n    return []\n  }\n  if (type(list) === 'Object') return {}\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { empty } from 'ramda'\n\ntest('returns empty array given array', () =\u003e {\n  expect(empty([ 1, 2, 3 ])).toEqual([])\n})\n\ntest('returns empty array of equivalent type given typed array', () =\u003e {\n  expect(empty(Uint8Array.from('123'))).toEqual(Uint8Array.from(''))\n  expect(empty(Uint8Array.from('123')).constructor.name).toBe('Uint8Array')\n  expect(empty(new Float32Array([ 1, 2, 3 ]))).toEqual(new Float32Array([]))\n  expect(empty(new Float32Array([ 1, 2, 3 ])).constructor.name).toBe('Float32Array')\n})\n\ntest('returns empty string given string', () =\u003e {\n  expect(empty('abc')).toBe('')\n  expect(empty(new String('abc'))).toBe('')\n})\n\ntest('other types', () =\u003e {\n  expect(empty({ a : 1 })).toEqual({})\n  expect(empty(/foo/g)).toBeUndefined()\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#empty)\n\n### endsWith\n\n```typescript\n\nendsWith\u003cT extends string\u003e(question: T, str: string): boolean\n```\n\nWhen iterable is a string, then it behaves as `String.prototype.endsWith`.\nWhen iterable is a list, then it uses R.equals to determine if the target list ends in the same way as the given target.\n\n```javascript\nconst str = 'foo-bar'\nconst list = [{a:1}, {a:2}, {a:3}]\n\nconst result = [\n  R.endsWith('bar', str),\n  R.endsWith([{a:1}, {a:2}], list)\n]\n// =\u003e [true, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nendsWith\u003cT extends string\u003e(question: T, str: string): boolean;\nendsWith\u003cT extends string\u003e(question: T): (str: string) =\u003e boolean;\nendsWith\u003cT\u003e(question: T[], list: T[]): boolean;\nendsWith\u003cT\u003e(question: T[]): (list: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.endsWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { equals } from './equals.js'\n\nexport function endsWith(target, iterable){\n  if (arguments.length === 1) return _iterable =\u003e endsWith(target, _iterable)\n\n  if (typeof iterable === 'string'){\n    return iterable.endsWith(target)\n  }\n  if (!isArray(target)) return false\n\n  const diff = iterable.length - target.length\n  let correct = true\n  const filtered = target.filter((x, index) =\u003e {\n    if (!correct) return false\n    const result = equals(x, iterable[ index + diff ])\n    if (!result) correct = false\n\n    return result\n  })\n\n  return filtered.length === target.length\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { endsWith as endsWithRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { endsWith } from './endsWith.js'\n\ntest('with string', () =\u003e {\n  expect(endsWith('bar', 'foo-bar')).toBeTrue()\n  expect(endsWith('baz')('foo-bar')).toBeFalse()\n})\n\ntest('use R.equals with array', () =\u003e {\n  const list = [ { a : 1 }, { a : 2 }, { a : 3 } ]\n  expect(endsWith({ a : 3 }, list)).toBeFalse(),\n  expect(endsWith([ { a : 3 } ], list)).toBeTrue()\n  expect(endsWith([ { a : 2 }, { a : 3 } ], list)).toBeTrue()\n  expect(endsWith(list, list)).toBeTrue()\n  expect(endsWith([ { a : 1 } ], list)).toBeFalse()\n})\n\nexport const possibleTargets = [\n  NaN,\n  [ NaN ],\n  /foo/,\n  [ /foo/ ],\n  Promise.resolve(1),\n  [ Promise.resolve(1) ],\n  Error('foo'),\n  [ Error('foo') ],\n]\n\nexport const possibleIterables = [\n  [ Promise.resolve(1), Promise.resolve(2) ],\n  [ /foo/, /bar/ ],\n  [ NaN ],\n  [ Error('foo'), Error('bar') ],\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : endsWith,\n    fnRamda     : endsWithRamda,\n    firstInput  : possibleTargets,\n    secondInput : possibleIterables,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 32,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {endsWith} from 'rambda'\n\ndescribe('R.endsWith - array', () =\u003e {\n  const target = [{a: 2}]\n  const input = [{a: 1}, {a: 2}]\n  it('happy', () =\u003e {\n    const result = endsWith(target, input)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = endsWith(target)(input)\n    result // $ExpectType boolean\n  })\n})\n\ndescribe('R.endsWith - string', () =\u003e {\n  const target = 'bar'\n  const input = 'foo bar'\n  it('happy', () =\u003e {\n    const result = endsWith(target, input)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = endsWith(target)(input)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#endsWith)\n\n### eqBy\n\n```typescript\n\neqBy\u003cT\u003e(fn: (a: T) =\u003e unknown, a: T, b: T): boolean\n```\n\n```javascript\nconst result = R.eqBy(Math.abs, 5, -5)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\neqBy\u003cT\u003e(fn: (a: T) =\u003e unknown, a: T, b: T): boolean;\neqBy\u003cT\u003e(fn: (a: T) =\u003e unknown, a: T): (b: T) =\u003e boolean;\neqBy\u003cT\u003e(fn: (a: T) =\u003e unknown): {\n  (a: T, b: T): boolean;\n  (a: T): (b: T) =\u003e boolean;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.eqBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { equals } from './equals.js'\n\nexport function eqByFn(\n  fn, a, b\n){\n  return equals(fn(a), fn(b))\n}\n\nexport const eqBy = curry(eqByFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { eqByFn } from './eqBy.js'\n\ntest('deteremines whether two values map to the same value in the codomain', () =\u003e {\n  expect(eqByFn(\n    Math.abs, 5, 5\n  )).toBe(true)\n  expect(eqByFn(\n    Math.abs, 5, -5\n  )).toBe(true)\n  expect(eqByFn(\n    Math.abs, -5, 5\n  )).toBe(true)\n  expect(eqByFn(\n    Math.abs, -5, -5\n  )).toBe(true)\n  expect(eqByFn(\n    Math.abs, 42, 99\n  )).toBe(false)\n})\n\ntest('has R.equals semantics', () =\u003e {\n  expect(eqByFn(\n    Math.abs, NaN, NaN\n  )).toBe(true)\n  expect(eqByFn(\n    Math.abs, [ 42 ], [ 42 ]\n  )).toBe(true)\n  expect(eqByFn(\n    x =\u003e x, { a : 1 }, { a : 1 }\n  )).toBe(true)\n  expect(eqByFn(\n    x =\u003e x, { a : 1 }, { a : 2 }\n  )).toBe(false)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#eqBy)\n\n### eqProps\n\n```typescript\n\neqProps\u003cT, U\u003e(prop: string, obj1: T, obj2: U): boolean\n```\n\nIt returns `true` if property `prop` in `obj1` is equal to property `prop` in `obj2` according to `R.equals`.\n\n```javascript\nconst obj1 = {a: 1, b:2}\nconst obj2 = {a: 1, b:3}\nconst result = R.eqProps('a', obj1, obj2)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\neqProps\u003cT, U\u003e(prop: string, obj1: T, obj2: U): boolean;\neqProps\u003cP extends string\u003e(prop: P): \u003cT, U\u003e(obj1: Record\u003cP, T\u003e, obj2: Record\u003cP, U\u003e) =\u003e boolean;\neqProps\u003cT\u003e(prop: string, obj1: T): \u003cU\u003e(obj2: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.eqProps\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { equals } from './equals.js'\nimport { prop } from './prop.js'\n\nfunction eqPropsFn(\n  property, objA, objB\n){\n  return equals(prop(property, objA), prop(property, objB))\n}\n\nexport const eqProps = curry(eqPropsFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { eqProps as eqPropsRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { eqProps } from './eqProps.js'\n\nconst obj1 = {\n  a : 1,\n  b : 2,\n}\nconst obj2 = {\n  a : 1,\n  b : 3,\n}\n\ntest('props are equal', () =\u003e {\n  const result = eqProps(\n    'a', obj1, obj2\n  )\n  expect(result).toBeTrue()\n})\n\ntest('props are not equal', () =\u003e {\n  const result = eqProps(\n    'b', obj1, obj2\n  )\n  expect(result).toBeFalse()\n})\n\ntest('prop does not exist', () =\u003e {\n  const result = eqProps(\n    'c', obj1, obj2\n  )\n  expect(result).toBeTrue()\n})\n\ntest('can handle null or undefined object', () =\u003e {\n  expect(eqProps(\n    'value', { value : 0 }, null\n  )).toBeFalse()\n  expect(eqProps(\n    'value', { value : 0 }, undefined\n  )).toBeFalse()\n  expect(eqProps(\n    'value', null, { value : 0 }\n  )).toBeFalse()\n  expect(eqProps(\n    'value', undefined, { value : 0 }\n  )).toBeFalse()\n  expect(eqProps(\n    'value', undefined, { value : undefined }\n  )).toBeTrue()\n  expect(eqProps(\n    'value', null, { value : undefined }\n  )).toBeTrue()\n  expect(eqProps(\n    'value', { value : undefined }, undefined\n  )).toBeTrue()\n  expect(eqProps(\n    'value', { value : undefined }, null\n  )).toBeTrue()\n  expect(eqProps(\n    'value', {}, null\n  )).toBeTrue()\n  expect(eqProps(\n    'value', {}, undefined\n  )).toBeTrue()\n  expect(eqProps(\n    'value', null, {}\n  )).toBeTrue()\n  expect(eqProps(\n    'value', undefined, {}\n  )).toBeTrue()\n})\n\nconst possibleProps = [ 'a', 'a.b', null, false, 0, 1, {}, [] ]\n\nconst possibleObjects = [\n  { a : 1 },\n  {\n    a : 1,\n    b : 2,\n  },\n  {},\n  [],\n  null,\n  {\n    a : { b : 1 },\n    c : 2,\n  },\n  {\n    a : { b : 1 },\n    c : 3,\n  },\n  { a : { b : 2 } },\n]\n\ndescribe('brute force', () =\u003e {\n  let totalTestsCounter = 0\n\n  compareCombinations({\n    firstInput : possibleProps,\n    setCounter : () =\u003e totalTestsCounter++,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 120,\n          \"TOTAL_TESTS\": 512,\n        }\n      `)\n    },\n    secondInput : possibleObjects,\n    thirdInput  : possibleObjects,\n    fn          : eqProps,\n    fnRamda     : eqPropsRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {eqProps} from 'rambda'\n\nconst obj1 = {a: {b: 1}, c: 2}\nconst obj2 = {a: {b: 1}, c: 3}\n\ndescribe('R.eqProps', () =\u003e {\n  it('happy', () =\u003e {\n    const result = eqProps('a', obj1, obj2)\n\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = eqProps('a', obj1)(obj2)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#eqProps)\n\n### equals\n\n```typescript\n\nequals\u003cT\u003e(x: T, y: T): boolean\n```\n\nIt deeply compares `x` and `y` and returns `true` if they are equal.\n\n\u003e :boom: It doesn't handle cyclical data structures and functions\n\n```javascript\nR.equals(\n  [1, {a:2}, [{b: 3}]],\n  [1, {a:2}, [{b: 3}]]\n) // =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nequals\u003cT\u003e(x: T, y: T): boolean;\nequals\u003cT\u003e(x: T): (y: T) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.equals\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { type } from './type.js'\n\nexport function _lastIndexOf(valueToFind, list){\n  if (!isArray(list))\n    throw new Error(`Cannot read property 'indexOf' of ${ list }`)\n\n  const typeOfValue = type(valueToFind)\n  if (![ 'Array', 'NaN', 'Object', 'RegExp' ].includes(typeOfValue))\n    return list.lastIndexOf(valueToFind)\n\n  const { length } = list\n  let index = length\n  let foundIndex = -1\n\n  while (--index \u003e -1 \u0026\u0026 foundIndex === -1)\n    if (equals(list[ index ], valueToFind))\n      foundIndex = index\n\n  return foundIndex\n}\n\nexport function _indexOf(valueToFind, list){\n  if (!isArray(list))\n    throw new Error(`Cannot read property 'indexOf' of ${ list }`)\n\n  const typeOfValue = type(valueToFind)\n  if (![ 'Array', 'NaN', 'Object', 'RegExp' ].includes(typeOfValue))\n    return list.indexOf(valueToFind)\n\n  let index = -1\n  let foundIndex = -1\n  const { length } = list\n\n  while (++index \u003c length \u0026\u0026 foundIndex === -1)\n    if (equals(list[ index ], valueToFind))\n      foundIndex = index\n\n  return foundIndex\n}\n\nfunction _arrayFromIterator(iter){\n  const list = []\n  let next\n  while (!(next = iter.next()).done)\n    list.push(next.value)\n\n  return list\n}\n\nfunction _compareSets(a, b){\n  if (a.size !== b.size)\n    return false\n\n  const aList = _arrayFromIterator(a.values())\n  const bList = _arrayFromIterator(b.values())\n\n  const filtered = aList.filter(aInstance =\u003e _indexOf(aInstance, bList) === -1)\n\n  return filtered.length === 0\n}\n\nfunction compareErrors(a, b){\n  if (a.message !== b.message) return false\n  if (a.toString !== b.toString) return false\n\n  return a.toString() === b.toString()\n}\n\nfunction parseDate(maybeDate){\n  if (!maybeDate.toDateString) return [ false ]\n\n  return [ true, maybeDate.getTime() ]\n}\n\nfunction parseRegex(maybeRegex){\n  if (maybeRegex.constructor !== RegExp) return [ false ]\n\n  return [ true, maybeRegex.toString() ]\n}\n\nexport function equals(a, b){\n  if (arguments.length === 1) return _b =\u003e equals(a, _b)\n\n  if (Object.is(a, b)) return true\n\n  const aType = type(a)\n\n  if (aType !== type(b)) return false\n  if (aType === 'Function')\n    return a.name === undefined ? false : a.name === b.name\n\n  if ([ 'NaN', 'Null', 'Undefined' ].includes(aType)) return true\n\n  if ([ 'BigInt', 'Number' ].includes(aType)){\n    if (Object.is(-0, a) !== Object.is(-0, b)) return false\n\n    return a.toString() === b.toString()\n  }\n\n  if ([ 'Boolean', 'String' ].includes(aType))\n    return a.toString() === b.toString()\n\n  if (aType === 'Array'){\n    const aClone = Array.from(a)\n    const bClone = Array.from(b)\n\n    if (aClone.toString() !== bClone.toString())\n      return false\n\n    let loopArrayFlag = true\n    aClone.forEach((aCloneInstance, aCloneIndex) =\u003e {\n      if (loopArrayFlag)\n        if (\n          aCloneInstance !== bClone[ aCloneIndex ] \u0026\u0026\n          !equals(aCloneInstance, bClone[ aCloneIndex ])\n        )\n          loopArrayFlag = false\n\n    })\n\n    return loopArrayFlag\n  }\n\n  const aRegex = parseRegex(a)\n  const bRegex = parseRegex(b)\n\n  if (aRegex[ 0 ])\n    return bRegex[ 0 ] ? aRegex[ 1 ] === bRegex[ 1 ] : false\n  else if (bRegex[ 0 ]) return false\n\n  const aDate = parseDate(a)\n  const bDate = parseDate(b)\n\n  if (aDate[ 0 ])\n    return bDate[ 0 ] ? aDate[ 1 ] === bDate[ 1 ] : false\n  else if (bDate[ 0 ]) return false\n\n  if (a instanceof Error){\n    if (!(b instanceof Error)) return false\n\n    return compareErrors(a, b)\n  }\n\n  if (aType === 'Set')\n    return _compareSets(a, b)\n\n  if (aType === 'Object'){\n    const aKeys = Object.keys(a)\n\n    if (aKeys.length !== Object.keys(b).length)\n      return false\n\n    let loopObjectFlag = true\n    aKeys.forEach(aKeyInstance =\u003e {\n      if (loopObjectFlag){\n        const aValue = a[ aKeyInstance ]\n        const bValue = b[ aKeyInstance ]\n\n        if (aValue !== bValue \u0026\u0026 !equals(aValue, bValue))\n          loopObjectFlag = false\n\n      }\n    })\n\n    return loopObjectFlag\n  }\n\n  return false\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals as equalsRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { variousTypes } from './benchmarks/_utils.js'\nimport { equals } from './equals.js'\n\ntest('compare functions', () =\u003e {\n  function foo(){}\n  function bar(){}\n  const baz = () =\u003e {}\n\n  const expectTrue = equals(foo, foo)\n  const expectFalseFirst = equals(foo, bar)\n  const expectFalseSecond = equals(foo, baz)\n\n  expect(expectTrue).toBeTrue()\n  expect(expectFalseFirst).toBeFalse()\n  expect(expectFalseSecond).toBeFalse()\n})\n\ntest('with array of objects', () =\u003e {\n  const list1 = [ { a : 1 }, [ { b : 2 } ] ]\n  const list2 = [ { a : 1 }, [ { b : 2 } ] ]\n  const list3 = [ { a : 1 }, [ { b : 3 } ] ]\n\n  expect(equals(list1, list2)).toBeTrue()\n  expect(equals(list1, list3)).toBeFalse()\n})\n\ntest('with regex', () =\u003e {\n  expect(equals(/s/, /s/)).toBeTrue()\n  expect(equals(/s/, /d/)).toBeFalse()\n  expect(equals(/a/gi, /a/gi)).toBeTrue()\n  expect(equals(/a/gim, /a/gim)).toBeTrue()\n  expect(equals(/a/gi, /a/i)).toBeFalse()\n})\n\ntest('not a number', () =\u003e {\n  expect(equals([ NaN ], [ NaN ])).toBeTrue()\n})\n\ntest('new number', () =\u003e {\n  expect(equals(new Number(0), new Number(0))).toBeTrue()\n  expect(equals(new Number(0), new Number(1))).toBeFalse()\n  expect(equals(new Number(1), new Number(0))).toBeFalse()\n})\n\ntest('new string', () =\u003e {\n  expect(equals(new String(''), new String(''))).toBeTrue()\n  expect(equals(new String(''), new String('x'))).toBeFalse()\n  expect(equals(new String('x'), new String(''))).toBeFalse()\n  expect(equals(new String('foo'), new String('foo'))).toBeTrue()\n  expect(equals(new String('foo'), new String('bar'))).toBeFalse()\n  expect(equals(new String('bar'), new String('foo'))).toBeFalse()\n})\n\ntest('new Boolean', () =\u003e {\n  expect(equals(new Boolean(true), new Boolean(true))).toBeTrue()\n  expect(equals(new Boolean(false), new Boolean(false))).toBeTrue()\n  expect(equals(new Boolean(true), new Boolean(false))).toBeFalse()\n  expect(equals(new Boolean(false), new Boolean(true))).toBeFalse()\n})\n\ntest('new Error', () =\u003e {\n  expect(equals(new Error('XXX'), {})).toBeFalse()\n  expect(equals(new Error('XXX'), new TypeError('XXX'))).toBeFalse()\n  expect(equals(new Error('XXX'), new Error('YYY'))).toBeFalse()\n  expect(equals(new Error('XXX'), new Error('XXX'))).toBeTrue()\n  expect(equals(new Error('XXX'), new TypeError('YYY'))).toBeFalse()\n  expect(equals(new Error('XXX'), new Error('XXX'))).toBeTrue()\n})\n\ntest('with dates', () =\u003e {\n  expect(equals(new Date(0), new Date(0))).toBeTrue()\n  expect(equals(new Date(1), new Date(1))).toBeTrue()\n  expect(equals(new Date(0), new Date(1))).toBeFalse()\n  expect(equals(new Date(1), new Date(0))).toBeFalse()\n  expect(equals(new Date(0), {})).toBeFalse()\n  expect(equals({}, new Date(0))).toBeFalse()\n})\n\ntest('ramda spec', () =\u003e {\n  expect(equals({}, {})).toBeTrue()\n\n  expect(equals({\n    a : 1,\n    b : 2,\n  },\n  {\n    a : 1,\n    b : 2,\n  })).toBeTrue()\n\n  expect(equals({\n    a : 2,\n    b : 3,\n  },\n  {\n    a : 2,\n    b : 3,\n  })).toBeTrue()\n\n  expect(equals({\n    a : 2,\n    b : 3,\n  },\n  {\n    a : 3,\n    b : 3,\n  })).toBeFalse()\n\n  expect(equals({\n    a : 2,\n    b : 3,\n    c : 1,\n  },\n  {\n    a : 2,\n    b : 3,\n  })).toBeFalse()\n})\n\ntest('works with boolean tuple', () =\u003e {\n  expect(equals([ true, false ], [ true, false ])).toBeTrue()\n  expect(equals([ true, false ], [ true, true ])).toBeFalse()\n})\n\ntest('works with equal objects within array', () =\u003e {\n  const objFirst = {\n    a : {\n      b : 1,\n      c : 2,\n      d : [ 1 ],\n    },\n  }\n  const objSecond = {\n    a : {\n      b : 1,\n      c : 2,\n      d : [ 1 ],\n    },\n  }\n\n  const x = [ 1, 2, objFirst, null, '', [] ]\n  const y = [ 1, 2, objSecond, null, '', [] ]\n  expect(equals(x, y)).toBeTrue()\n})\n\ntest('works with different objects within array', () =\u003e {\n  const objFirst = { a : { b : 1 } }\n  const objSecond = { a : { b : 2 } }\n\n  const x = [ 1, 2, objFirst, null, '', [] ]\n  const y = [ 1, 2, objSecond, null, '', [] ]\n  expect(equals(x, y)).toBeFalse()\n})\n\ntest('works with undefined as second argument', () =\u003e {\n  expect(equals(1, undefined)).toBeFalse()\n\n  expect(equals(undefined, undefined)).toBeTrue()\n})\n\ntest('compare sets', () =\u003e {\n  const toCompareDifferent = new Set([ { a : 1 }, { a : 2 } ])\n  const toCompareSame = new Set([ { a : 1 }, { a : 2 }, { a : 1 } ])\n  const testSet = new Set([ { a : 1 }, { a : 2 }, { a : 1 } ])\n  expect(equals(toCompareSame, testSet)).toBeTruthy()\n  expect(equals(toCompareDifferent, testSet)).toBeFalsy()\n  expect(equalsRamda(toCompareSame, testSet)).toBeTruthy()\n  expect(equalsRamda(toCompareDifferent, testSet)).toBeFalsy()\n})\n\ntest('compare simple sets', () =\u003e {\n  const testSet = new Set([ '2', '3', '3', '2', '1' ])\n  expect(equals(new Set([ '3', '2', '1' ]), testSet)).toBeTruthy()\n  expect(equals(new Set([ '3', '2', '0' ]), testSet)).toBeFalsy()\n})\n\ntest('various examples', () =\u003e {\n  expect(equals([ 1, 2, 3 ])([ 1, 2, 3 ])).toBeTrue()\n\n  expect(equals([ 1, 2, 3 ], [ 1, 2 ])).toBeFalse()\n\n  expect(equals(1, 1)).toBeTrue()\n\n  expect(equals(1, '1')).toBeFalse()\n\n  expect(equals({}, {})).toBeTrue()\n\n  expect(equals({\n    a : 1,\n    b : 2,\n  },\n  {\n    a : 1,\n    b : 2,\n  })).toBeTrue()\n\n  expect(equals({\n    a : 1,\n    b : 2,\n  },\n  {\n    a : 1,\n    b : 1,\n  })).toBeFalse()\n\n  expect(equals({\n    a : 1,\n    b : false,\n  },\n  {\n    a : 1,\n    b : 1,\n  })).toBeFalse()\n\n  expect(equals({\n    a : 1,\n    b : 2,\n  },\n  {\n    a : 1,\n    b : 2,\n    c : 3,\n  })).toBeFalse()\n\n  expect(equals({\n    x : {\n      a : 1,\n      b : 2,\n    },\n  },\n  {\n    x : {\n      a : 1,\n      b : 2,\n      c : 3,\n    },\n  })).toBeFalse()\n\n  expect(equals({\n    a : 1,\n    b : 2,\n  },\n  {\n    a : 1,\n    b : 3,\n  })).toBeFalse()\n\n  expect(equals({ a : { b : { c : 1 } } }, { a : { b : { c : 1 } } })).toBeTrue()\n\n  expect(equals({ a : { b : { c : 1 } } }, { a : { b : { c : 2 } } })).toBeFalse()\n\n  expect(equals({ a : {} }, { a : {} })).toBeTrue()\n\n  expect(equals('', '')).toBeTrue()\n\n  expect(equals('foo', 'foo')).toBeTrue()\n\n  expect(equals('foo', 'bar')).toBeFalse()\n\n  expect(equals(0, false)).toBeFalse()\n\n  expect(equals(/\\s/g, null)).toBeFalse()\n\n  expect(equals(null, null)).toBeTrue()\n\n  expect(equals(false)(null)).toBeFalse()\n})\n\ntest('with custom functions', () =\u003e {\n  function foo(){\n    return 1\n  }\n  foo.prototype.toString = () =\u003e ''\n  const result = equals(foo, foo)\n\n  expect(result).toBeTrue()\n})\n\ntest('with classes', () =\u003e {\n  class Foo{}\n  const foo = new Foo()\n  const result = equals(foo, foo)\n\n  expect(result).toBeTrue()\n})\n\ntest('with negative zero', () =\u003e {\n  expect(equals(-0, -0)).toBeTrue()\n  expect(equals(-0, 0)).toBeFalse()\n  expect(equals(0, 0)).toBeTrue()\n  expect(equals(-0, 1)).toBeFalse()\n})\n\ntest('with big int', () =\u003e {\n  const a = BigInt(9007199254740991)\n  const b = BigInt(9007199254740991)\n  const c = BigInt(7007199254740991)\n  expect(equals(a, b)).toBeTrue()\n  expect(equals(a, c)).toBeFalse()\n})\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    callback : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n{\n  \"ERRORS_MESSAGE_MISMATCH\": 0,\n  \"ERRORS_TYPE_MISMATCH\": 0,\n  \"RESULTS_MISMATCH\": 0,\n  \"SHOULD_NOT_THROW\": 0,\n  \"SHOULD_THROW\": 0,\n  \"TOTAL_TESTS\": 289,\n}\n`)\n    },\n    firstInput  : variousTypes,\n    fn          : equals,\n    fnRamda     : equalsRamda,\n    secondInput : variousTypes,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {equals} from 'rambda'\n\ndescribe('R.equals', () =\u003e {\n  it('happy', () =\u003e {\n    const result = equals(4, 1)\n    result // $ExpectType boolean\n  })\n  it('with object', () =\u003e {\n    const foo = {a: 1}\n    const bar = {a: 2}\n    const result = equals(foo, bar)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = equals(4)(1)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#equals)\n\n### evolve\n\n```typescript\n\nevolve\u003cT, U\u003e(rules: ((x: T) =\u003e U)[], list: T[]): U[]\n```\n\nIt takes object or array of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.\n\n\u003e :boom: Error handling of this method differs between Ramda and Rambda. Ramda for some wrong inputs returns result and for other - it returns one of the inputs. Rambda simply throws when inputs are not correct. Full details for this mismatch are listed in `source/_snapshots/evolve.spec.js.snap` file.\n\n```javascript\nconst rules = {\n  foo : add(1),\n  bar : add(-1),\n}\nconst input = {\n  a   : 1,\n  foo : 2,\n  bar : 3,\n}\nconst result = evolve(rules, input)\nconst expected = {\n  a   : 1,\n  foo : 3,\n  bar : 2,\n})\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nevolve\u003cT, U\u003e(rules: ((x: T) =\u003e U)[], list: T[]): U[];\nevolve\u003cT, U\u003e(rules: ((x: T) =\u003e U)[]) : (list: T[]) =\u003e U[];\nevolve\u003cE extends Evolver, V extends Evolvable\u003cE\u003e\u003e(rules: E, obj: V): Evolve\u003cV, E\u003e;\nevolve\u003cE extends Evolver\u003e(rules: E): \u003cV extends Evolvable\u003cE\u003e\u003e(obj: V) =\u003e Evolve\u003cV, E\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.evolve\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { mapArray, mapObject } from './map.js'\nimport { type } from './type.js'\n\nexport function evolveArray(rules, list){\n  return mapArray(\n    (x, i) =\u003e {\n      if (type(rules[ i ]) === 'Function'){\n        return rules[ i ](x)\n      }\n\n      return x\n    },\n    list,\n    true\n  )\n}\n\nexport function evolveObject(rules, iterable){\n  return mapObject((x, prop) =\u003e {\n    if (type(x) === 'Object'){\n      const typeRule = type(rules[ prop ])\n      if (typeRule === 'Function'){\n        return rules[ prop ](x)\n      }\n      if (typeRule === 'Object'){\n        return evolve(rules[ prop ], x)\n      }\n\n      return x\n    }\n    if (type(rules[ prop ]) === 'Function'){\n      return rules[ prop ](x)\n    }\n\n    return x\n  }, iterable)\n}\n\nexport function evolve(rules, iterable){\n  if (arguments.length === 1){\n    return _iterable =\u003e evolve(rules, _iterable)\n  }\n  const rulesType = type(rules)\n  const iterableType = type(iterable)\n\n  if (iterableType !== rulesType){\n    throw new Error('iterableType !== rulesType')\n  }\n\n  if (![ 'Object', 'Array' ].includes(rulesType)){\n    throw new Error(`'iterable' and 'rules' are from wrong type ${ rulesType }`)\n  }\n\n  if (iterableType === 'Object'){\n    return evolveObject(rules, iterable)\n  }\n\n  return evolveArray(rules, iterable)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { evolve as evolveRamda } from 'ramda'\n\nimport { add } from '../rambda.js'\nimport { compareCombinations, compareToRamda } from './_internals/testUtils.js'\nimport { evolve } from './evolve.js'\n\ntest('happy', () =\u003e {\n  const rules = {\n    foo    : add(1),\n    nested : { bar : x =\u003e Object.keys(x).length },\n  }\n  const input = {\n    a      : 1,\n    foo    : 2,\n    nested : { bar : { z : 3 } },\n  }\n  const result = evolve(rules, input)\n  expect(result).toEqual({\n    a      : 1,\n    foo    : 3,\n    nested : { bar : 1 },\n  })\n})\n\ntest('nested rule is wrong', () =\u003e {\n  const rules = {\n    foo    : add(1),\n    nested : { bar : 10 },\n  }\n  const input = {\n    a      : 1,\n    foo    : 2,\n    nested : { bar : { z : 3 } },\n  }\n  const result = evolve(rules)(input)\n  expect(result).toEqual({\n    a      : 1,\n    foo    : 3,\n    nested : { bar : { z : 3 } },\n  })\n})\n\ntest('is recursive', () =\u003e {\n  const rules = {\n    nested : {\n      second : add(-1),\n      third  : add(1),\n    },\n  }\n  const object = {\n    first  : 1,\n    nested : {\n      second : 2,\n      third  : 3,\n    },\n  }\n  const expected = {\n    first  : 1,\n    nested : {\n      second : 1,\n      third  : 4,\n    },\n  }\n  const result = evolve(rules, object)\n  expect(result).toEqual(expected)\n})\n\ntest('ignores primitive values', () =\u003e {\n  const rules = {\n    n : 2,\n    m : 'foo',\n  }\n  const object = {\n    n : 0,\n    m : 1,\n  }\n  const expected = {\n    n : 0,\n    m : 1,\n  }\n  const result = evolve(rules, object)\n  expect(result).toEqual(expected)\n})\n\ntest('with array', () =\u003e {\n  const rules = [ add(1), add(-1) ]\n  const list = [ 100, 1400 ]\n  const expected = [ 101, 1399 ]\n  const result = evolve(rules, list)\n  expect(result).toEqual(expected)\n})\n\nconst rulesObject = { a : add(1) }\nconst rulesList = [ add(1) ]\nconst possibleIterables = [ null, undefined, '', 42, [], [ 1 ], { a : 1 } ]\nconst possibleRules = [ ...possibleIterables, rulesList, rulesObject ]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    firstInput : possibleRules,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 4,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 51,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 63,\n        }\n      `)\n    },\n    secondInput : possibleIterables,\n    fn          : evolve,\n    fnRamda     : evolveRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {evolve, add} from 'rambda'\n\ndescribe('R.evolve', () =\u003e {\n  it('happy', () =\u003e {\n    const input = {\n      foo: 2,\n      nested: {\n        a: 1,\n        bar: 3,\n      },\n    }\n    const rules = {\n      foo: add(1),\n      nested: {\n        a: add(-1),\n        bar: add(1),\n      },\n    }\n    const result = evolve(rules, input)\n    const curriedResult = evolve(rules)(input)\n\n    result.nested.a // $ExpectType number\n    curriedResult.nested.a // $ExpectType number\n    result.nested.bar // $ExpectType number\n    result.foo // $ExpectType number\n  })\n  it('with array', () =\u003e {\n    const rules = [String, String]\n    const input = [100, 1400]\n    const result = evolve(rules, input)\n    const curriedResult = evolve(rules)(input)\n    result // $ExpectType string[]\n    curriedResult // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#evolve)\n\n### F\n\n```typescript\n\nF(): boolean\n```\n\n```javascript\nF() // =\u003e false\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nF(): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.F\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function F(){\n  return false\n}\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#F)\n\n### filter\n\n```typescript\n\nfilter\u003cT\u003e(predicate: Predicate\u003cT\u003e): (input: T[]) =\u003e T[]\n```\n\nIt filters list or object `input` using a `predicate` function.\n\n```javascript\nconst list = [3, 4, 3, 2]\nconst listPredicate = x =\u003e x \u003e 2\n\nconst object = {abc: 'fo', xyz: 'bar', baz: 'foo'}\nconst objectPredicate = (x, prop) =\u003e x.length + prop.length \u003e 5\n\nconst result = [\n  R.filter(listPredicate, list),\n  R.filter(objectPredicate, object)\n]\n// =\u003e [ [3, 4], { xyz: 'bar', baz: 'foo'} ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfilter\u003cT\u003e(predicate: Predicate\u003cT\u003e): (input: T[]) =\u003e T[];\nfilter\u003cT\u003e(predicate: Predicate\u003cT\u003e, input: T[]): T[];\nfilter\u003cT, U\u003e(predicate: ObjectPredicate\u003cT\u003e): (x: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cT\u003e;\nfilter\u003cT\u003e(predicate: ObjectPredicate\u003cT\u003e, x: Dictionary\u003cT\u003e): Dictionary\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.filter\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function filterObject(predicate, obj){\n  const willReturn = {}\n\n  for (const prop in obj){\n    if (predicate(\n      obj[ prop ], prop, obj\n    )){\n      willReturn[ prop ] = obj[ prop ]\n    }\n  }\n\n  return willReturn\n}\n\nexport function filterArray(\n  predicate, list, indexed = false\n){\n  let index = 0\n  const len = list.length\n  const willReturn = []\n\n  while (index \u003c len){\n    const predicateResult = indexed ?\n      predicate(list[ index ], index) :\n      predicate(list[ index ])\n    if (predicateResult){\n      willReturn.push(list[ index ])\n    }\n\n    index++\n  }\n\n  return willReturn\n}\n\nexport function filter(predicate, iterable){\n  if (arguments.length === 1)\n    return _iterable =\u003e filter(predicate, _iterable)\n  if (!iterable){\n    throw new Error('Incorrect iterable input')\n  }\n\n  if (isArray(iterable)) return filterArray(\n    predicate, iterable, false\n  )\n\n  return filterObject(predicate, iterable)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { filter as filterRamda } from 'ramda'\n\nimport { filter } from './filter.js'\nimport { T } from './T.js'\n\nconst sampleObject = {\n  a : 1,\n  b : 2,\n  c : 3,\n  d : 4,\n}\n\ntest('happy', () =\u003e {\n  const isEven = n =\u003e n % 2 === 0\n\n  expect(filter(isEven, [ 1, 2, 3, 4 ])).toEqual([ 2, 4 ])\n  expect(filter(isEven, {\n    a : 1,\n    b : 2,\n    d : 3,\n  })).toEqual({ b : 2 })\n})\n\ntest('predicate when input is object', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n  }\n  const predicate = (\n    val, prop, inputObject\n  ) =\u003e {\n    expect(inputObject).toEqual(obj)\n    expect(typeof prop).toBe('string')\n\n    return val \u003c 2\n  }\n  expect(filter(predicate, obj)).toEqual({ a : 1 })\n})\n\ntest('with object', () =\u003e {\n  const isEven = n =\u003e n % 2 === 0\n  const result = filter(isEven, sampleObject)\n  const expectedResult = {\n    b : 2,\n    d : 4,\n  }\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('bad inputs difference between Ramda and Rambda', () =\u003e {\n  expect(() =\u003e filter(T, null)).toThrowWithMessage(Error,\n    'Incorrect iterable input')\n  expect(() =\u003e filter(T)(undefined)).toThrowWithMessage(Error,\n    'Incorrect iterable input')\n  expect(() =\u003e filterRamda(T, null)).toThrowWithMessage(TypeError,\n    'Cannot read properties of null (reading \\'fantasy-land/filter\\')')\n  expect(() =\u003e filterRamda(T, undefined)).toThrowWithMessage(TypeError,\n    'Cannot read properties of undefined (reading \\'fantasy-land/filter\\')')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {filter} from 'rambda'\n\nconst list = [1, 2, 3]\nconst obj = {a: 1, b: 2}\n\ndescribe('R.filter with array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = filter\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 1\n    }, list)\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = filter\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 1\n    })(list)\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.filter with objects', () =\u003e {\n  it('happy', () =\u003e {\n    const result = filter\u003cnumber\u003e((val, prop, origin) =\u003e {\n      val // $ExpectType number\n      prop // $ExpectType string\n      origin // $ExpectType Dictionary\u003cnumber\u003e\n\n      return val \u003e 1\n    }, obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('curried version requires second dummy type', () =\u003e {\n    const result = filter\u003cnumber, any\u003e((val, prop, origin) =\u003e {\n      val // $ExpectType number\n      prop // $ExpectType string\n      origin // $ExpectType Dictionary\u003cnumber\u003e\n\n      return val \u003e 1\n    })(obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#filter)\n\n### find\n\n```typescript\n\nfind\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): T | undefined\n```\n\nIt returns the first element of `list` that satisfy the `predicate`.\n\nIf there is no such element, it returns `undefined`.\n\n```javascript\nconst predicate = x =\u003e R.type(x.foo) === 'Number'\nconst list = [{foo: 'bar'}, {foo: 1}]\n\nconst result = R.find(predicate, list)\n// =\u003e {foo: 1}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfind\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): T | undefined;\nfind\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e T | undefined;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.find\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function find(predicate, list){\n  if (arguments.length === 1) return _list =\u003e find(predicate, _list)\n\n  let index = 0\n  const len = list.length\n\n  while (index \u003c len){\n    const x = list[ index ]\n    if (predicate(x)){\n      return x\n    }\n\n    index++\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { find } from './find.js'\nimport { propEq } from './propEq.js'\n\nconst list = [ { a : 1 }, { a : 2 }, { a : 3 } ]\n\ntest('happy', () =\u003e {\n  const fn = propEq(2, 'a')\n  expect(find(fn, list)).toEqual({ a : 2 })\n})\n\ntest('with curry', () =\u003e {\n  const fn = propEq(4, 'a')\n  expect(find(fn)(list)).toBeUndefined()\n})\n\ntest('with empty list', () =\u003e {\n  expect(find(() =\u003e true, [])).toBeUndefined()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {find} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.find', () =\u003e {\n  it('happy', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = find(predicate, list)\n    result // $ExpectType number | undefined\n  })\n  it('curried', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = find(predicate)(list)\n    result // $ExpectType number | undefined\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#find)\n\n### findIndex\n\n```typescript\n\nfindIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number\n```\n\nIt returns the index of the first element of `list` satisfying the `predicate` function.\n\nIf there is no such element, then `-1` is returned.\n\n```javascript\nconst predicate = x =\u003e R.type(x.foo) === 'Number'\nconst list = [{foo: 'bar'}, {foo: 1}]\n\nconst result = R.findIndex(predicate, list)\n// =\u003e 1\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfindIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number;\nfindIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.findIndex\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function findIndex(predicate, list){\n  if (arguments.length === 1) return _list =\u003e findIndex(predicate, _list)\n\n  const len = list.length\n  let index = -1\n\n  while (++index \u003c len){\n    if (predicate(list[ index ])){\n      return index\n    }\n  }\n\n  return -1\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { findIndex } from './findIndex.js'\nimport { propEq } from './propEq.js'\n\nconst list = [ { a : 1 }, { a : 2 }, { a : 3 } ]\n\ntest('happy', () =\u003e {\n  expect(findIndex(propEq(2, 'a'), list)).toBe(1)\n  expect(findIndex(propEq(1, 'a'))(list)).toBe(0)\n  expect(findIndex(propEq(4, 'a'))(list)).toBe(-1)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {findIndex} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.findIndex', () =\u003e {\n  it('happy', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findIndex(predicate, list)\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findIndex(predicate)(list)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#findIndex)\n\n### findLast\n\n```typescript\n\nfindLast\u003cT\u003e(fn: (x: T) =\u003e boolean, list: T[]): T | undefined\n```\n\nIt returns the last element of `list` satisfying the `predicate` function.\n\nIf there is no such element, then `undefined` is returned.\n\n```javascript\nconst predicate = x =\u003e R.type(x.foo) === 'Number'\nconst list = [{foo: 0}, {foo: 1}]\n\nconst result = R.findLast(predicate, list)\n// =\u003e {foo: 1}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfindLast\u003cT\u003e(fn: (x: T) =\u003e boolean, list: T[]): T | undefined;\nfindLast\u003cT\u003e(fn: (x: T) =\u003e boolean): (list: T[]) =\u003e T | undefined;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.findLast\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function findLast(predicate, list){\n  if (arguments.length === 1) return _list =\u003e findLast(predicate, _list)\n\n  let index = list.length\n\n  while (--index \u003e= 0){\n    if (predicate(list[ index ])){\n      return list[ index ]\n    }\n  }\n\n  return undefined\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { findLast } from './findLast.js'\n\ntest('happy', () =\u003e {\n  const result = findLast(x =\u003e x \u003e 1, [ 1, 1, 1, 2, 3, 4, 1 ])\n  expect(result).toBe(4)\n\n  expect(findLast(x =\u003e x === 0, [ 0, 1, 1, 2, 3, 4, 1 ])).toBe(0)\n})\n\ntest('with curry', () =\u003e {\n  expect(findLast(x =\u003e x \u003e 1)([ 1, 1, 1, 2, 3, 4, 1 ])).toBe(4)\n})\n\nconst obj1 = { x : 100 }\nconst obj2 = { x : 200 }\nconst a = [ 11, 10, 9, 'cow', obj1, 8, 7, 100, 200, 300, obj2, 4, 3, 2, 1, 0 ]\nconst even = function (x){\n  return x % 2 === 0\n}\nconst gt100 = function (x){\n  return x \u003e 100\n}\nconst isStr = function (x){\n  return typeof x === 'string'\n}\nconst xGt100 = function (o){\n  return o \u0026\u0026 o.x \u003e 100\n}\n\ntest('ramda 1', () =\u003e {\n  expect(findLast(even, a)).toBe(0)\n  expect(findLast(gt100, a)).toBe(300)\n  expect(findLast(isStr, a)).toBe('cow')\n  expect(findLast(xGt100, a)).toEqual(obj2)\n})\n\ntest('ramda 2', () =\u003e {\n  expect(findLast(even, [ 'zing' ])).toBeUndefined()\n})\n\ntest('ramda 3', () =\u003e {\n  expect(findLast(even, [ 2, 3, 5 ])).toBe(2)\n})\n\ntest('ramda 4', () =\u003e {\n  expect(findLast(even, [])).toBeUndefined()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {findLast} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.findLast', () =\u003e {\n  it('happy', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findLast(predicate, list)\n    result // $ExpectType number | undefined\n  })\n  it('curried', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findLast(predicate)(list)\n    result // $ExpectType number | undefined\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#findLast)\n\n### findLastIndex\n\n```typescript\n\nfindLastIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number\n```\n\nIt returns the index of the last element of `list` satisfying the `predicate` function.\n\nIf there is no such element, then `-1` is returned.\n\n```javascript\nconst predicate = x =\u003e R.type(x.foo) === 'Number'\nconst list = [{foo: 0}, {foo: 1}]\n\nconst result = R.findLastIndex(predicate, list)\n// =\u003e 1\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfindLastIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): number;\nfindLastIndex\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.findLastIndex\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function findLastIndex(fn, list){\n  if (arguments.length === 1) return _list =\u003e findLastIndex(fn, _list)\n\n  let index = list.length\n\n  while (--index \u003e= 0){\n    if (fn(list[ index ])){\n      return index\n    }\n  }\n\n  return -1\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { findLastIndex } from './findLastIndex.js'\n\ntest('happy', () =\u003e {\n  const result = findLastIndex(x =\u003e x \u003e 1, [ 1, 1, 1, 2, 3, 4, 1 ])\n\n  expect(result).toBe(5)\n\n  expect(findLastIndex(x =\u003e x === 0, [ 0, 1, 1, 2, 3, 4, 1 ])).toBe(0)\n})\n\ntest('with curry', () =\u003e {\n  expect(findLastIndex(x =\u003e x \u003e 1)([ 1, 1, 1, 2, 3, 4, 1 ])).toBe(5)\n})\n\nconst obj1 = { x : 100 }\nconst obj2 = { x : 200 }\nconst a = [ 11, 10, 9, 'cow', obj1, 8, 7, 100, 200, 300, obj2, 4, 3, 2, 1, 0 ]\nconst even = function (x){\n  return x % 2 === 0\n}\nconst gt100 = function (x){\n  return x \u003e 100\n}\nconst isStr = function (x){\n  return typeof x === 'string'\n}\nconst xGt100 = function (o){\n  return o \u0026\u0026 o.x \u003e 100\n}\n\ntest('ramda 1', () =\u003e {\n  expect(findLastIndex(even, a)).toBe(15)\n  expect(findLastIndex(gt100, a)).toBe(9)\n  expect(findLastIndex(isStr, a)).toBe(3)\n  expect(findLastIndex(xGt100, a)).toBe(10)\n})\n\ntest('ramda 2', () =\u003e {\n  expect(findLastIndex(even, [ 'zing' ])).toBe(-1)\n})\n\ntest('ramda 3', () =\u003e {\n  expect(findLastIndex(even, [ 2, 3, 5 ])).toBe(0)\n})\n\ntest('ramda 4', () =\u003e {\n  expect(findLastIndex(even, [])).toBe(-1)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {findLastIndex} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.findLastIndex', () =\u003e {\n  it('happy', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findLastIndex(predicate, list)\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const predicate = (x: number) =\u003e x \u003e 2\n    const result = findLastIndex(predicate)(list)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#findLastIndex)\n\n### flatten\n\n```typescript\n\nflatten\u003cT\u003e(list: any[]): T[]\n```\n\nIt deeply flattens an array.\n\n```javascript\nconst result = R.flatten([\n  1, \n  2, \n  [3, 30, [300]], \n  [4]\n])\n// =\u003e [ 1, 2, 3, 30, 300, 4 ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nflatten\u003cT\u003e(list: any[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.flatten\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function flatten(list, input){\n  const willReturn = input === undefined ? [] : input\n\n  for (let i = 0; i \u003c list.length; i++){\n    if (isArray(list[ i ])){\n      flatten(list[ i ], willReturn)\n    } else {\n      willReturn.push(list[ i ])\n    }\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { flatten } from './flatten.js'\n\ntest('happy', () =\u003e {\n  expect(flatten([ 1, 2, 3, [ [ [ [ [ 4 ] ] ] ] ] ])).toEqual([ 1, 2, 3, 4 ])\n\n  expect(flatten([ 1, [ 2, [ [ 3 ] ] ], [ 4 ] ])).toEqual([ 1, 2, 3, 4 ])\n\n  expect(flatten([ 1, [ 2, [ [ [ 3 ] ] ] ], [ 4 ] ])).toEqual([ 1, 2, 3, 4 ])\n\n  expect(flatten([ 1, 2, [ 3, 4 ], 5, [ 6, [ 7, 8, [ 9, [ 10, 11 ], 12 ] ] ] ])).toEqual([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ])\n})\n\ntest('readme example', () =\u003e {\n  const result = flatten([ 1, 2, [ 3, 30, [ 300 ] ], [ 4 ] ])\n  expect(result).toEqual([ 1, 2, 3, 30, 300, 4 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {flatten} from 'rambda'\n\ndescribe('flatten', () =\u003e {\n  it('happy', () =\u003e {\n    const result = flatten\u003cnumber\u003e([1, 2, [3, [4]]])\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#flatten)\n\n### flip\n\n```typescript\n\nflip\u003cT, U, TResult\u003e(fn: (arg0: T, arg1: U) =\u003e TResult): (arg1: U, arg0?: T) =\u003e TResult\n```\n\nIt returns function which calls `fn` with exchanged first and second argument.\n\n\u003e :boom: Rambda's **flip** will throw if the arity of the input function is greater or equal to 5.\n\n```javascript\nconst subtractFlip = R.flip(R.subtract)\n\nconst result = [\n  subtractFlip(1,7),\n  R.subtract(1, 6)\n]  \n// =\u003e [6, -6]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nflip\u003cT, U, TResult\u003e(fn: (arg0: T, arg1: U) =\u003e TResult): (arg1: U, arg0?: T) =\u003e TResult;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.flip\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nfunction flipFn(fn){\n  return (...input) =\u003e {\n    if (input.length === 1){\n      return holder =\u003e fn(holder, input[ 0 ])\n    } else if (input.length === 2){\n      return fn(input[ 1 ], input[ 0 ])\n    } else if (input.length === 3){\n      return fn(\n        input[ 1 ], input[ 0 ], input[ 2 ]\n      )\n    } else if (input.length === 4){\n      return fn(\n        input[ 1 ], input[ 0 ], input[ 2 ], input[ 3 ]\n      )\n    }\n\n    throw new Error('R.flip doesn\\'t work with arity \u003e 4')\n  }\n}\n\nexport function flip(fn){\n  return flipFn(fn)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { flip } from './flip.js'\nimport { subtract } from './subtract.js'\nimport { update } from './update.js'\n\ntest('function with arity of 2', () =\u003e {\n  const subtractFlipped = flip(subtract)\n\n  expect(subtractFlipped(1)(7)).toBe(6)\n  expect(subtractFlipped(1, 7)).toBe(6)\n  expect(subtractFlipped(\n    1, 7, 9\n  )).toBe(6)\n})\n\ntest('function with arity of 3', () =\u003e {\n  const updateFlipped = flip(update)\n\n  const result = updateFlipped(\n    88, 0, [ 1, 2, 3 ]\n  )\n  const curriedResult = updateFlipped(88, 0)([ 1, 2, 3 ])\n  const tripleCurriedResult = updateFlipped(88)(0)([ 1, 2, 3 ])\n  expect(result).toEqual([ 88, 2, 3 ])\n  expect(curriedResult).toEqual([ 88, 2, 3 ])\n  expect(tripleCurriedResult).toEqual([ 88, 2, 3 ])\n})\n\ntest('function with arity of 4', () =\u003e {\n  const testFunction = (\n    a, b, c, d\n  ) =\u003e `${ a - b }==${ c - d }`\n  const testFunctionFlipped = flip(testFunction)\n\n  const result = testFunction(\n    1, 2, 3, 4\n  )\n  const flippedResult = testFunctionFlipped(\n    2, 1, 3, 4\n  )\n  expect(result).toEqual(flippedResult)\n  expect(result).toBe('-1==-1')\n})\n\ntest('function with arity of 5', () =\u003e {\n  const testFunction = (\n    a, b, c, d, e\n  ) =\u003e `${ a - b }==${ c - d - e }`\n  const testFunctionFlipped = flip(testFunction)\n\n  expect(() =\u003e\n    testFunctionFlipped(\n      1, 2, 3, 4, 5\n    )).toThrowErrorMatchingInlineSnapshot('\"R.flip doesn\\'t work with arity \u003e 4\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport * as R from 'ramda'\nimport {flip, subtract} from 'rambda'\n\ndescribe('R.flip', () =\u003e {\n  it('function with arity of 2', () =\u003e {\n    const subtractFlipped = flip(subtract)\n    const result = subtractFlipped(1, 7)\n    const curriedResult = subtractFlipped(1)(7)\n    curriedResult // $ExpectType number\n\n    // This is wrong\n    // ============================================\n    result // $ExpectType (y: number) =\u003e number\n  })\n})\n\ndescribe('Ramda.flip', () =\u003e {\n  it('function with arity of 2', () =\u003e {\n    const subtractFlipped = R.flip(R.subtract)\n    const result = subtractFlipped(1, 7)\n    const curriedResult = subtractFlipped(1)(7)\n    result // $ExpectType number\n    curriedResult // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#flip)\n\n### forEach\n\n```typescript\n\nforEach\u003cT\u003e(fn: Iterator\u003cT, void\u003e, list: T[]): T[]\n```\n\nIt applies `iterable` function over all members of `list` and returns `list`.\n\n\u003e :boom: It works with objects, unlike `Ramda`.\n\n```javascript\nconst sideEffect = {}\nconst result = R.forEach(\n  x =\u003e sideEffect[`foo${x}`] = x\n)([1, 2])\n\nsideEffect // =\u003e {foo1: 1, foo2: 2}\nresult // =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nforEach\u003cT\u003e(fn: Iterator\u003cT, void\u003e, list: T[]): T[];\nforEach\u003cT\u003e(fn: Iterator\u003cT, void\u003e): (list: T[]) =\u003e T[];\nforEach\u003cT\u003e(fn: ObjectIterator\u003cT, void\u003e, list: Dictionary\u003cT\u003e): Dictionary\u003cT\u003e;\nforEach\u003cT, U\u003e(fn: ObjectIterator\u003cT, void\u003e): (list: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.forEach\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { forEachObjIndexedFn } from './forEachObjIndexed.js'\n\nexport function forEach(fn, iterable){\n  if (arguments.length === 1) return _list =\u003e forEach(fn, _list)\n  if (iterable === undefined) return\n\n  if (isArray(iterable)){\n    let index = 0\n    const len = iterable.length\n\n    while (index \u003c len){\n      fn(iterable[ index ])\n      index++\n    }\n  } else return forEachObjIndexedFn(fn, iterable)\n\n  return iterable\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { forEach } from './forEach.js'\nimport { type } from './type.js'\n\ntest('happy', () =\u003e {\n  const sideEffect = {}\n  forEach(x =\u003e sideEffect[ `foo${ x }` ] = x + 10)([ 1, 2 ])\n\n  expect(sideEffect).toEqual({\n    foo1 : 11,\n    foo2 : 12,\n  })\n})\n\ntest('iterate over object', () =\u003e {\n  const obj = {\n    a : 1,\n    b : [ 1, 2 ],\n    c : { d : 7 },\n    f : 'foo',\n  }\n  const result = {}\n  const returned = forEach((\n    val, prop, inputObj\n  ) =\u003e {\n    expect(type(inputObj)).toBe('Object')\n    result[ prop ] = `${ prop }-${ type(val) }`\n  })(obj)\n\n  const expected = {\n    a : 'a-Number',\n    b : 'b-Array',\n    c : 'c-Object',\n    f : 'f-String',\n  }\n\n  expect(result).toEqual(expected)\n  expect(returned).toEqual(obj)\n})\n\ntest('with empty list', () =\u003e {\n  const list = []\n  const result = forEach(x =\u003e x * x)(list)\n\n  expect(result).toEqual(list)\n})\n\ntest('with wrong input', () =\u003e {\n  const list = undefined\n  const result = forEach(x =\u003e x * x)(list)\n\n  expect(result).toBeUndefined()\n})\n\ntest('returns the input', () =\u003e {\n  const list = [ 1, 2, 3 ]\n  const result = forEach(x =\u003e x * x)(list)\n\n  expect(result).toEqual(list)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {forEach} from 'rambda'\n\nconst list = [1, 2, 3]\nconst obj = {a: 1, b: 2}\n\ndescribe('R.forEach with arrays', () =\u003e {\n  it('happy', () =\u003e {\n    const result = forEach(a =\u003e {\n      a // $ExpectType number\n    }, list)\n    result // $ExpectType number[]\n  })\n  it('curried require an explicit typing', () =\u003e {\n    const result = forEach\u003cnumber\u003e(a =\u003e {\n      a // $ExpectType number\n    })(list)\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.forEach with objects', () =\u003e {\n  it('happy', () =\u003e {\n    const result = forEach((a, b, c) =\u003e {\n      a // $ExpectType number\n      b // $ExpectType string\n      c // $ExpectType Dictionary\u003cnumber\u003e\n      return `${a}`\n    }, obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('curried require an input typing and a dummy third typing', () =\u003e {\n    // Required in order all typings to work\n    const result = forEach\u003cnumber, any\u003e((a, b, c) =\u003e {\n      a // $ExpectType number\n      b // $ExpectType string\n      c // $ExpectType Dictionary\u003cnumber\u003e\n    })(obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('iterator without property', () =\u003e {\n    const result = forEach(a =\u003e {\n      a // $ExpectType number\n    }, obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#forEach)\n\n### forEachObjIndexed\n\n```typescript\n\nforEachObjIndexed\u003cT\u003e(fn: (value: T[keyof T], key: keyof T, obj: T) =\u003e void, obj: T): T\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nforEachObjIndexed\u003cT\u003e(fn: (value: T[keyof T], key: keyof T, obj: T) =\u003e void, obj: T): T;\nforEachObjIndexed\u003cT\u003e(fn: (value: T[keyof T], key: keyof T, obj: T) =\u003e void): (obj: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.forEachObjIndexed\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { keys } from './_internals/keys.js'\n\nexport function forEachObjIndexedFn(fn, obj){\n  let index = 0\n  const listKeys = keys(obj)\n  const len = listKeys.length\n\n  while (index \u003c len){\n    const key = listKeys[ index ]\n    fn(\n      obj[ key ], key, obj\n    )\n    index++\n  }\n\n  return obj\n}\n\nexport function forEachObjIndexed(fn, list){\n  if (arguments.length === 1) return _list =\u003e forEachObjIndexed(fn, _list)\n  if (list === undefined) return\n\n  return forEachObjIndexedFn(fn, list)\n}\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#forEachObjIndexed)\n\n### fromPairs\n\n```typescript\n\nfromPairs\u003cV\u003e(listOfPairs: ([number, V])[]): { [index: number]: V }\n```\n\nIt transforms a `listOfPairs` to an object.\n\n```javascript\nconst listOfPairs = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]\nconst expected = {\n  a : 1,\n  b : 2,\n  c : [ 3, 4 ],\n}\n\nconst result = R.fromPairs(listOfPairs)\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nfromPairs\u003cV\u003e(listOfPairs: ([number, V])[]): { [index: number]: V };\nfromPairs\u003cV\u003e(listOfPairs: ([string, V])[]): { [index: string]: V };\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.fromPairs\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function fromPairs(listOfPairs){\n  const toReturn = {}\n  listOfPairs.forEach(([ prop, value ]) =\u003e toReturn[ prop ] = value)\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { fromPairs } from './fromPairs.js'\n\nconst list = [\n  [ 'a', 1 ],\n  [ 'b', 2 ],\n  [ 'c', [ 3, 4 ] ],\n]\nconst expected = {\n  a : 1,\n  b : 2,\n  c : [ 3, 4 ],\n}\n\ntest('happy', () =\u003e {\n  expect(fromPairs(list)).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {fromPairs} from 'rambda'\n\ndescribe('R.fromPairs - require explicit type for input list', () =\u003e {\n  it('with string index', () =\u003e {\n    const list: [string, number][] = [\n      ['a', 1],\n      ['b', 2],\n      ['c', 3],\n    ]\n    const result = fromPairs(list)\n\n    result // $ExpectType { [index: string]: number; }\n  })\n  it('with number index', () =\u003e {\n    const list: [number, string][] = [\n      [10, 'foo'],\n      [20, 'bar'],\n      [30, 'baz'],\n    ]\n    const result = fromPairs(list)\n\n    result // $ExpectType { [index: number]: string; }\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#fromPairs)\n\n### groupBy\n\n```typescript\n\ngroupBy\u003cT, K extends string = string\u003e(fn: (a: T) =\u003e K): (list: T[]) =\u003e Partial\u003cRecord\u003cK, T[]\u003e\u003e\n```\n\nIt splits `list` according to a provided `groupFn` function and returns an object.\n\n```javascript\nconst list = [ 'a', 'b', 'aa', 'bb' ]\nconst groupFn = x =\u003e x.length\n\nconst result = R.groupBy(groupFn, list)\n// =\u003e { '1': ['a', 'b'], '2': ['aa', 'bb'] }\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ngroupBy\u003cT, K extends string = string\u003e(fn: (a: T) =\u003e K): (list: T[]) =\u003e Partial\u003cRecord\u003cK, T[]\u003e\u003e;\ngroupBy\u003cT, K extends string = string\u003e(fn: (a: T) =\u003e K, list: T[]): Partial\u003cRecord\u003cK, T[]\u003e\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.groupBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function groupBy(groupFn, list){\n  if (arguments.length === 1) return _list =\u003e groupBy(groupFn, _list)\n\n  const result = {}\n  for (let i = 0; i \u003c list.length; i++){\n    const item = list[ i ]\n    const key = groupFn(item)\n\n    if (!result[ key ]){\n      result[ key ] = []\n    }\n\n    result[ key ].push(item)\n  }\n\n  return result\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { groupBy } from './groupBy.js'\nimport { prop } from './prop.js'\n\ntest('groupBy', () =\u003e {\n  const list = [\n    {\n      age  : 12,\n      name : 'john',\n    },\n    {\n      age  : 12,\n      name : 'jack',\n    },\n    {\n      age  : 24,\n      name : 'mary',\n    },\n    {\n      age  : 24,\n      name : 'steve',\n    },\n  ]\n  const expectedResult = {\n    12 : [\n      {\n        age  : 12,\n        name : 'john',\n      },\n      {\n        age  : 12,\n        name : 'jack',\n      },\n    ],\n    24 : [\n      {\n        age  : 24,\n        name : 'mary',\n      },\n      {\n        age  : 24,\n        name : 'steve',\n      },\n    ],\n  }\n\n  expect(groupBy(prop('age'))(list)).toEqual(expectedResult)\n  expect(groupBy(prop('age'), list)).toEqual(expectedResult)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport { groupBy, prop } from 'rambda';\n\ninterface Thing {\n\tname: string;\n\tposition: string;\n}\n\nconst things = [\n\t{ name: 'one', position: 'left' },\n\t{ name: 'two', position: 'left' },\n\t{ name: 'three', position: 'right' },\n\t{ name: 'four', position: 'right' },\n];\n\ndescribe('R.groupBy', () =\u003e {\n\tit('happy', () =\u003e {\n\t\tconst groupByFn = (x: string) =\u003e String(x.length);\n\t\tconst list = ['foo', 'bar'];\n\n\t\tconst result = groupBy(groupByFn, list);\n\t\tresult; // $ExpectType Partial\u003cRecord\u003cstring, string[]\u003e\u003e\n\n\t\tconst curriedResult = groupBy(groupByFn)(list);\n\t\tcurriedResult; // $ExpectType Partial\u003cRecord\u003cstring, string[]\u003e\u003e\n\t});\n\tit('with one explicit types', () =\u003e {\n\t\tconst groupByPosition = groupBy\u003cThing\u003e(prop('position'));\n\n\t\tconst result = groupByPosition(things);\n\t\tresult; // $ExpectType Partial\u003cRecord\u003cstring, Thing[]\u003e\u003e\n\t\tresult[9]; // $ExpectType Thing[] | undefined\n\t\tresult.foo; // $ExpectType Thing[] | undefined\n\t});\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#groupBy)\n\n### groupWith\n\n```typescript\n\ngroupWith\u003cT\u003e(compareFn: (x: T, y: T) =\u003e boolean): (input: T[]) =\u003e (T[])[]\n```\n\nIt returns separated version of list or string `input`, where separation is done with equality `compareFn` function.\n\n```javascript\nconst isConsecutive = (x, y) =\u003e x === y\nconst list = [1, 2, 2, 1, 1, 2]\n\nconst result = R.groupWith(isConsecutive, list)\n// =\u003e [[1], [2,2], [1,1], [2]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ngroupWith\u003cT\u003e(compareFn: (x: T, y: T) =\u003e boolean): (input: T[]) =\u003e (T[])[];\ngroupWith\u003cT\u003e(compareFn: (x: T, y: T) =\u003e boolean, input: T[]): (T[])[];\ngroupWith\u003cT\u003e(compareFn: (x: T, y: T) =\u003e boolean, input: string): string[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.groupWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { isArray } from './_internals/isArray.js'\n\nexport function groupWith(compareFn, list){\n  if (!isArray(list)) throw new TypeError('list.reduce is not a function')\n\n  const clone = cloneList(list)\n\n  if (list.length === 1) return [ clone ]\n\n  const toReturn = []\n  let holder = []\n\n  clone.reduce((\n    prev, current, i\n  ) =\u003e {\n    if (i === 0) return current\n\n    const okCompare = compareFn(prev, current)\n    const holderIsEmpty = holder.length === 0\n    const lastCall = i === list.length - 1\n\n    if (okCompare){\n      if (holderIsEmpty) holder.push(prev)\n      holder.push(current)\n      if (lastCall) toReturn.push(holder)\n\n      return current\n    }\n\n    if (holderIsEmpty){\n      toReturn.push([ prev ])\n      if (lastCall) toReturn.push([ current ])\n\n      return current\n    }\n\n    toReturn.push(holder)\n    if (lastCall) toReturn.push([ current ])\n    holder = []\n\n    return current\n  }, undefined)\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { groupWith } from './groupWith.js'\n\ntest('issue is fixed', () =\u003e {\n  const result = groupWith(equals, [ 1, 2, 2, 3 ])\n  const expected = [ [ 1 ], [ 2, 2 ], [ 3 ] ]\n  expect(result).toEqual(expected)\n})\n\ntest('long list', () =\u003e {\n  const result = groupWith(equals,\n    [ 0, 1, 1, 2, 3, 5, 8, 13, 21, 21, 21, 1, 2 ])\n\n  const expected = [\n    [ 0 ],\n    [ 1, 1 ],\n    [ 2 ],\n    [ 3 ],\n    [ 5 ],\n    [ 8 ],\n    [ 13 ],\n    [ 21, 21, 21 ],\n    [ 1 ],\n    [ 2 ],\n  ]\n  expect(result).toEqual(expected)\n})\n\ntest('readme example', () =\u003e {\n  const list = [ 4, 3, 6, 2, 2, 1 ]\n\n  const result = groupWith((a, b) =\u003e a - b === 1, list)\n  const expected = [ [ 4, 3 ], [ 6 ], [ 2 ], [ 2, 1 ] ]\n  expect(result).toEqual(expected)\n})\n\ntest('throw with string as input', () =\u003e {\n  expect(() =\u003e\n    groupWith(equals, 'Mississippi')).toThrowErrorMatchingInlineSnapshot('\"list.reduce is not a function\"')\n})\n\nconst isConsecutive = function (a, b){\n  return a + 1 === b\n}\n\ntest('fix coverage', () =\u003e {\n  expect(groupWith(isConsecutive, [ 1, 2, 3, 0 ])).toEqual([ [ 1, 2, 3 ], [ 0 ] ])\n})\n\ntest('from ramda 0', () =\u003e {\n  expect(groupWith(equals, [])).toEqual([])\n  expect(groupWith(isConsecutive, [])).toEqual([])\n})\n\ntest('from ramda 1', () =\u003e {\n  expect(groupWith(isConsecutive, [ 4, 3, 2, 1 ])).toEqual([\n    [ 4 ],\n    [ 3 ],\n    [ 2 ],\n    [ 1 ],\n  ])\n})\n\ntest('from ramda 2', () =\u003e {\n  expect(groupWith(isConsecutive, [ 1, 2, 3, 4 ])).toEqual([ [ 1, 2, 3, 4 ] ])\n})\n\ntest('from ramda 3', () =\u003e {\n  expect(groupWith(isConsecutive, [ 1, 2, 2, 3 ])).toEqual([\n    [ 1, 2 ],\n    [ 2, 3 ],\n  ])\n  expect(groupWith(isConsecutive, [ 1, 2, 9, 3, 4 ])).toEqual([\n    [ 1, 2 ],\n    [ 9 ],\n    [ 3, 4 ],\n  ])\n})\n\ntest('list with single item', () =\u003e {\n  const result = groupWith(equals, [ 0 ])\n\n  const expected = [ [ 0 ] ]\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {groupWith} from 'rambda'\n\ndescribe('R.groupWith', () =\u003e {\n  it('happy', () =\u003e {\n    const groupWithFn = (x: string, y: string) =\u003e x.length === y.length\n    const list = ['foo', 'bar', 'bazzz']\n\n    const result = groupWith(groupWithFn, list)\n    const curriedResult = groupWith(groupWithFn)(list)\n    result // $ExpectType string[][]\n    curriedResult // $ExpectType string[][]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#groupWith)\n\n### gt\n\n```typescript\n\ngt\u003cT, U\u003e(x: T, y: U): boolean\n```\n\n```javascript\nconst result = [R.gt(2, 1), R.gt(2, 3)]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ngt\u003cT, U\u003e(x: T, y: U): boolean;\ngt\u003cT, U\u003e(x: T): (y: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.gt\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function gt(a, b){\n  if (arguments.length === 1)\n    return _b =\u003e gt(a, _b)\n\n  return a \u003e b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {gt} from 'rambda'\n\ndescribe('R.gt', () =\u003e {\n  it('happy', () =\u003e {\n    const result = gt(1, 2)\n    const curriedResult = gt(2)(3)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#gt)\n\n### gte\n\n```typescript\n\ngte\u003cT, U\u003e(x: T, y: U): boolean\n```\n\n```javascript\nconst result = [R.gte(2, 1), R.gte(2, 2), R.gte(2, 3)]\n// =\u003e [true, true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ngte\u003cT, U\u003e(x: T, y: U): boolean;\ngte\u003cT, U\u003e(x: T): (y: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.gte\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function gte(a, b){\n  if (arguments.length === 1)\n    return _b =\u003e gte(a, _b)\n\n  return a \u003e= b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {gte} from 'rambda'\n\ndescribe('R.gte', () =\u003e {\n  it('happy', () =\u003e {\n    const result = gte(1, 2)\n    const curriedResult = gte(2)(3)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#gte)\n\n### has\n\n```typescript\n\nhas\u003cT\u003e(prop: string, obj: T): boolean\n```\n\nIt returns `true` if `obj` has property `prop`.\n\n```javascript\nconst obj = {a: 1}\n\nconst result = [\n  R.has('a', Record\u003cstring, unknown\u003e),\n  R.has('b', Record\u003cstring, unknown\u003e)\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nhas\u003cT\u003e(prop: string, obj: T): boolean;\nhas(prop: string): \u003cT\u003e(obj: T) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.has\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function has(prop, obj){\n  if (arguments.length === 1) return _obj =\u003e has(prop, _obj)\n\n  if (!obj) return false\n\n  return obj.hasOwnProperty(prop)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { has } from './has.js'\n\ntest('happy', () =\u003e {\n  expect(has('a')({ a : 1 })).toBeTrue()\n  expect(has('b', { a : 1 })).toBeFalse()\n})\n\ntest('with non-object', () =\u003e {\n  expect(has('a', undefined)).toBeFalse()\n  expect(has('a', null)).toBeFalse()\n  expect(has('a', true)).toBeFalse()\n  expect(has('a', '')).toBeFalse()\n  expect(has('a', /a/)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {has} from 'rambda'\n\ndescribe('R.has', () =\u003e {\n  it('happy', () =\u003e {\n    const result = has('foo', {a: 1})\n    const curriedResult = has('bar')({a: 1})\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#has)\n\n### hasIn\n\n```typescript\n\nhasIn(searchProperty: string): \u003cT\u003e(obj: T) =\u003e boolean\n```\n\n```javascript\nconst result = R.hasIn('a', {a: 1})\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nhasIn(searchProperty: string): \u003cT\u003e(obj: T) =\u003e boolean;\nhasIn\u003cT\u003e(searchProperty: string, obj: T): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.hasIn\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { propFn } from './prop.js';\n\nexport function hasIn(searchProperty, obj) {\n\tif (arguments.length === 1) {\n\t\treturn (_obj) =\u003e hasIn(searchProperty, _obj);\n\t}\n\n\treturn propFn(searchProperty, obj) !== undefined;\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { hasIn as hasInRamda } from 'ramda'\n\nimport { hasIn } from './hasIn.js'\n\nconst fred = {\n  age  : 23,\n  name : 'Fred',\n}\nconst anon = { age : 99 }\n\ntest('returns a function that checks the appropriate property', () =\u003e {\n  const nm = hasIn('name')\n  expect(typeof nm).toBe('function')\n  expect(nm(fred)).toBe(true)\n  expect(nm(anon)).toBe(false)\n})\n\ntest('checks properties from the prototype chain', () =\u003e {\n  function Person(){}\n  Person.prototype.age = function (){}\n\n  const bob = new Person()\n  expect(hasIn('age', bob)).toBe(true)\n})\n\ntest('works properly when called with two arguments', () =\u003e {\n  expect(hasIn('name', fred)).toBe(true)\n  expect(hasIn('name', anon)).toBe(false)\n})\n\ntest('returns false when non-existent object', () =\u003e {\n  expect(hasIn('name', null)).toBe(false)\n  expect(hasIn('name', undefined)).toBe(false)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#hasIn)\n\n### hasPath\n\n```typescript\n\nhasPath\u003cT\u003e(\n  path: string | string[],\n  input: object\n): boolean\n```\n\nIt will return true, if `input` object has truthy `path`(calculated with `R.path`).\n\n```javascript\nconst path = 'a.b'\nconst pathAsArray = ['a', 'b']\nconst obj = {a: {b: []}}\n\nconst result = [\n  R.hasPath(path, Record\u003cstring, unknown\u003e),\n  R.hasPath(pathAsArray, Record\u003cstring, unknown\u003e),\n  R.hasPath('a.c', Record\u003cstring, unknown\u003e),\n]\n// =\u003e [true, true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nhasPath\u003cT\u003e(\n  path: string | string[],\n  input: object\n): boolean;\nhasPath\u003cT\u003e(\n  path: string | string[]\n): (input: object) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.hasPath\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { path } from './path.js'\n\nexport function hasPath(pathInput, obj){\n  if (arguments.length === 1){\n    return objHolder =\u003e hasPath(pathInput, objHolder)\n  }\n\n  return path(pathInput, obj) !== undefined\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { hasPath } from './hasPath.js'\n\ntest('when true', () =\u003e {\n  const path = 'a.b'\n  const obj = { a : { b : [] } }\n\n  const result = hasPath(path)(obj)\n  const expectedResult = true\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('when false', () =\u003e {\n  const path = 'a.b'\n  const obj = {}\n\n  const result = hasPath(path, obj)\n  const expectedResult = false\n\n  expect(result).toEqual(expectedResult)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {hasPath} from 'rambda'\n\ndescribe('R.hasPath', () =\u003e {\n  it('string path', () =\u003e {\n    const obj = {a: {b: 1}}\n    const result = hasPath('a.b', obj)\n    const curriedResult = hasPath('a.c')(obj)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n  it('array path', () =\u003e {\n    const obj = {a: {b: 1}}\n    const result = hasPath(['a', 'b'], obj)\n    const curriedResult = hasPath(['a', 'c'])(obj)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#hasPath)\n\n### head\n\n```typescript\n\nhead(str: string): string\n```\n\nIt returns the first element of list or string `input`. It returns `undefined` if array has length of 0.\n\n```javascript\nconst result = [\n  R.head([1, 2, 3]),\n  R.head('foo') \n]\n// =\u003e [1, 'f']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nhead(str: string): string;\nhead(str: ''): undefined;\nhead(list: readonly[]): undefined;\nhead\u003cT\u003e(list: never[]): undefined;\nhead\u003cT extends unknown[]\u003e(array: T): FirstArrayElement\u003cT\u003e\nhead\u003cT extends readonly unknown[]\u003e(array: T): FirstArrayElement\u003cT\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.head\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function head(listOrString){\n  if (typeof listOrString === 'string') return listOrString[ 0 ] || ''\n\n  return listOrString[ 0 ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { head } from './head.js'\n\ntest('head', () =\u003e {\n  expect(head([ 'fi', 'fo', 'fum' ])).toBe('fi')\n  expect(head([])).toBeUndefined()\n  expect(head('foo')).toBe('f')\n  expect(head('')).toBe('')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {\n  emptyList,\n  emptyString,\n  mixedList,\n  mixedListConst,\n  numberList,\n  numberListConst,\n  string,\n} from '_internals/typescriptTestUtils'\nimport {head, last} from 'rambda'\n\ndescribe('R.head', () =\u003e {\n  it('string', () =\u003e {\n    head(string) // $ExpectType string\n    last(string) // $ExpectType string\n  })\n  it('empty string', () =\u003e {\n    head(emptyString) // $ExpectType undefined\n    last(emptyString) // $ExpectType undefined\n  })\n  it('array', () =\u003e {\n    head(numberList) // $ExpectType number\n    head(numberListConst) // $ExpectType 1\n\n    last(numberList) // $ExpectType number\n    last(numberListConst) // $ExpectType 3\n  })\n  it('empty array', () =\u003e {\n    const list = [] as const\n    head(emptyList) // $ExpectType undefined\n    head(list) // $ExpectType undefined\n    last(emptyList) // $ExpectType undefined\n    last(list) // $ExpectType undefined\n  })\n\n  it('mixed', () =\u003e {\n    head(mixedList) // $ExpectType string | number\n    head(mixedListConst) // $ExpectType 1\n    last(mixedList) // $ExpectType string | number\n    last(mixedListConst) // $ExpectType \"bar\"\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#head)\n\n### identical\n\n```typescript\n\nidentical\u003cT\u003e(x: T, y: T): boolean\n```\n\nIt returns `true` if its arguments `a` and `b` are identical.\n\nOtherwise, it returns `false`.\n\n\u003e :boom: Values are identical if they reference the same memory. `NaN` is identical to `NaN`; `0` and `-0` are not identical.\n\n```javascript\nconst objA = {a: 1};\nconst objB = {a: 1};\nR.identical(objA, objA); // =\u003e true\nR.identical(objA, objB); // =\u003e false\nR.identical(1, 1); // =\u003e true\nR.identical(1, '1'); // =\u003e false\nR.identical([], []); // =\u003e false\nR.identical(0, -0); // =\u003e false\nR.identical(NaN, NaN); // =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nidentical\u003cT\u003e(x: T, y: T): boolean;\nidentical\u003cT\u003e(x: T): (y: T) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.identical\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { objectIs } from './_internals/objectIs.js'\n\nexport function identical(a, b){\n  if (arguments.length === 1) return _b =\u003e identical(a, _b)\n\n  return objectIs(a, b)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { F, T } from '../rambda.js'\nimport { identical } from './identical.js'\n\ntest('r.F and R.T', () =\u003e {\n  expect(F()).toBeFalse()\n  expect(T()).toBeTrue()\n})\n\ntest('identical', () =\u003e {\n  const a = { a : 1 }\n  const b = { a : 1 }\n  const c = {\n    a : 1,\n    b : 2,\n  }\n\n  expect(identical(100)(100)).toBeTrue()\n  expect(identical(100, '100')).toBeFalse()\n  expect(identical('string', 'string')).toBeTrue()\n  expect(identical([], [])).toBeFalse()\n  expect(identical(a, a)).toBeTrue()\n  expect(identical(a, b)).toBeFalse()\n  expect(identical(a, c)).toBeFalse()\n  expect(identical(undefined, undefined)).toBeTrue()\n  expect(identical(null, undefined)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {identical} from 'rambda'\n\ndescribe('R.identical', () =\u003e {\n  it('happy', () =\u003e {\n    const result = identical(4, 1)\n    const curriedResult = identical(4)(1)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n  it('with object', () =\u003e {\n    const result = identical({a: 1}, {b: 2})\n    result // $ExpectType boolean\n    identical({a: 1}, {b: 2})\n\n    // @ts-expect-error\n    identical({a: 1})({b: 2})\n  })\n  it('with object - explicit type', () =\u003e {\n    interface Foo {\n      a: number,\n    }\n    identical\u003cFoo\u003e({a: 1}, {a: 2})\n    // @ts-expect-error\n    identical\u003cFoo\u003e({a: 1}, {b: 2})\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#identical)\n\n### identity\n\n```typescript\n\nidentity\u003cT\u003e(input: T): T\n```\n\nIt just passes back the supplied `input` argument.\n\n\u003e :boom: Logic\n\n```javascript\nR.identity(7) // =\u003e 7\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nidentity\u003cT\u003e(input: T): T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.identity\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function identity(x){\n  return x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { identity } from './identity.js'\n\ntest('happy', () =\u003e {\n  expect(identity(7)).toBe(7)\n  expect(identity(true)).toBeTrue()\n  expect(identity({ a : 1 })).toEqual({ a : 1 })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {identity} from 'rambda'\n\ndescribe('R.identity', () =\u003e {\n  it('happy', () =\u003e {\n    const result = identity(4)\n    result // $ExpectType 4\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#identity)\n\n### ifElse\n\n```typescript\n\nifElse\u003cT, TFiltered extends T, TOnTrueResult, TOnFalseResult\u003e(\n  pred: (a: T) =\u003e a is TFiltered,\n  onTrue: (a: TFiltered) =\u003e TOnTrueResult,\n  onFalse: (a: Exclude\u003cT, TFiltered\u003e) =\u003e TOnFalseResult,\n): (a: T) =\u003e TOnTrueResult | TOnFalseResult\n```\n\nIt expects `condition`, `onTrue` and `onFalse` functions as inputs and it returns a new function with example name of `fn`. \n\nWhen `fn`` is called with `input` argument, it will return either `onTrue(input)` or `onFalse(input)` depending on `condition(input)` evaluation.\n\n```javascript\nconst fn = R.ifElse(\n x =\u003e x\u003e10,\n x =\u003e x*2,\n x =\u003e x*10\n)\n\nconst result = [ fn(8), fn(18) ]\n// =\u003e [80, 36]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nifElse\u003cT, TFiltered extends T, TOnTrueResult, TOnFalseResult\u003e(\n  pred: (a: T) =\u003e a is TFiltered,\n  onTrue: (a: TFiltered) =\u003e TOnTrueResult,\n  onFalse: (a: Exclude\u003cT, TFiltered\u003e) =\u003e TOnFalseResult,\n): (a: T) =\u003e TOnTrueResult | TOnFalseResult;\nifElse\u003cTArgs extends any[], TOnTrueResult, TOnFalseResult\u003e(fn: (...args: TArgs) =\u003e boolean, onTrue: (...args: TArgs) =\u003e TOnTrueResult, onFalse: (...args: TArgs) =\u003e TOnFalseResult): (...args: TArgs) =\u003e TOnTrueResult | TOnFalseResult;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.ifElse\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction ifElseFn(\n  condition, onTrue, onFalse\n){\n  return (...input) =\u003e {\n\t\tconst conditionResult =\n      typeof condition === 'boolean' ? condition : condition(...input)\n    if (Boolean(conditionResult) ){\n      return onTrue(...input)\n    }\n\n    return onFalse(...input)\n  }\n}\n\nexport const ifElse = curry(ifElseFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { always } from './always.js'\nimport { has } from './has.js'\nimport { identity } from './identity.js'\nimport { ifElse } from './ifElse.js'\nimport { prop } from './prop.js'\nimport * as R from 'ramda'\n\nconst condition = has('foo')\nconst v = function (a){\n  return typeof a === 'number'\n}\nconst t = function (a){\n  return a + 1\n}\nconst ifFn = x =\u003e prop('foo', x).length\nconst elseFn = () =\u003e false\n\ntest('happy', () =\u003e {\n  const fn = ifElse(condition, ifFn)(elseFn)\n\n  expect(fn({ foo : 'bar' })).toBe(3)\n  expect(fn({ fo : 'bar' })).toBeFalse()\n})\n\ntest('ramda spec', () =\u003e {\n  const ifIsNumber = ifElse(v)\n  expect(ifIsNumber(t, identity)(15)).toBe(16)\n  expect(ifIsNumber(t, identity)('hello')).toBe('hello')\n})\n\ntest('pass all arguments', () =\u003e {\n  const identity = function (a){\n    return a\n  }\n  const v = function (){\n    return true\n  }\n  const onTrue = function (a, b){\n    expect(a).toBe(123)\n    expect(b).toBe('abc')\n  }\n  ifElse(\n    v, onTrue, identity\n  )(123, 'abc')\n})\n\ntest('accept constant as condition', () =\u003e {\n  const fn = ifElse(true)(always(true))(always(false))\n\n  expect(fn()).toBeTrue()\n})\n\ntest('accept constant as condition - case 2', () =\u003e {\n  const fn = ifElse(\n    false, always(true), always(false)\n  )\n\n  expect(fn()).toBeFalse()\n})\n\ntest('curry 1', () =\u003e {\n  const fn = ifElse(condition, ifFn)(elseFn)\n\n  expect(fn({ foo : 'bar' })).toBe(3)\n  expect(fn({ fo : 'bar' })).toBeFalse()\n})\n\ntest('curry 2', () =\u003e {\n  const fn = ifElse(condition)(ifFn)(elseFn)\n\n  expect(fn({ foo : 'bar' })).toBe(3)\n  expect(fn({ fo : 'bar' })).toBeFalse()\n})\n\ntest('simple arity of 1', () =\u003e {\n  const condition = x =\u003e x \u003e 5\n  const onTrue = x =\u003e x + 1\n  const onFalse = x =\u003e x + 10\n  const result = ifElse(\n    condition, onTrue, onFalse\n  )(1)\n  expect(result).toBe(11)\n})\n\ntest('simple arity of 2', () =\u003e {\n  const condition = (x, y) =\u003e x + y \u003e 5\n  const onTrue = (x, y) =\u003e x + y + 1\n  const onFalse = (x, y) =\u003e x + y + 10\n  const result = ifElse(\n    condition, onTrue, onFalse\n  )(1, 10)\n  expect(result).toBe(12)\n})\n\ntest('bug 750', () =\u003e {\n\tconst value = 34;\n\n\tlet result = ifElse(\n\tR.identity,\n\tR.always('true'),\n\tR.always('false')\n\t)(value)\n\texpect(result).toBe('true')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {ifElse} from 'rambda'\n\ndescribe('R.ifElse', () =\u003e {\n  it('happy', () =\u003e {\n    const condition = (x: number) =\u003e x \u003e 5\n    const onTrue = (x: number) =\u003e `foo${x}`\n    const onFalse = (x: number) =\u003e `bar${x}`\n    const fn = ifElse(condition, onTrue, onFalse)\n    fn // $ExpectType (x: number) =\u003e string\n    const result = fn(3)\n    result // $ExpectType string\n  })\n  it('arity of 2', () =\u003e {\n    const condition = (x: number, y: string) =\u003e x + y.length \u003e 5\n    const onTrue = (x: number, y: string) =\u003e `foo${x}-${y}`\n    const onFalse = (x: number, y: string) =\u003e `bar${x}-${y}`\n    const fn = ifElse(condition, onTrue, onFalse)\n    fn // $ExpectType (x: number, y: string) =\u003e string\n    const result = fn(3, 'hello')\n    result // $ExpectType string\n  })\n  test('DefinitelyTyped#59291', () =\u003e {\n    const getLengthIfStringElseDouble = ifElse(\n      (a: string | number): a is string =\u003e true,\n      a =\u003e a.length,\n      a =\u003e a * 2\n    )\n\n    getLengthIfStringElseDouble('foo') // $ExpectType number\n    getLengthIfStringElseDouble(3) // $ExpectType number\n    const result = ifElse(\n      (a: {\n        foo?: string,\n        bar: number | string,\n      }): a is {foo: string, bar: string} =\u003e true,\n      (a): [string, string] =\u003e [a.foo, a.bar],\n      (a): [string | undefined, string | number] =\u003e [a.foo, a.bar]\n    )\n    result // $ExpectType (a: { foo?: string | undefined; bar: string | number; }) =\u003e [string, string] | [string | undefined, string | number]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#ifElse)\n\n### inc\n\n```typescript\n\ninc(x: number): number\n```\n\nIt increments a number.\n\n```javascript\nR.inc(1) // =\u003e 2\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ninc(x: number): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.inc\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport const inc = x =\u003e x + 1\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { inc } from './inc.js'\n\ntest('happy', () =\u003e {\n  expect(inc(1)).toBe(2)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#inc)\n\n### includes\n\n```typescript\n\nincludes\u003cT extends string\u003e(valueToFind: T, input: string): boolean\n```\n\nIf `input` is string, then this method work as native `String.includes`.\n\nIf `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.\n\n```javascript\nconst result = [\n  R.includes('oo', 'foo'),\n  R.includes({a: 1}, [{a: 1}])\n]\n// =\u003e [true, true ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nincludes\u003cT extends string\u003e(valueToFind: T, input: string): boolean;\nincludes\u003cT extends string\u003e(valueToFind: T): (input: string) =\u003e boolean;\nincludes\u003cT\u003e(valueToFind: T, input: T[]): boolean;\nincludes\u003cT\u003e(valueToFind: T): (input: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.includes\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { _indexOf } from './equals.js'\n\nexport function includes(valueToFind, iterable){\n  if (arguments.length === 1)\n    return _iterable =\u003e includes(valueToFind, _iterable)\n  if (typeof iterable === 'string'){\n    return iterable.includes(valueToFind)\n  }\n  if (!iterable){\n    throw new TypeError(`Cannot read property \\'indexOf\\' of ${ iterable }`)\n  }\n  if (!isArray(iterable)) return false\n\n  return _indexOf(valueToFind, iterable) \u003e -1\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { includes as includesRamda } from 'ramda'\n\nimport { includes } from './includes.js'\n\ntest('with string as iterable', () =\u003e {\n  const str = 'foo bar'\n\n  expect(includes('bar')(str)).toBeTrue()\n  expect(includesRamda('bar')(str)).toBeTrue()\n  expect(includes('never', str)).toBeFalse()\n  expect(includesRamda('never', str)).toBeFalse()\n})\n\ntest('with array as iterable', () =\u003e {\n  const arr = [ 1, 2, 3 ]\n\n  expect(includes(2)(arr)).toBeTrue()\n  expect(includesRamda(2)(arr)).toBeTrue()\n\n  expect(includes(4, arr)).toBeFalse()\n  expect(includesRamda(4, arr)).toBeFalse()\n})\n\ntest('with list of objects as iterable', () =\u003e {\n  const arr = [ { a : 1 }, { b : 2 }, { c : 3 } ]\n\n  expect(includes({ c : 3 }, arr)).toBeTrue()\n  expect(includesRamda({ c : 3 }, arr)).toBeTrue()\n})\n\ntest('with NaN', () =\u003e {\n  const result = includes(NaN, [ NaN ])\n  const ramdaResult = includesRamda(NaN, [ NaN ])\n  expect(result).toBeTrue()\n  expect(ramdaResult).toBeTrue()\n})\n\ntest('with wrong input that does not throw', () =\u003e {\n  const result = includes(1, /foo/g)\n  const ramdaResult = includesRamda(1, /foo/g)\n  expect(result).toBeFalse()\n  expect(ramdaResult).toBeFalse()\n})\n\ntest('throws on wrong input - match ramda behaviour', () =\u003e {\n  expect(() =\u003e includes(2, null)).toThrowWithMessage(TypeError,\n    'Cannot read property \\'indexOf\\' of null')\n  expect(() =\u003e includesRamda(2, null)).toThrowWithMessage(TypeError,\n    'Cannot read properties of null (reading \\'indexOf\\')')\n  expect(() =\u003e includes(2, undefined)).toThrowWithMessage(TypeError,\n    'Cannot read property \\'indexOf\\' of undefined')\n  expect(() =\u003e includesRamda(2, undefined)).toThrowWithMessage(TypeError,\n    'Cannot read properties of undefined (reading \\'indexOf\\')')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {includes} from 'rambda'\n\nconst list = [{a: {b: '1'}}, {a: {c: '2'}}, {a: {b: '3'}}]\n\ndescribe('R.includes', () =\u003e {\n  it('happy', () =\u003e {\n    const result = includes({a: {b: '1'}}, list)\n    result // $ExpectType boolean\n    const result2 = includes('oo', ['f', 'oo'])\n    result2 // $ExpectType boolean\n  })\n  it('with string', () =\u003e {\n    const str = 'foo' as 'foo' | 'bar'\n    const result = includes('oo', str)\n    const curriedResult = includes('oo')(str)\n\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#includes)\n\n### indexBy\n\n```typescript\n\nindexBy\u003cT, K extends string | number = string\u003e(condition: (key: T) =\u003e K, list: T[]): { [key in K]: T }\n```\n\nIt generates object with properties provided by `condition` and values provided by `list` array.\n\nIf `condition` is a function, then all list members are passed through it.\n\nIf `condition` is a string, then all list members are passed through `R.path(condition)`.\n\n```javascript\nconst list = [ {id: 10}, {id: 20} ]\n\nconst withFunction = R.indexBy(\n  x =\u003e x.id,\n  list\n)\nconst withString = R.indexBy(\n  'id',\n  list\n)\nconst result = [\n  withFunction, \n  R.equals(withFunction, withString)\n]\n// =\u003e [ { 10: {id: 10}, 20: {id: 20} }, true ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nindexBy\u003cT, K extends string | number = string\u003e(condition: (key: T) =\u003e K, list: T[]): { [key in K]: T };\nindexBy\u003cT, K extends string | number | undefined = string\u003e(condition: (key: T) =\u003e K, list: T[]): { [key in NonNullable\u003cK\u003e]?: T };\nindexBy\u003cT, K extends string | number = string\u003e(condition: (key: T) =\u003e K): (list: T[]) =\u003e { [key in K]: T };\nindexBy\u003cT, K extends string | number | undefined = string\u003e(condition: (key: T) =\u003e K | undefined): (list: T[]) =\u003e { [key in NonNullable\u003cK\u003e]?: T };\nindexBy\u003cT\u003e(condition: string, list: T[]): { [key: string]: T };\nindexBy\u003cT\u003e(condition: string): (list: T[]) =\u003e { [key: string]: T };\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.indexBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { path } from './path.js'\n\nfunction indexByPath(pathInput, list){\n  const toReturn = {}\n  for (let i = 0; i \u003c list.length; i++){\n    const item = list[ i ]\n    toReturn[ path(pathInput, item) ] = item\n  }\n\n  return toReturn\n}\n\nexport function indexBy(condition, list){\n  if (arguments.length === 1){\n    return _list =\u003e indexBy(condition, _list)\n  }\n\n  if (typeof condition === 'string'){\n    return indexByPath(condition, list)\n  }\n\n  const toReturn = {}\n  for (let i = 0; i \u003c list.length; i++){\n    const item = list[ i ]\n    toReturn[ condition(item) ] = item\n  }\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { indexBy } from './indexBy.js'\nimport { prop } from './prop.js'\n\ntest('happy', () =\u003e {\n  const list = [\n    { id : 1 },\n    {\n      id : 1,\n      a  : 2,\n    },\n    { id : 2 },\n    { id : 10 },\n    { id : 'a' },\n  ]\n\n  expect(indexBy(prop('id'))(list)).toEqual({\n    1 : {\n      id : 1,\n      a  : 2,\n    },\n    2  : { id : 2 },\n    10 : { id : 10 },\n    a  : { id : 'a' },\n  })\n})\n\ntest('with string as condition', () =\u003e {\n  const list = [ { id : 1 }, { id : 2 }, { id : 10 }, { id : 'a' } ]\n  const standardResult = indexBy(obj =\u003e obj.id, list)\n  const suggestionResult = indexBy('id', list)\n\n  expect(standardResult).toEqual(suggestionResult)\n})\n\ntest('with string - bad path', () =\u003e {\n  const list = [\n    {\n      a : {\n        b : 1,\n        c : 2,\n      },\n    },\n    { a : { c : 4 } },\n    {},\n    {\n      a : {\n        b : 10,\n        c : 20,\n      },\n    },\n  ]\n\n  const result = indexBy('a.b', list)\n  const expected = {\n    1 : {\n      a : {\n        b : 1,\n        c : 2,\n      },\n    },\n    10 : {\n      a : {\n        b : 10,\n        c : 20,\n      },\n    },\n    undefined : {},\n  }\n\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {indexBy} from 'rambda'\n\nconst list = [{a: {b: '1'}}, {a: {c: '2'}}, {a: {b: '3'}}]\n\ndescribe('indexBy', () =\u003e {\n  it('happy', () =\u003e {\n    const result = indexBy(x =\u003e x.a.b, list)\n    const curriedResult = indexBy\u003cany\u003e(x =\u003e x.a.b)(list)\n    result.foo?.a.b // $ExpectType string | undefined\n    curriedResult // $ExpectType { [x: string]: any; }\n  })\n\n  it('with string', () =\u003e {\n    const result = indexBy('a.b', list)\n    const curriedResult = indexBy\u003cany\u003e('a.b')(list)\n    result.foo?.a.b // $ExpectType string | undefined\n    curriedResult // $ExpectType { [key: string]: any; }\n  })\n\n  it('with interface', () =\u003e {\n    interface Foo {\n      a: string,\n    }\n    const interfaceList = [{a: 'foo'}, {a: 'bar'}]\n    const result = indexBy\u003cFoo\u003e(x =\u003e {\n      x.a // $ExpectType string\n      return x.a\n    }, interfaceList)\n    const curriedResult = indexBy\u003cFoo\u003e(x =\u003e {\n      x.a // $ExpectType string\n      return x.a\n    })(interfaceList)\n    result // $ExpectType { [x: string]: Foo; }\n    curriedResult // $ExpectType { [x: string]: Foo; }\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#indexBy)\n\n### indexOf\n\n```typescript\n\nindexOf\u003cT\u003e(valueToFind: T, list: T[]): number\n```\n\nIt returns the index of the first element of `list` equals to `valueToFind`.\n\nIf there is no such element, it returns `-1`.\n\n\u003e :boom: It uses `R.equals` for list of objects/arrays or native `indexOf` for any other case.\n\n```javascript\nconst list = [0, 1, 2, 3]\n\nconst result = [\n  R.indexOf(2, list),\n  R.indexOf(0, list)\n]\n// =\u003e [2, -1]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nindexOf\u003cT\u003e(valueToFind: T, list: T[]): number;\nindexOf\u003cT\u003e(valueToFind: T): (list: T[]) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.indexOf\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _indexOf } from './equals.js'\n\nexport function indexOf(valueToFind, list){\n  if (arguments.length === 1){\n    return _list =\u003e _indexOf(valueToFind, _list)\n  }\n\n  return _indexOf(valueToFind, list)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { indexOf as indexOfRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { indexOf } from './indexOf.js'\n\ntest('with NaN', () =\u003e {\n  expect(indexOf(NaN, [ NaN ])).toBe(0)\n})\n\ntest('will throw with bad input', () =\u003e {\n  expect(indexOfRamda([], true)).toBe(-1)\n  expect(() =\u003e indexOf([], true)).toThrow()\n})\n\ntest('without list of objects - no R.equals', () =\u003e {\n  expect(indexOf(3, [ 1, 2, 3, 4 ])).toBe(2)\n  expect(indexOf(10)([ 1, 2, 3, 4 ])).toBe(-1)\n})\n\ntest('list of objects uses R.equals', () =\u003e {\n  const listOfObjects = [ { a : 1 }, { b : 2 }, { c : 3 } ]\n  expect(indexOf({ c : 4 }, listOfObjects)).toBe(-1)\n  expect(indexOf({ c : 3 }, listOfObjects)).toBe(2)\n})\n\ntest('list of arrays uses R.equals', () =\u003e {\n  const listOfLists = [ [ 1 ], [ 2, 3 ], [ 2, 3, 4 ], [ 2, 3 ], [ 1 ], [] ]\n  expect(indexOf([], listOfLists)).toBe(5)\n  expect(indexOf([ 1 ], listOfLists)).toBe(0)\n  expect(indexOf([ 2, 3, 4 ], listOfLists)).toBe(2)\n  expect(indexOf([ 2, 3, 5 ], listOfLists)).toBe(-1)\n})\n\ntest('with string as iterable', () =\u003e {\n  expect(() =\u003e indexOf('a', 'abc')).toThrowWithMessage(Error,\n    'Cannot read property \\'indexOf\\' of abc')\n  expect(indexOfRamda('a', 'abc')).toBe(0)\n})\n\nexport const possibleTargets = [\n  x =\u003e x \u003e 2,\n  /foo/,\n  'foo',\n  { a : 1 },\n  true,\n  3,\n  null,\n  /bar/g,\n  NaN,\n  undefined,\n  4,\n  [],\n  [ [] ],\n  [ [ 1 ], [ 2 ] ],\n  { a : 1 },\n  { a : 2 },\n  Promise.resolve(1),\n]\n\nexport const possibleIterables = [\n  [\n    1,\n    2,\n    new Boolean(true),\n    false,\n    true,\n    new String('foo'),\n    new Number(3),\n    null,\n    undefined,\n  ],\n  [ /foo/g, /bar/, /bar/g, NaN ],\n  [ 1, 2, 3 ],\n  [ 1, [ [], [] ] ],\n  [ { a : 3 }, { a : 2 }, { a : 1 } ],\n  {},\n  null,\n  undefined,\n  true,\n  'foo',\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : indexOf,\n    fnRamda     : indexOfRamda,\n    firstInput  : possibleTargets,\n    secondInput : possibleIterables,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 34,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 51,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 170,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {indexOf} from 'rambda'\n\ndescribe('R.indexOf', () =\u003e {\n  it('happy', () =\u003e {\n    const list = [1, 2, 3]\n    const result = indexOf(1, list)\n    const curriedResult = indexOf(1)(list)\n\n    result // $ExpectType number\n    curriedResult // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#indexOf)\n\n### init\n\n```typescript\n\ninit\u003cT extends unknown[]\u003e(input: T): T extends readonly [...infer U, any] ? U : [...T]\n```\n\nIt returns all but the last element of list or string `input`.\n\n```javascript\nconst result = [\n  R.init([1, 2, 3]) , \n  R.init('foo')  // =\u003e 'fo'\n]\n// =\u003e [[1, 2], 'fo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ninit\u003cT extends unknown[]\u003e(input: T): T extends readonly [...infer U, any] ? U : [...T];\ninit(input: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.init\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport baseSlice from './_internals/baseSlice.js'\n\nexport function init(listOrString){\n  if (typeof listOrString === 'string') return listOrString.slice(0, -1)\n\n  return listOrString.length ?\n    baseSlice(\n      listOrString, 0, -1\n    ) :\n    []\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { init } from './init.js'\n\ntest('with array', () =\u003e {\n  expect(init([ 1, 2, 3 ])).toEqual([ 1, 2 ])\n  expect(init([ 1, 2 ])).toEqual([ 1 ])\n  expect(init([ 1 ])).toEqual([])\n  expect(init([])).toEqual([])\n  expect(init([])).toEqual([])\n  expect(init([ 1 ])).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  expect(init('foo')).toBe('fo')\n  expect(init('f')).toBe('')\n  expect(init('')).toBe('')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {init} from 'rambda'\n\ndescribe('R.init', () =\u003e {\n  it('with string', () =\u003e {\n    const result = init('foo')\n\n    result // $ExpectType string\n  })\n  it('with list - one type', () =\u003e {\n    const result = init([1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n  it('with list - mixed types', () =\u003e {\n    const result = init([1, 2, 3, 'foo', 'bar'])\n\n    result // $ExpectType (string | number)[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#init)\n\n### innerJoin\n\n```typescript\n\ninnerJoin\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n): (list1: T1[], list2: T2[]) =\u003e T1[]\n```\n\nIt returns a new list by applying a `predicate` function to all elements of `list1` and `list2` and keeping only these elements where `predicate` returns `true`.\n\n```javascript\nconst list1 = [1, 2, 3, 4, 5]\nconst list2 = [4, 5, 6]\nconst predicate = (x, y) =\u003e x \u003e= y\nconst result = R.innerJoin(predicate, list1, list2)\n// =\u003e [4, 5]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ninnerJoin\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n): (list1: T1[], list2: T2[]) =\u003e T1[];\ninnerJoin\u003cT1, T2\u003e(\n  pred: (a: T1, b: T2) =\u003e boolean,\n  list1: T1[],\n): (list2: T2[]) =\u003e T1[];\ninnerJoin\u003cT1, T2\u003e(pred: (a: T1, b: T2) =\u003e boolean, list1: T1[], list2: T2[]): T1[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.innerJoin\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction _includesWith(\n  pred, x, list\n){\n  let idx = 0\n  const len = list.length\n\n  while (idx \u003c len){\n    if (pred(x, list[ idx ]))\n      return true\n\n    idx += 1\n  }\n\n  return false\n}\nfunction _filter(fn, list){\n  let idx = 0\n  const len = list.length\n  const result = []\n\n  while (idx \u003c len){\n    if (fn(list[ idx ]))\n      result[ result.length ] = list[ idx ]\n\n    idx += 1\n  }\n\n  return result\n}\n\nexport function innerJoinFn(\n  pred, xs, ys\n){\n  return _filter(x =\u003e _includesWith(\n    pred, x, ys\n  ), xs)\n}\n\nexport const innerJoin = curry(innerJoinFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { innerJoin } from './innerJoin.js'\n\nconst a = {\n  id: 1,\n  name: 'a',\n}\nconst b = {\n  id: 2,\n  name: 'b',\n}\nconst c = {\n  id: 3,\n  name: 'c',\n}\nconst f = innerJoin((r, id) =\u003e r.id === id)\n\ntest('only returns elements from the first list', () =\u003e {\n  expect(f([a, b, c], [])).toEqual([])\n  expect(f([a, b, c], [1])).toEqual([a])\n  expect(f([a, b, c], [1, 2])).toEqual([a, b])\n  expect(f([a, b, c], [1, 2, 3])).toEqual([a, b, c])\n  expect(f([a, b, c], [1, 2, 3, 4])).toEqual([a, b, c])\n})\n\ntest('does not remove duplicates', () =\u003e {\n  expect(f([a, a, a], [1, 2, 3])).toEqual([a, a, a])\n  expect(f([a, b, c], [1, 1, 1])).toEqual([a])\n})\n\ntest('readme example', () =\u003e {\n  const list1 = [1, 2, 3, 4, 5]\n  const list2 = [4, 5, 6]\n  const predicate = (x, y) =\u003e x \u003e= y\n  const result = innerJoin(predicate, list1, list2)\n  expect(result).toEqual([4, 5])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#innerJoin)\n\n### insert\n\n```typescript\n\ninsert(index: number): \u003cT\u003e(itemToInsert: T, list: T[]) =\u003e T[]\n```\n\n```javascript\nconst list = ['a', 'b', 'c', 'd', 'e'];\nconst result = R.insert(2, 'x', list);\n// =\u003e ['a', 'b', 'x', 'c', 'd', 'e']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ninsert(index: number): \u003cT\u003e(itemToInsert: T, list: T[]) =\u003e T[];\ninsert\u003cT\u003e(index: number, itemToInsert: T): (list: T[]) =\u003e T[];\ninsert\u003cT\u003e(index: number, itemToInsert: T, list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.insert\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nexport function insertFn(indexToInsert, valueToInsert, array) {\n  return [\n    ...array.slice(0, indexToInsert),\n    valueToInsert,\n    ...array.slice(indexToInsert),\n  ]\n}\n\nexport const insert = curry(insertFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { insert } from './insert';\n\nit('inserts an element into the given list', () =\u003e {\n\tconst list = ['a', 'b', 'c', 'd', 'e'];\n\texpect(insert(2, 'x', list)).toEqual(['a', 'b', 'x', 'c', 'd', 'e']);\n});\n\nit('inserts another list as an element', () =\u003e {\n\tconst list = ['a', 'b', 'c', 'd', 'e'];\n\texpect(insert(2, ['s', 't'], list)).toEqual([\n\t\t'a',\n\t\t'b',\n\t\t['s', 't'],\n\t\t'c',\n\t\t'd',\n\t\t'e',\n\t]);\n});\n\nit('appends to the end of the list if the index is too large', () =\u003e {\n\tconst list = ['a', 'b', 'c', 'd', 'e'];\n\texpect(insert(8, 'z', list)).toEqual(['a', 'b', 'c', 'd', 'e', 'z']);\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#insert)\n\n### insertAll\n\n```typescript\n\ninsertAll(index: number): \u003cT\u003e(itemsToInsert: T[], list: T[]) =\u003e T[]\n```\n\n```javascript\nconst list = ['a', 'b', 'c', 'd', 'e'];\nconst result = R.insertAll(2, ['x', 'y', 'z'], list);\n// =\u003e ['a', 'b', 'x', 'y', 'z', 'c', 'd', 'e']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ninsertAll(index: number): \u003cT\u003e(itemsToInsert: T[], list: T[]) =\u003e T[];\ninsertAll\u003cT\u003e(index: number, itemsToInsert: T[]): (list: T[]) =\u003e T[];\ninsertAll\u003cT\u003e(index: number, itemsToInsert: T[], list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.insertAll\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js';\n\nexport function insertAllFn(index, listToInsert, list) {\n\treturn [...list.slice(0, index), ...listToInsert, ...list.slice(index)];\n}\n\nexport const insertAll = curry(insertAllFn);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { insertAll } from './insertAll';\n\nit('inserts a list of elements into the given list', () =\u003e {\n\tconst list = ['a', 'b', 'c', 'd', 'e'];\n\texpect(insertAll(2, ['x', 'y', 'z'], list)).toEqual([\n\t\t'a',\n\t\t'b',\n\t\t'x',\n\t\t'y',\n\t\t'z',\n\t\t'c',\n\t\t'd',\n\t\t'e',\n\t]);\n});\n\nit('appends to the end of the list if the index is too large', () =\u003e {\n\tconst list = ['a', 'b', 'c', 'd', 'e'];\n\texpect(insertAll(8, ['p', 'q', 'r'], list)).toEqual([\n\t\t'a',\n\t\t'b',\n\t\t'c',\n\t\t'd',\n\t\t'e',\n\t\t'p',\n\t\t'q',\n\t\t'r',\n\t]);\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#insertAll)\n\n### intersection\n\n```typescript\n\nintersection\u003cT\u003e(listA: T[], listB: T[]): T[]\n```\n\nIt loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.\n\n\u003e :boom: There is slight difference between Rambda and Ramda implementation. Ramda.intersection(['a', 'b', 'c'], ['c', 'b']) result is \"[ 'c', 'b' ]\", but Rambda result is \"[ 'b', 'c' ]\".\n\n```javascript\nconst listA = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]\nconst listB = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]\n\nconst result = R.intersection(listA, listB)\n// =\u003e [{ id : 3 }, { id : 4 }]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nintersection\u003cT\u003e(listA: T[], listB: T[]): T[];\nintersection\u003cT\u003e(listA: T[]): (listB: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.intersection\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { filter } from './filter.js'\nimport { includes } from './includes.js'\n\nexport function intersection(listA, listB){\n  if (arguments.length === 1) return _list =\u003e intersection(listA, _list)\n\n  return filter(x =\u003e includes(x, listA), listB)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { intersection as intersectionRamda } from 'ramda'\n\nimport { intersection } from './intersection.js'\n\ntest('intersection', () =\u003e {\n  const list1 = [ 1, 2, 3, 4 ]\n  const list2 = [ 3, 4, 5, 6 ]\n  expect(intersection(list1)(list2)).toEqual([ 3, 4 ])\n\n  expect(intersection([], [])).toEqual([])\n})\n\ntest('intersection with objects', () =\u003e {\n  const list1 = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]\n  const list2 = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]\n  expect(intersection(list1)(list2)).toEqual([ { id : 3 }, { id : 4 } ])\n})\n\ntest('order is the same as in Ramda', () =\u003e {\n  const list = [ 'a', 'b', 'c', 'd' ]\n\n  expect(intersectionRamda(list, [ 'b', 'c' ])).toEqual([ 'b', 'c' ])\n  expect(intersection(list, [ 'b', 'c' ])).toEqual([ 'b', 'c' ])\n\n  expect(intersection(list, [ 'c', 'b' ])).toEqual([ 'c', 'b' ])\n  expect(intersectionRamda(list, [ 'c', 'b' ])).toEqual([ 'c', 'b' ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {intersection} from 'rambda'\n\nconst list1 = [1, 2, 3]\nconst list2 = [1, 3, 5]\n\ndescribe('R.intersection', () =\u003e {\n  it('happy', () =\u003e {\n    const result = intersection(list1, list2)\n    result // $ExpectType number[]\n\n    const curriedResult = intersection(list1)(list2)\n    curriedResult // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#intersection)\n\n### intersperse\n\n```typescript\n\nintersperse\u003cT\u003e(separator: T, list: T[]): T[]\n```\n\nIt adds a `separator` between members of `list`.\n\n```javascript\nconst list = [ 0, 1, 2, 3 ]\nconst separator = '|'\nconst result = intersperse(separator, list)\n// =\u003e [0, '|', 1, '|', 2, '|', 3]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nintersperse\u003cT\u003e(separator: T, list: T[]): T[];\nintersperse\u003cT\u003e(separator: T): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.intersperse\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function intersperse(separator, list){\n  if (arguments.length === 1) return _list =\u003e intersperse(separator, _list)\n\n  let index = -1\n  const len = list.length\n  const willReturn = []\n\n  while (++index \u003c len){\n    if (index === len - 1){\n      willReturn.push(list[ index ])\n    } else {\n      willReturn.push(list[ index ], separator)\n    }\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { intersperse } from './intersperse.js'\n\ntest('intersperse', () =\u003e {\n  const list = [ { id : 1 }, { id : 2 }, { id : 10 }, { id : 'a' } ]\n  expect(intersperse('!', list)).toEqual([\n    { id : 1 },\n    '!',\n    { id : 2 },\n    '!',\n    { id : 10 },\n    '!',\n    { id : 'a' },\n  ])\n\n  expect(intersperse('!')([])).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {intersperse} from 'rambda'\n\ndescribe('R.intersperse', () =\u003e {\n  it('happy', () =\u003e {\n    const result = intersperse(1, [1, 2, 3])\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = intersperse('|')(['foo', 'bar'])\n    result // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#intersperse)\n\n### is\n\n```typescript\n\nis\u003cC extends () =\u003e any\u003e(targetPrototype: C, val: any): val is ReturnType\u003cC\u003e\n```\n\nIt returns `true` if `x` is instance of `targetPrototype`.\n\n```javascript\nconst result = [\n  R.is(String, 'foo'),  \n  R.is(Array, 1)\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nis\u003cC extends () =\u003e any\u003e(targetPrototype: C, val: any): val is ReturnType\u003cC\u003e;\nis\u003cC extends new () =\u003e any\u003e(targetPrototype: C, val: any): val is InstanceType\u003cC\u003e;\nis\u003cC extends () =\u003e any\u003e(targetPrototype: C): (val: any) =\u003e val is ReturnType\u003cC\u003e;\nis\u003cC extends new () =\u003e any\u003e(targetPrototype: C): (val: any) =\u003e val is InstanceType\u003cC\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.is\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function is(targetPrototype, x){\n  if (arguments.length === 1) return _x =\u003e is(targetPrototype, _x)\n\n  return (\n    x != null \u0026\u0026 x.constructor === targetPrototype ||\n    x instanceof targetPrototype\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { is } from './is.js'\n\ntest('works with built-in types', () =\u003e {\n  expect(is(Array, undefined)).toBeFalse()\n  expect(is(Array)([])).toBeTrue()\n  expect(is(Boolean, new Boolean(false))).toBeTrue()\n  expect(is(Date, new Date())).toBeTrue()\n  expect(is(Function, () =\u003e {})).toBeTrue()\n  expect(is(Number, new Number(0))).toBeTrue()\n  expect(is(Object, {})).toBeTrue()\n  expect(is(RegExp, /(?:)/)).toBeTrue()\n  expect(is(String, new String(''))).toBeTrue()\n})\n\ntest('works with user-defined types', () =\u003e {\n  function Foo(){}\n  function Bar(){}\n  Bar.prototype = new Foo()\n\n  const foo = new Foo()\n  const bar = new Bar()\n\n  expect(is(Foo, foo)).toBeTrue()\n  expect(is(Bar, bar)).toBeTrue()\n  expect(is(Foo, bar)).toBeTrue()\n  expect(is(Bar, foo)).toBeFalse()\n})\n\ntest('does not coerce', () =\u003e {\n  expect(is(Boolean, 1)).toBeFalse()\n  expect(is(Number, '1')).toBeFalse()\n  expect(is(Number, false)).toBeFalse()\n})\n\ntest('recognizes primitives as their object equivalents', () =\u003e {\n  expect(is(Boolean, false)).toBeTrue()\n  expect(is(Number, 0)).toBeTrue()\n  expect(is(String, '')).toBeTrue()\n})\n\ntest('does not consider primitives to be instances of Object', () =\u003e {\n  expect(is(Object, false)).toBeFalse()\n  expect(is(Object, 0)).toBeFalse()\n  expect(is(Object, '')).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {is} from 'rambda'\n\ndescribe('R.is', () =\u003e {\n  it('happy', () =\u003e {\n    const result = is(String, 'foo')\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = is(Number)(1)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#is)\n\n### isEmpty\n\n```typescript\n\nisEmpty\u003cT\u003e(x: T): boolean\n```\n\nIt returns `true` if `x` is `empty`.\n\n```javascript\nconst result = [\n  R.isEmpty(''),\n  R.isEmpty({ x : 0 })\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nisEmpty\u003cT\u003e(x: T): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.isEmpty\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { type } from './type.js'\n\nexport function isEmpty(input){\n  const inputType = type(input)\n  if ([ 'Undefined', 'NaN', 'Number', 'Null' ].includes(inputType))\n    return false\n  if (!input) return true\n\n  if (inputType === 'Object'){\n    return Object.keys(input).length === 0\n  }\n\n  if (inputType === 'Array'){\n    return input.length === 0\n  }\n\n  return false\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { isEmpty } from './isEmpty.js'\n\ntest('happy', () =\u003e {\n  expect(isEmpty(undefined)).toBeFalse()\n  expect(isEmpty('')).toBeTrue()\n  expect(isEmpty(null)).toBeFalse()\n  expect(isEmpty(' ')).toBeFalse()\n  expect(isEmpty(new RegExp(''))).toBeFalse()\n  expect(isEmpty([])).toBeTrue()\n  expect(isEmpty([ [] ])).toBeFalse()\n  expect(isEmpty({})).toBeTrue()\n  expect(isEmpty({ x : 0 })).toBeFalse()\n  expect(isEmpty(0)).toBeFalse()\n  expect(isEmpty(NaN)).toBeFalse()\n  expect(isEmpty([ '' ])).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {isEmpty} from 'rambda'\n\ndescribe('R.isEmpty', () =\u003e {\n  it('happy', () =\u003e {\n    const result = isEmpty('foo')\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#isEmpty)\n\n### isNil\n\n```typescript\n\nisNil(x: any): x is null | undefined\n```\n\nIt returns `true` if `x` is either `null` or `undefined`.\n\n```javascript\nconst result = [\n  R.isNil(null),\n  R.isNil(1),\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nisNil(x: any): x is null | undefined;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.isNil\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function isNil(x){\n  return x === undefined || x === null\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { isNil } from './isNil.js'\n\ntest('happy', () =\u003e {\n  expect(isNil(null)).toBeTrue()\n\n  expect(isNil(undefined)).toBeTrue()\n\n  expect(isNil([])).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#isNil)\n\n### isNotEmpty\n\n```typescript\n\nisNotEmpty\u003cT\u003e(value: T[]): value is NonEmptyArray\u003cT\u003e\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nisNotEmpty\u003cT\u003e(value: T[]): value is NonEmptyArray\u003cT\u003e;\nisNotEmpty\u003cT\u003e(value: readonly T[]): value is ReadonlyNonEmptyArray\u003cT\u003e;\nisNotEmpty(value: any): boolean;\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#isNotEmpty)\n\n### isNotNil\n\n```typescript\n\nisNotNil\u003cT\u003e(value: T): value is NonNullable\u003cT\u003e\n```\n\n```javascript\nconst result = [\n  R.isNotNil(null),\n  R.isNotNil(undefined),\n  R.isNotNil([]),\n]\n// =\u003e [false, false, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nisNotNil\u003cT\u003e(value: T): value is NonNullable\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.isNotNil\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function isNotNil(input) {\n  return input != null\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { isNotNil } from './isNotNil'\n\ntest('tests a value for `null` or `undefined`', () =\u003e {\n  expect(isNotNil(void 0)).toBe(false)\n  expect(isNotNil(undefined)).toBe(false)\n  expect(isNotNil(null)).toBe(false)\n  expect(isNotNil([])).toBe(true)\n  expect(isNotNil({})).toBe(true)\n  expect(isNotNil(0)).toBe(true)\n  expect(isNotNil('')).toBe(true)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#isNotNil)\n\n### join\n\n```typescript\n\njoin\u003cT\u003e(glue: string, list: T[]): string\n```\n\nIt returns a string of all `list` instances joined with a `glue`.\n\n```javascript\nR.join('-', [1, 2, 3])  // =\u003e '1-2-3'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\njoin\u003cT\u003e(glue: string, list: T[]): string;\njoin\u003cT\u003e(glue: string): (list: T[]) =\u003e string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.join\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function join(glue, list){\n  if (arguments.length === 1) return _list =\u003e join(glue, _list)\n\n  return list.join(glue)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { join } from './join.js'\n\ntest('curry', () =\u003e {\n  expect(join('|')([ 'foo', 'bar', 'baz' ])).toBe('foo|bar|baz')\n\n  expect(join('|', [ 1, 2, 3 ])).toBe('1|2|3')\n\n  const spacer = join(' ')\n\n  expect(spacer([ 'a', 2, 3.4 ])).toBe('a 2 3.4')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {join} from 'rambda'\n\ndescribe('R.join', () =\u003e {\n  it('happy', () =\u003e {\n    const result = join('|', [1, 2, 3])\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#join)\n\n### juxt\n\n```typescript\n\njuxt\u003cA extends any[], R1\u003e(fns: [(...a: A) =\u003e R1]): (...a: A) =\u003e [R1]\n```\n\nIt applies list of function to a list of inputs.\n\n```javascript\nconst getRange = juxt([ Math.min, Math.max, Math.min ])\nconst result = getRange(\n  3, 4, 9, -3\n)\n// =\u003e [-3, 9, -3]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\njuxt\u003cA extends any[], R1\u003e(fns: [(...a: A) =\u003e R1]): (...a: A) =\u003e [R1];\njuxt\u003cA extends any[], R1, R2\u003e(fns: [(...a: A) =\u003e R1, (...a: A) =\u003e R2]): (...a: A) =\u003e [R1, R2];\njuxt\u003cA extends any[], R1, R2, R3\u003e(fns: [(...a: A) =\u003e R1, (...a: A) =\u003e R2, (...a: A) =\u003e R3]): (...a: A) =\u003e [R1, R2, R3];\njuxt\u003cA extends any[], R1, R2, R3, R4\u003e(fns: [(...a: A) =\u003e R1, (...a: A) =\u003e R2, (...a: A) =\u003e R3, (...a: A) =\u003e R4]): (...a: A) =\u003e [R1, R2, R3, R4];\njuxt\u003cA extends any[], R1, R2, R3, R4, R5\u003e(fns: [(...a: A) =\u003e R1, (...a: A) =\u003e R2, (...a: A) =\u003e R3, (...a: A) =\u003e R4, (...a: A) =\u003e R5]): (...a: A) =\u003e [R1, R2, R3, R4, R5];\njuxt\u003cA extends any[], U\u003e(fns: Array\u003c(...args: A) =\u003e U\u003e): (...args: A) =\u003e U[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.juxt\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function juxt(listOfFunctions){\n  return (...args) =\u003e listOfFunctions.map(fn =\u003e fn(...args))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { juxt } from './juxt.js'\n\ntest('happy', () =\u003e {\n  const fn = juxt([ Math.min, Math.max, Math.min ])\n  const result = fn(\n    3, 4, 9, -3\n  )\n  expect(result).toEqual([ -3, 9, -3 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {juxt} from 'rambda'\n\ndescribe('R.juxt', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = juxt([Math.min, Math.max])\n    const result = fn(3, 4, 9, -3)\n    result // $ExpectType [number, number]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#juxt)\n\n### keys\n\n```typescript\n\nkeys\u003cT extends object\u003e(x: T): (keyof T \u0026 string)[]\n```\n\nIt applies `Object.keys` over `x` and returns its keys.\n\n```javascript\nR.keys({a:1, b:2})  // =\u003e ['a', 'b']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nkeys\u003cT extends object\u003e(x: T): (keyof T \u0026 string)[];\nkeys\u003cT\u003e(x: T): string[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.keys\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function keys(x){\n  return Object.keys(x)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { keys } from './keys.js'\n\ntest('happy', () =\u003e {\n  expect(keys({ a : 1 })).toEqual([ 'a' ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#keys)\n\n### last\n\n```typescript\n\nlast(str: ''): undefined\n```\n\nIt returns the last element of `input`, as the `input` can be either a string or an array. It returns `undefined` if array has length of 0.\n\n```javascript\nconst result = [\n  R.last([1, 2, 3]),\n  R.last('foo'),\n]\n// =\u003e [3, 'o']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlast(str: ''): undefined;\nlast(str: string): string;\nlast(list: readonly[]): undefined;\nlast(list: never[]): undefined;\nlast\u003cT extends unknown[]\u003e(array: T): LastArrayElement\u003cT\u003e;\nlast\u003cT extends readonly unknown[]\u003e(array: T): LastArrayElement\u003cT\u003e;\nlast(str: string): string | undefined;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.last\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function last(listOrString){\n  if (typeof listOrString === 'string'){\n    return listOrString[ listOrString.length - 1 ] || ''\n  }\n\n  return listOrString[ listOrString.length - 1 ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { last } from './last.js'\n\ntest('with list', () =\u003e {\n  expect(last([ 1, 2, 3 ])).toBe(3)\n  expect(last([])).toBeUndefined()\n})\n\ntest('with string', () =\u003e {\n  expect(last('abc')).toBe('c')\n  expect(last('')).toBe('')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#last)\n\n### lastIndexOf\n\n```typescript\n\nlastIndexOf\u003cT\u003e(target: T, list: T[]): number\n```\n\nIt returns the last index of `target` in `list` array.\n\n`R.equals` is used to determine equality between `target` and members of `list`.\n\nIf there is no such index, then `-1` is returned.\n\n```javascript\nconst list = [1, 2, 3, 1, 2, 3]\nconst result = [\n  R.lastIndexOf(2, list),\n  R.lastIndexOf(4, list),\n]\n// =\u003e [4, -1]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlastIndexOf\u003cT\u003e(target: T, list: T[]): number;\nlastIndexOf\u003cT\u003e(target: T): (list: T[]) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lastIndexOf\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _lastIndexOf } from './equals.js'\n\nexport function lastIndexOf(valueToFind, list){\n  if (arguments.length === 1){\n    return _list =\u003e _lastIndexOf(valueToFind, _list)\n  }\n\n  return _lastIndexOf(valueToFind, list)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { lastIndexOf as lastIndexOfRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { possibleIterables, possibleTargets } from './indexOf.spec.js'\nimport { lastIndexOf } from './lastIndexOf.js'\n\ntest('with NaN', () =\u003e {\n  expect(lastIndexOf(NaN, [ NaN ])).toBe(0)\n})\n\ntest('will throw with bad input', () =\u003e {\n  expect(lastIndexOfRamda([], true)).toBe(-1)\n  expect(() =\u003e indexOf([], true)).toThrowErrorMatchingInlineSnapshot('\"indexOf is not defined\"')\n})\n\ntest('without list of objects - no R.equals', () =\u003e {\n  expect(lastIndexOf(3, [ 1, 2, 3, 4 ])).toBe(2)\n  expect(lastIndexOf(10)([ 1, 2, 3, 4 ])).toBe(-1)\n})\n\ntest('list of objects uses R.equals', () =\u003e {\n  const listOfObjects = [ { a : 1 }, { b : 2 }, { c : 3 } ]\n  expect(lastIndexOf({ c : 4 }, listOfObjects)).toBe(-1)\n  expect(lastIndexOf({ c : 3 }, listOfObjects)).toBe(2)\n})\n\ntest('list of arrays uses R.equals', () =\u003e {\n  const listOfLists = [ [ 1 ], [ 2, 3 ], [ 2, 3, 4 ], [ 2, 3 ], [ 1 ], [] ]\n  expect(lastIndexOf([], listOfLists)).toBe(5)\n  expect(lastIndexOf([ 1 ], listOfLists)).toBe(4)\n  expect(lastIndexOf([ 2, 3, 4 ], listOfLists)).toBe(2)\n  expect(lastIndexOf([ 2, 3, 5 ], listOfLists)).toBe(-1)\n})\n\ntest('with string as iterable', () =\u003e {\n  expect(() =\u003e lastIndexOf('a', 'abc')).toThrowErrorMatchingInlineSnapshot('\"Cannot read property \\'indexOf\\' of abc\"')\n  expect(lastIndexOfRamda('a', 'abc')).toBe(0)\n})\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : lastIndexOf,\n    fnRamda     : lastIndexOfRamda,\n    firstInput  : possibleTargets,\n    secondInput : possibleIterables,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 34,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 51,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 170,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {lastIndexOf} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.lastIndexOf', () =\u003e {\n  it('happy', () =\u003e {\n    const result = lastIndexOf(2, list)\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = lastIndexOf(2)(list)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lastIndexOf)\n\n### length\n\n```typescript\n\nlength\u003cT\u003e(input: T[]): number\n```\n\nIt returns the `length` property of list or string `input`.\n\n```javascript\nconst result = [\n  R.length([1, 2, 3, 4]),\n  R.length('foo'),\n]\n// =\u003e [4, 3]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlength\u003cT\u003e(input: T[]): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.length\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function length(x){\n  if (isArray(x)) return x.length\n  if (typeof x === 'string') return x.length\n\n  return NaN\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { length as lengthRamda } from 'ramda'\n\nimport { length } from './length.js'\n\ntest('happy', () =\u003e {\n  expect(length('foo')).toBe(3)\n  expect(length([ 1, 2, 3 ])).toBe(3)\n  expect(length([])).toBe(0)\n})\n\ntest('with empty string', () =\u003e {\n  expect(length('')).toBe(0)\n})\n\ntest('with bad input returns NaN', () =\u003e {\n  expect(length(0)).toBeNaN()\n  expect(length({})).toBeNaN()\n  expect(length(null)).toBeNaN()\n  expect(length(undefined)).toBeNaN()\n})\n\ntest('with length as property', () =\u003e {\n  const input1 = { length : '123' }\n  const input2 = { length : null }\n  const input3 = { length : '' }\n\n  expect(length(input1)).toBeNaN()\n  expect(lengthRamda(input1)).toBeNaN()\n  expect(length(input2)).toBeNaN()\n  expect(lengthRamda(input2)).toBeNaN()\n  expect(length(input3)).toBeNaN()\n  expect(lengthRamda(input3)).toBeNaN()\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#length)\n\n### lens\n\n```typescript\n\nlens\u003cS, A\u003e(getter: (s: S) =\u003e A, setter: (a: A, s: S) =\u003e S): Lens\u003cS, A\u003e\n```\n\nIt returns a `lens` for the given `getter` and `setter` functions. \n\nThe `getter` **gets** the value of the focus; the `setter` **sets** the value of the focus. \n\nThe setter should not mutate the data structure.\n\n```javascript\nconst xLens = R.lens(R.prop('x'), R.assoc('x'));\n\nR.view(xLens, {x: 1, y: 2}) // =\u003e 1\nR.set(xLens, 4, {x: 1, y: 2}) // =\u003e {x: 4, y: 2}\nR.over(xLens, R.negate, {x: 1, y: 2}) // =\u003e {x: -1, y: 2}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlens\u003cS, A\u003e(getter: (s: S) =\u003e A, setter: (a: A, s: S) =\u003e S): Lens\u003cS, A\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lens\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function lens(getter, setter){\n  return function (functor){\n    return function (target){\n      return functor(getter(target)).map(focus =\u003e setter(focus, target))\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {lens, assoc, lensProp, view, lensIndex, over, lensPath} from 'rambda'\n\ninterface Input {\n  foo: string,\n}\nconst testObject: Input = {\n  foo: 'Jazz',\n}\n\ndescribe('R.lens', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = lens\u003cInput, string\u003e((x: Input) =\u003e {\n      x.foo // $ExpectType string\n      return x.foo\n    }, assoc('name'))\n    fn // $ExpectType Lens\u003cInput, string\u003e\n  })\n})\n\ndescribe('R.lensProp', () =\u003e {\n  it('happy', () =\u003e {\n    const result = view\u003cInput, string\u003e(lensProp('foo'), testObject)\n    result // $ExpectType string\n  })\n  it('issue 740', () =\u003e {\n    // @ts-expect-error\n    over(lensProp('x'), (n) =\u003e String(n), {x: 1})\n  })\n})\n\ndescribe('R.lensIndex', () =\u003e {\n  const testList: Input[] = [{foo: 'bar'}, {foo: 'baz'}]\n  it('happy', () =\u003e {\n    const result = view\u003cInput[], Input\u003e(lensIndex(0), testList)\n    result // $ExpectType Input\n    result.foo // $ExpectType string\n  })\n})\n\ndescribe('R.lensPath', () =\u003e {\n  const path = lensPath(['bar', 'a'])\n  it('happy', () =\u003e {\n    const result = view\u003cInput, string\u003e(path, testObject)\n    result // $ExpectType string\n  })\n})\n\ndescribe('R.view', () =\u003e {\n  const fooLens = lens\u003cInput, string\u003e((x: Input) =\u003e {\n    return x.foo\n  }, assoc('foo'))\n  it('happt', () =\u003e {\n    const result = view\u003cInput, string\u003e(fooLens, testObject)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lens)\n\n### lensIndex\n\n```typescript\n\nlensIndex\u003cA\u003e(n: number): Lens\u003cA[], A\u003e\n```\n\nIt returns a lens that focuses on specified `index`.\n\n```javascript\nconst list = ['a', 'b', 'c']\nconst headLens = R.lensIndex(0)\n\nR.view(headLens, list) // =\u003e 'a'\nR.set(headLens, 'x', list) // =\u003e ['x', 'b', 'c']\nR.over(headLens, R.toUpper, list) // =\u003e ['A', 'b', 'c']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlensIndex\u003cA\u003e(n: number): Lens\u003cA[], A\u003e;\nlensIndex\u003cA extends any[], N extends number\u003e(n: N): Lens\u003cA, A[N]\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lensIndex\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { lens } from './lens.js'\nimport { nth } from './nth.js'\nimport { update } from './update.js'\n\nexport function lensIndex(index){\n  return lens(nth(index), update(index))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { compose } from './compose.js'\nimport { keys } from './keys.js'\nimport { lensIndex } from './lensIndex.js'\nimport { over } from './over.js'\nimport { set } from './set.js'\nimport { view } from './view.js'\n\nconst testList = [ { a : 1 }, { b : 2 }, { c : 3 } ]\n\ntest('focuses list element at the specified index', () =\u003e {\n  expect(view(lensIndex(0), testList)).toEqual({ a : 1 })\n})\n\ntest('returns undefined if the specified index does not exist', () =\u003e {\n  expect(view(lensIndex(10), testList)).toBeUndefined()\n})\n\ntest('sets the list value at the specified index', () =\u003e {\n  expect(set(\n    lensIndex(0), 0, testList\n  )).toEqual([ 0, { b : 2 }, { c : 3 } ])\n})\n\ntest('applies function to the value at the specified list index', () =\u003e {\n  expect(over(\n    lensIndex(2), keys, testList\n  )).toEqual([ { a : 1 }, { b : 2 }, [ 'c' ] ])\n})\n\ntest('can be composed', () =\u003e {\n  const nestedList = [ 0, [ 10, 11, 12 ], 1, 2 ]\n  const composedLens = compose(lensIndex(1), lensIndex(0))\n\n  expect(view(composedLens, nestedList)).toBe(10)\n})\n\ntest('set s (get s) === s', () =\u003e {\n  expect(set(\n    lensIndex(0), view(lensIndex(0), testList), testList\n  )).toEqual(testList)\n})\n\ntest('get (set s v) === v', () =\u003e {\n  expect(view(lensIndex(0), set(\n    lensIndex(0), 0, testList\n  ))).toBe(0)\n})\n\ntest('get (set(set s v1) v2) === v2', () =\u003e {\n  expect(view(lensIndex(0),\n    set(\n      lensIndex(0), 11, set(\n        lensIndex(0), 10, testList\n      )\n    ))).toBe(11)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lensIndex)\n\n### lensPath\n\n```typescript\n\nlensPath\u003cS, K0 extends keyof S = keyof S\u003e(path: [K0]): Lens\u003cS, S[K0]\u003e\n```\n\nIt returns a lens that focuses on specified `path`.\n\n```javascript\nconst lensPath = R.lensPath(['x', 0, 'y'])\nconst input = {x: [{y: 2, z: 3}, {y: 4, z: 5}]}\n\nR.view(lensPath, input) // =\u003e 2\n\nR.set(lensPath, 1, input) \n// =\u003e {x: [{y: 1, z: 3}, {y: 4, z: 5}]}\n\nR.over(xHeadYLens, R.negate, input) \n// =\u003e {x: [{y: -2, z: 3}, {y: 4, z: 5}]}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlensPath\u003cS, K0 extends keyof S = keyof S\u003e(path: [K0]): Lens\u003cS, S[K0]\u003e;\nlensPath\u003cS, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]\u003e(\n  path: [K0, K1],\n): Lens\u003cS, S[K0][K1]\u003e;\nlensPath\u003c\n  S,\n  K0 extends keyof S = keyof S,\n  K1 extends keyof S[K0] = keyof S[K0],\n  K2 extends keyof S[K0][K1] = keyof S[K0][K1]\n\u003e(path: [K0, K1, K2]): Lens\u003cS, S[K0][K1][K2]\u003e;\nlensPath\u003c\n  S,\n  K0 extends keyof S = keyof S,\n  K1 extends keyof S[K0] = keyof S[K0],\n  K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n  K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2]\n\u003e(path: [K0, K1, K2, K3]): Lens\u003cS, S[K0][K1][K2][K3]\u003e;\nlensPath\u003c\n  S,\n  K0 extends keyof S = keyof S,\n  K1 extends keyof S[K0] = keyof S[K0],\n  K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n  K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],\n  K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3]\n\u003e(path: [K0, K1, K2, K3, K4]): Lens\u003cS, S[K0][K1][K2][K3][K4]\u003e;\nlensPath\u003c\n  S,\n  K0 extends keyof S = keyof S,\n  K1 extends keyof S[K0] = keyof S[K0],\n  K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n  K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],\n  K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],\n  K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4]\n\u003e(path: [K0, K1, K2, K3, K4, K5]): Lens\u003cS, S[K0][K1][K2][K3][K4][K5]\u003e;\nlensPath\u003cS = any, A = any\u003e(path: Path): Lens\u003cS, A\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lensPath\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { assocPath } from './assocPath.js'\nimport { lens } from './lens.js'\nimport { path } from './path.js'\n\nexport function lensPath(key){\n  return lens(path(key), assocPath(key))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { compose } from './compose.js'\nimport { identity } from './identity.js'\nimport { inc } from './inc.js'\nimport { lensPath } from './lensPath.js'\nimport { lensProp } from './lensProp.js'\nimport { over } from './over.js'\nimport { set } from './set.js'\nimport { view } from './view.js'\n\nconst testObj = {\n  a : [ { b : 1 }, { b : 2 } ],\n  d : 3,\n}\n\ntest('view', () =\u003e {\n  expect(view(lensPath('d'), testObj)).toBe(3)\n  expect(view(lensPath('a.0.b'), testObj)).toBe(1)\n  // this is different to ramda, as ramda will return a clone of the input object\n  expect(view(lensPath(''), testObj)).toBeUndefined()\n})\n\ntest('set', () =\u003e {\n  expect(set(\n    lensProp('d'), 0, testObj\n  )).toEqual({\n    a : [ { b : 1 }, { b : 2 } ],\n    d : 0,\n  })\n  expect(set(\n    lensPath('a.0.b'), 0, testObj\n  )).toEqual({\n    a : [ { b : 0 }, { b : 2 } ],\n    d : 3,\n  })\n  expect(set(\n    lensPath('a.0.X'), 0, testObj\n  )).toEqual({\n    a : [\n      {\n        b : 1,\n        X : 0,\n      },\n      { b : 2 },\n    ],\n    d : 3,\n  })\n  expect(set(\n    lensPath([]), 0, testObj\n  )).toBe(0)\n})\n\ntest('over', () =\u003e {\n  expect(over(\n    lensPath('d'), inc, testObj\n  )).toEqual({\n    a : [ { b : 1 }, { b : 2 } ],\n    d : 4,\n  })\n  expect(over(\n    lensPath('a.1.b'), inc, testObj\n  )).toEqual({\n    a : [ { b : 1 }, { b : 3 } ],\n    d : 3,\n  })\n  expect(over(\n    lensProp('X'), identity, testObj\n  )).toEqual({\n    a : [ { b : 1 }, { b : 2 } ],\n    d : 3,\n    X : undefined,\n  })\n  expect(over(\n    lensPath('a.0.X'), identity, testObj\n  )).toEqual({\n    a : [\n      {\n        b : 1,\n        X : undefined,\n      },\n      { b : 2 },\n    ],\n    d : 3,\n  })\n})\n\ntest('compose', () =\u003e {\n  const composedLens = compose(lensPath('a'), lensPath('1.b'))\n  expect(view(composedLens, testObj)).toBe(2)\n})\n\ntest('set s (get s) === s', () =\u003e {\n  expect(set(\n    lensPath([ 'd' ]), view(lensPath([ 'd' ]), testObj), testObj\n  )).toEqual(testObj)\n  expect(set(\n    lensPath([ 'a', 0, 'b' ]),\n    view(lensPath([ 'a', 0, 'b' ]), testObj),\n    testObj\n  )).toEqual(testObj)\n})\n\ntest('get (set s v) === v', () =\u003e {\n  expect(view(lensPath([ 'd' ]), set(\n    lensPath([ 'd' ]), 0, testObj\n  ))).toBe(0)\n  expect(view(lensPath([ 'a', 0, 'b' ]), set(\n    lensPath([ 'a', 0, 'b' ]), 0, testObj\n  ))).toBe(0)\n})\n\ntest('get (set(set s v1) v2) === v2', () =\u003e {\n  const p = [ 'd' ]\n  const q = [ 'a', 0, 'b' ]\n  expect(view(lensPath(p), set(\n    lensPath(p), 11, set(\n      lensPath(p), 10, testObj\n    )\n  ))).toBe(11)\n  expect(view(lensPath(q), set(\n    lensPath(q), 11, set(\n      lensPath(q), 10, testObj\n    )\n  ))).toBe(11)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lensPath)\n\n### lensProp\n\n```typescript\n\nlensProp\u003cS, K extends keyof S = keyof S\u003e(prop: K): Lens\u003cS, S[K]\u003e\n```\n\nIt returns a lens that focuses on specified property `prop`.\n\n```javascript\nconst xLens = R.lensProp('x');\nconst input = {x: 1, y: 2}\n\nR.view(xLens, input) // =\u003e 1\n\nR.set(xLens, 4, input) \n// =\u003e {x: 4, y: 2}\n\nR.over(xLens, R.negate, input) \n// =\u003e {x: -1, y: 2}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlensProp\u003cS, K extends keyof S = keyof S\u003e(prop: K): Lens\u003cS, S[K]\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lensProp\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { assoc } from './assoc.js'\nimport { lens } from './lens.js'\nimport { prop } from './prop.js'\n\nexport function lensProp(key){\n  return lens(prop(key), assoc(key))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { compose } from './compose.js'\nimport { identity } from './identity.js'\nimport { inc } from './inc.js'\nimport { lensProp } from './lensProp.js'\nimport { over } from './over.js'\nimport { set } from './set.js'\nimport { view } from './view.js'\n\nconst testObj = {\n  a : 1,\n  b : 2,\n  c : 3,\n}\n\ntest('focuses object the specified object property', () =\u003e {\n  expect(view(lensProp('a'), testObj)).toBe(1)\n})\n\ntest('returns undefined if the specified property does not exist', () =\u003e {\n  expect(view(lensProp('X'), testObj)).toBeUndefined()\n})\n\ntest('sets the value of the object property specified', () =\u003e {\n  expect(set(\n    lensProp('a'), 0, testObj\n  )).toEqual({\n    a : 0,\n    b : 2,\n    c : 3,\n  })\n})\n\ntest('adds the property to the object if it doesn\\'t exist', () =\u003e {\n  expect(set(\n    lensProp('d'), 4, testObj\n  )).toEqual({\n    a : 1,\n    b : 2,\n    c : 3,\n    d : 4,\n  })\n})\n\ntest('applies function to the value of the specified object property', () =\u003e {\n  expect(over(\n    lensProp('a'), inc, testObj\n  )).toEqual({\n    a : 2,\n    b : 2,\n    c : 3,\n  })\n})\n\ntest('applies function to undefined and adds the property if it doesn\\'t exist', () =\u003e {\n  expect(over(\n    lensProp('X'), identity, testObj\n  )).toEqual({\n    a : 1,\n    b : 2,\n    c : 3,\n    X : undefined,\n  })\n})\n\ntest('can be composed', () =\u003e {\n  const nestedObj = {\n    a : { b : 1 },\n    c : 2,\n  }\n  const composedLens = compose(lensProp('a'), lensProp('b'))\n\n  expect(view(composedLens, nestedObj)).toBe(1)\n})\n\ntest('set s (get s) === s', () =\u003e {\n  expect(set(\n    lensProp('a'), view(lensProp('a'), testObj), testObj\n  )).toEqual(testObj)\n})\n\ntest('get (set s v) === v', () =\u003e {\n  expect(view(lensProp('a'), set(\n    lensProp('a'), 0, testObj\n  ))).toBe(0)\n})\n\ntest('get (set(set s v1) v2) === v2', () =\u003e {\n  expect(view(lensProp('a'),\n    set(\n      lensProp('a'), 11, set(\n        lensProp('a'), 10, testObj\n      )\n    ))).toBe(11)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lensProp)\n\n### lt\n\n```typescript\n\nlt\u003cT, U\u003e(x: T, y: U): boolean\n```\n\n```javascript\nconst result = [R.lt(2, 1), R.lt(2, 3)]\n// =\u003e [false, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlt\u003cT, U\u003e(x: T, y: U): boolean;\nlt\u003cT, U\u003e(x: T): (y: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lt\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function lt(a, b){\n  if (arguments.length === 1)\n    return _b =\u003e lt(a, _b)\n\n  return a \u003c b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {lt} from 'rambda'\n\ndescribe('R.lt', () =\u003e {\n  it('happy', () =\u003e {\n    const result = lt(1, 2)\n    const curriedResult = lt(2)(3)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lt)\n\n### lte\n\n```typescript\n\nlte\u003cT, U\u003e(x: T, y: U): boolean\n```\n\n```javascript\nconst result = [R.lte(2, 1), R.lte(2, 2), R.lte(2, 3)]\n// =\u003e [false, true, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nlte\u003cT, U\u003e(x: T, y: U): boolean;\nlte\u003cT, U\u003e(x: T): (y: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.lte\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function lte(a, b){\n  if (arguments.length === 1)\n    return _b =\u003e lte(a, _b)\n\n  return a \u003c= b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {lte} from 'rambda'\n\ndescribe('R.lte', () =\u003e {\n  it('happy', () =\u003e {\n    const result = lte(1, 2)\n    const curriedResult = lte(2)(3)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#lte)\n\n### map\n\n```typescript\n\nmap\u003cT, U\u003e(fn: ObjectIterator\u003cT, U\u003e, iterable: Dictionary\u003cT\u003e): Dictionary\u003cU\u003e\n```\n\nIt returns the result of looping through `iterable` with `fn`.\n\nIt works with both array and object.\n\n\u003e :boom: Unlike Ramda's `map`, here property and input object are passed as arguments to `fn`, when `iterable` is an object.\n\n```javascript\nconst fn = x =\u003e x * 2\nconst fnWhenObject = (val, prop)=\u003e{\n  return `${prop}-${val}`\n}\n\nconst iterable = [1, 2]\nconst obj = {a: 1, b: 2}\n\nconst result = [ \n  R.map(fn, iterable),\n  R.map(fnWhenObject, obj)\n]\n// =\u003e [ [2, 4], {a: 'a-1', b: 'b-2'}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmap\u003cT, U\u003e(fn: ObjectIterator\u003cT, U\u003e, iterable: Dictionary\u003cT\u003e): Dictionary\u003cU\u003e;\nmap\u003cT, U\u003e(fn: Iterator\u003cT, U\u003e, iterable: T[]): U[];\nmap\u003cT, U\u003e(fn: Iterator\u003cT, U\u003e): (iterable: T[]) =\u003e U[];\nmap\u003cT, U, S\u003e(fn: ObjectIterator\u003cT, U\u003e): (iterable: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cU\u003e;\nmap\u003cT\u003e(fn: Iterator\u003cT, T\u003e): (iterable: T[]) =\u003e T[];\nmap\u003cT\u003e(fn: Iterator\u003cT, T\u003e, iterable: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.map\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { INCORRECT_ITERABLE_INPUT } from './_internals/constants.js'\nimport { isArray } from './_internals/isArray.js'\nimport { keys } from './_internals/keys.js'\n\nexport function mapArray(\n  fn, list, isIndexed = false\n){\n  let index = 0\n  const willReturn = Array(list.length)\n\n  while (index \u003c list.length){\n    willReturn[ index ] = isIndexed ? fn(list[ index ], index) : fn(list[ index ])\n\n    index++\n  }\n\n  return willReturn\n}\n\nexport function mapObject(fn, obj){\n  if (arguments.length === 1){\n    return _obj =\u003e mapObject(fn, _obj)\n  }\n  let index = 0\n  const objKeys = keys(obj)\n  const len = objKeys.length\n  const willReturn = {}\n\n  while (index \u003c len){\n    const key = objKeys[ index ]\n    willReturn[ key ] = fn(\n      obj[ key ], key, obj\n    )\n    index++\n  }\n\n  return willReturn\n}\n\nexport const mapObjIndexed = mapObject\n\nexport function map(fn, iterable){\n  if (arguments.length === 1) return _iterable =\u003e map(fn, _iterable)\n  if (!iterable){\n    throw new Error(INCORRECT_ITERABLE_INPUT)\n  }\n\n  if (isArray(iterable)) return mapArray(fn, iterable)\n\n  return mapObject(fn, iterable)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { map as mapRamda } from 'ramda'\n\nimport { map } from './map.js'\n\nconst double = x =\u003e x * 2\n\ndescribe('with array', () =\u003e {\n  it('happy', () =\u003e {\n    expect(map(double, [ 1, 2, 3 ])).toEqual([ 2, 4, 6 ])\n  })\n\n  it('curried', () =\u003e {\n    expect(map(double)([ 1, 2, 3 ])).toEqual([ 2, 4, 6 ])\n  })\n})\n\ndescribe('with object', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n  }\n\n  it('happy', () =\u003e {\n    expect(map(double, obj)).toEqual({\n      a : 2,\n      b : 4,\n    })\n  })\n\n  it('property as second and input object as third argument', () =\u003e {\n    const obj = {\n      a : 1,\n      b : 2,\n    }\n    const iterator = (\n      val, prop, inputObject\n    ) =\u003e {\n      expect(prop).toBeString()\n      expect(inputObject).toEqual(obj)\n\n      return val * 2\n    }\n\n    expect(map(iterator)(obj)).toEqual({\n      a : 2,\n      b : 4,\n    })\n  })\n})\n\ntest('bad inputs difference between Ramda and Rambda', () =\u003e {\n  expect(() =\u003e map(double, null)).toThrowErrorMatchingInlineSnapshot('\"Incorrect iterable input\"')\n  expect(() =\u003e map(double)(undefined)).toThrowErrorMatchingInlineSnapshot('\"Incorrect iterable input\"')\n  expect(() =\u003e mapRamda(double, null)).toThrowErrorMatchingInlineSnapshot('\"Cannot read properties of null (reading \\'fantasy-land/map\\')\"')\n  expect(() =\u003e\n    mapRamda(double, undefined)).toThrowErrorMatchingInlineSnapshot('\"Cannot read properties of undefined (reading \\'fantasy-land/map\\')\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {map} from 'rambda'\n\ndescribe('R.map with arrays', () =\u003e {\n  it('iterable returns the same type as the input', () =\u003e {\n    const result = map\u003cnumber\u003e(\n      (x: number) =\u003e {\n        x // $ExpectType number\n        return x + 2\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType number[]\n  })\n  it('iterable returns the same type as the input - curried', () =\u003e {\n    const result = map\u003cnumber\u003e((x: number) =\u003e {\n      x // $ExpectType number\n      return x + 2\n    })([1, 2, 3])\n    result // $ExpectType number[]\n  })\n  it('iterable returns different type as the input', () =\u003e {\n    const result = map\u003cnumber, string\u003e(\n      (x: number) =\u003e {\n        x // $ExpectType number\n        return String(x)\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType string[]\n  })\n})\n\ndescribe('R.map with objects', () =\u003e {\n  it('iterable with all three arguments - curried', () =\u003e {\n    // It requires dummy third typing argument\n    // in order to identify compared to curry typings for arrays\n    // ============================================\n    const result = map\u003cnumber, string, any\u003e((a, b, c) =\u003e {\n      a // $ExpectType number\n      b // $ExpectType string\n      c // $ExpectType Dictionary\u003cnumber\u003e\n      return `${a}`\n    })({a: 1, b: 2})\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n  it('iterable with all three arguments', () =\u003e {\n    const result = map\u003cnumber, string\u003e(\n      (a, b, c) =\u003e {\n        a // $ExpectType number\n        b // $ExpectType string\n        c // $ExpectType Dictionary\u003cnumber\u003e\n        return `${a}`\n      },\n      {a: 1, b: 2}\n    )\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n  it('iterable with property argument', () =\u003e {\n    const result = map\u003cnumber, string\u003e(\n      (a, b) =\u003e {\n        a // $ExpectType number\n        b // $ExpectType string\n        return `${a}`\n      },\n      {a: 1, b: 2}\n    )\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n  it('iterable with no property argument', () =\u003e {\n    const result = map\u003cnumber, string\u003e(\n      a =\u003e {\n        a // $ExpectType number\n        return `${a}`\n      },\n      {a: 1, b: 2}\n    )\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#map)\n\n### mapObjIndexed\n\n```typescript\n\nmapObjIndexed\u003cT\u003e(fn: ObjectIterator\u003cT, T\u003e, iterable: Dictionary\u003cT\u003e): Dictionary\u003cT\u003e\n```\n\nIt works the same way as `R.map` does for objects. It is added as Ramda also has this method.\n\n```javascript\nconst fn = (val, prop) =\u003e {\n  return `${prop}-${val}`\n}\n\nconst obj = {a: 1, b: 2}\n\nconst result = R.mapObjIndexed(fn, obj)\n// =\u003e {a: 'a-1', b: 'b-2'}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmapObjIndexed\u003cT\u003e(fn: ObjectIterator\u003cT, T\u003e, iterable: Dictionary\u003cT\u003e): Dictionary\u003cT\u003e;\nmapObjIndexed\u003cT, U\u003e(fn: ObjectIterator\u003cT, U\u003e, iterable: Dictionary\u003cT\u003e): Dictionary\u003cU\u003e;\nmapObjIndexed\u003cT\u003e(fn: ObjectIterator\u003cT, T\u003e): (iterable: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cT\u003e;\nmapObjIndexed\u003cT, U\u003e(fn: ObjectIterator\u003cT, U\u003e): (iterable: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cU\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mapObjIndexed} from 'rambda'\n\nconst obj = {a: 1, b: 2, c: 3}\n\ndescribe('R.mapObjIndexed', () =\u003e {\n  it('without type transform', () =\u003e {\n    const result = mapObjIndexed((x, prop, obj) =\u003e {\n      x // $ExpectType number\n      prop // $ExpectType string\n      obj // $ExpectType Dictionary\u003cnumber\u003e\n      return x + 2\n    }, obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('without type transform - curried', () =\u003e {\n    const result = mapObjIndexed\u003cnumber\u003e((x, prop, obj) =\u003e {\n      x // $ExpectType number\n      prop // $ExpectType string\n      obj // $ExpectType Dictionary\u003cnumber\u003e\n      return x + 2\n    })(obj)\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('change of type', () =\u003e {\n    const result = mapObjIndexed((x, prop, obj) =\u003e {\n      x // $ExpectType number\n      prop // $ExpectType string\n      obj // $ExpectType Dictionary\u003cnumber\u003e\n      return String(x + 2)\n    }, obj)\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n  it('change of type - curried', () =\u003e {\n    const result = mapObjIndexed\u003cnumber, string\u003e((x, prop, obj) =\u003e {\n      x // $ExpectType number\n      prop // $ExpectType string\n      obj // $ExpectType Dictionary\u003cnumber\u003e\n      return String(x + 2)\n    })(obj)\n    result // $ExpectType Dictionary\u003cstring\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mapObjIndexed)\n\n### match\n\n```typescript\n\nmatch(regExpression: RegExp, str: string): string[]\n```\n\nCurried version of `String.prototype.match` which returns empty array, when there is no match.\n\n```javascript\nconst result = [\n  R.match('a', 'foo'),\n  R.match(/([a-z]a)/g, 'bananas')\n]\n// =\u003e [[], ['ba', 'na', 'na']]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmatch(regExpression: RegExp, str: string): string[];\nmatch(regExpression: RegExp): (str: string) =\u003e string[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.match\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function match(pattern, input){\n  if (arguments.length === 1) return _input =\u003e match(pattern, _input)\n\n  const willReturn = input.match(pattern)\n\n  return willReturn === null ? [] : willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { match } from './match.js'\n\ntest('happy', () =\u003e {\n  expect(match(/a./g)('foo bar baz')).toEqual([ 'ar', 'az' ])\n})\n\ntest('fallback', () =\u003e {\n  expect(match(/a./g)('foo')).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  expect(match('a', 'foo')).toEqual([])\n  expect(equals(match('o', 'foo'), [ 'o' ])).toBeTrue()\n})\n\ntest('throwing', () =\u003e {\n  expect(() =\u003e {\n    match(/a./g, null)\n  }).toThrowErrorMatchingInlineSnapshot('\"Cannot read properties of null (reading \\'match\\')\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {match} from 'rambda'\n\nconst str = 'foo bar'\n\ndescribe('R.match', () =\u003e {\n  it('happy', () =\u003e {\n    const result = match(/foo/, str)\n    result // $ExpectType string[]\n  })\n  it('curried', () =\u003e {\n    const result = match(/foo/)(str)\n    result // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#match)\n\n### mathMod\n\n```typescript\n\nmathMod(x: number, y: number): number\n```\n\n`R.mathMod` behaves like the modulo operator should mathematically, unlike the `%` operator (and by extension, `R.modulo`). So while `-17 % 5` is `-2`, `mathMod(-17, 5)` is `3`.\n\n\u003e :boom: Explanation is taken from `Ramda` documentation site.\n\n```javascript\nconst result = [\n  R.mathMod(-17, 5),\n  R.mathMod(17, 5),\n  R.mathMod(17, -5),  \n  R.mathMod(17, 0)   \n]\n// =\u003e [3, 2, NaN, NaN]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmathMod(x: number, y: number): number;\nmathMod(x: number): (y: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mathMod\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isInteger } from './_internals/isInteger.js'\n\nexport function mathMod(x, y){\n  if (arguments.length === 1) return _y =\u003e mathMod(x, _y)\n  if (!isInteger(x) || !isInteger(y) || y \u003c 1) return NaN\n\n  return (x % y + y) % y\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mathMod } from './mathMod.js'\n\ntest('happy', () =\u003e {\n  expect(mathMod(-17)(5)).toBe(3)\n  expect(mathMod(17, 5)).toBe(2)\n  expect(mathMod(17, -5)).toBeNaN()\n  expect(mathMod(17, 0)).toBeNaN()\n  expect(mathMod('17', 5)).toBeNaN()\n  expect(mathMod({}, 2)).toBeNaN()\n  expect(mathMod([], 2)).toBeNaN()\n  expect(mathMod(Symbol(), 2)).toBeNaN()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mathMod} from 'rambda'\n\nconst first = 1\nconst second = 2\n\ndescribe('R.mathMod', () =\u003e {\n  it('happy', () =\u003e {\n    const result = mathMod(first, second)\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = mathMod(first, second)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mathMod)\n\n### max\n\n```typescript\n\nmax\u003cT extends Ord\u003e(x: T, y: T): T\n```\n\nIt returns the greater value between `x` and `y`.\n\n```javascript\nconst result = [\n  R.max(5, 7),  \n  R.max('bar', 'foo'),  \n]\n// =\u003e [7, 'foo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmax\u003cT extends Ord\u003e(x: T, y: T): T;\nmax\u003cT extends Ord\u003e(x: T): (y: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.max\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function max(x, y){\n  if (arguments.length === 1) return _y =\u003e max(x, _y)\n\n  return y \u003e x ? y : x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { max } from './max.js'\n\ntest('with number', () =\u003e {\n  expect(max(2, 1)).toBe(2)\n})\n\ntest('with string', () =\u003e {\n  expect(max('foo')('bar')).toBe('foo')\n  expect(max('bar')('baz')).toBe('baz')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {max} from 'rambda'\n\nconst first = 1\nconst second = 2\n\ndescribe('R.max', () =\u003e {\n  it('happy', () =\u003e {\n    const result = max(first, second)\n    result // $ExpectType 1 | 2\n  })\n  it('curried', () =\u003e {\n    const result = max(first, second)\n    result // $ExpectType 1 | 2\n  })\n  it('curried - cann pass type', () =\u003e {\n    const result = max\u003cnumber\u003e(first, second)\n    result // $ExpectType number\n  })\n  it('can pass type', () =\u003e {\n    const result = max\u003cnumber\u003e(first, second)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#max)\n\n### maxBy\n\n```typescript\n\nmaxBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T, y: T): T\n```\n\nIt returns the greater value between `x` and `y` according to `compareFn` function.\n\n```javascript\nconst compareFn = Math.abs\n\nR.maxBy(compareFn, 5, -7) // =\u003e -7\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmaxBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T, y: T): T;\nmaxBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T): (y: T) =\u003e T;\nmaxBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord): (x: T) =\u003e (y: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.maxBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nexport function maxByFn(\n  compareFn, x, y\n){\n  return compareFn(y) \u003e compareFn(x) ? y : x\n}\n\nexport const maxBy = curry(maxByFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { maxBy } from './maxBy.js'\n\ntest('happy', () =\u003e {\n  expect(maxBy(\n    Math.abs, -5, 2\n  )).toBe(-5)\n})\n\ntest('curried', () =\u003e {\n  expect(maxBy(Math.abs)(2, -5)).toBe(-5)\n  expect(maxBy(Math.abs)(2)(-5)).toBe(-5)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {maxBy} from 'rambda'\n\nconst compareFn = (x: number) =\u003e x % 2 === 0 ? 1 : -1\nconst first = 1\nconst second = 2\n\ndescribe('R.maxBy', () =\u003e {\n  it('happy', () =\u003e {\n    const result = maxBy(compareFn, first, second)\n    result // $ExpectType 1 | 2\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#maxBy)\n\n### mean\n\n```typescript\n\nmean(list: number[]): number\n```\n\nIt returns the mean value of `list` input.\n\n```javascript\nR.mean([ 2, 7 ])\n// =\u003e 4.5\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmean(list: number[]): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mean\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { sum } from './sum.js'\n\nexport function mean(list){\n  return sum(list) / list.length\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mean } from './mean.js'\n\ntest('happy', () =\u003e {\n  expect(mean([ 2, 7 ])).toBe(4.5)\n})\n\ntest('with NaN', () =\u003e {\n  expect(mean([])).toBeNaN()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mean} from 'rambda'\n\ndescribe('R.mean', () =\u003e {\n  it('happy', () =\u003e {\n    const result = mean([1, 2, 3])\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mean)\n\n### median\n\n```typescript\n\nmedian(list: number[]): number\n```\n\nIt returns the median value of `list` input.\n\n```javascript\nR.median([ 7, 2, 10, 9 ]) // =\u003e 8\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmedian(list: number[]): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.median\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { mean } from './mean.js'\n\nexport function median(list){\n  const len = list.length\n  if (len === 0) return NaN\n  const width = 2 - len % 2\n  const idx = (len - width) / 2\n\n  return mean(Array.prototype.slice\n    .call(list, 0)\n    .sort((a, b) =\u003e {\n      if (a === b) return 0\n\n      return a \u003c b ? -1 : 1\n    })\n    .slice(idx, idx + width))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { median } from './median.js'\n\ntest('happy', () =\u003e {\n  expect(median([ 2 ])).toBe(2)\n  expect(median([ 7, 2, 10, 2, 9 ])).toBe(7)\n})\n\ntest('with empty array', () =\u003e {\n  expect(median([])).toBeNaN()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {median} from 'rambda'\n\ndescribe('R.median', () =\u003e {\n  it('happy', () =\u003e {\n    const result = median([1, 2, 3])\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#median)\n\n### merge\n\n```typescript\n\nmerge\u003cA, B\u003e(target: A, newProps: B): A \u0026 B\nexport function merge\u003cOutput\u003e(target: any): (newProps: any) =\u003e Output\n```\n\nSame as `R.mergeRight`.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmerge\u003cA, B\u003e(target: A, newProps: B): A \u0026 B\nmerge\u003cOutput\u003e(target: any): (newProps: any) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.merge\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport { mergeRight as merge } from './mergeRight.js'\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#merge)\n\n### mergeAll\n\n```typescript\n\nmergeAll\u003cT\u003e(list: object[]): T\n```\n\nIt merges all objects of `list` array sequentially and returns the result.\n\n```javascript\nconst list = [\n  {a: 1},\n  {b: 2},\n  {c: 3}\n]\nconst result = R.mergeAll(list)\nconst expected = {\n  a: 1,\n  b: 2,\n  c: 3\n}\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeAll\u003cT\u003e(list: object[]): T;\nmergeAll(list: object[]): object;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeAll\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { map } from './map.js'\nimport { mergeRight } from './mergeRight.js'\n\nexport function mergeAll(arr){\n  let willReturn = {}\n  map(val =\u003e {\n    willReturn = mergeRight(willReturn, val)\n  }, arr)\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mergeAll } from './mergeAll.js'\n\ntest('case 1', () =\u003e {\n  const arr = [ { a : 1 }, { b : 2 }, { c : 3 } ]\n  const expectedResult = {\n    a : 1,\n    b : 2,\n    c : 3,\n  }\n  expect(mergeAll(arr)).toEqual(expectedResult)\n})\n\ntest('case 2', () =\u003e {\n  expect(mergeAll([ { foo : 1 }, { bar : 2 }, { baz : 3 } ])).toEqual({\n    foo : 1,\n    bar : 2,\n    baz : 3,\n  })\n})\n\ndescribe('acts as if nil values are simply empty objects', () =\u003e {\n  it('if the first object is nil', () =\u003e {\n    expect(mergeAll([ null, { foo : 1 }, { foo : 2 }, { bar : 2 } ])).toEqual({\n      foo : 2,\n      bar : 2,\n    })\n  })\n\n  it('if the last object is nil', () =\u003e {\n    expect(mergeAll([ { foo : 1 }, { foo : 2 }, { bar : 2 }, undefined ])).toEqual({\n      foo : 2,\n      bar : 2,\n    })\n  })\n\n  it('if an intermediate object is nil', () =\u003e {\n    expect(mergeAll([ { foo : 1 }, { foo : 2 }, null, { bar : 2 } ])).toEqual({\n      foo : 2,\n      bar : 2,\n    })\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mergeAll} from 'rambda'\n\ndescribe('R.mergeAll', () =\u003e {\n  it('with passing type', () =\u003e {\n    interface Output {\n      foo: number,\n      bar: number,\n    }\n    const result = mergeAll\u003cOutput\u003e([{foo: 1}, {bar: 2}])\n    result.foo // $ExpectType number\n    result.bar // $ExpectType number\n  })\n\n  it('without passing type', () =\u003e {\n    const result = mergeAll([{foo: 1}, {bar: 2}])\n    result // $ExpectType unknown\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeAll)\n\n### mergeDeepLeft\n\n```typescript\n\nmergeDeepLeft\u003cOutput\u003e(newProps: object, target: object): Output\n```\n\n```javascript\nconst result = R.mergeDeepLeft(\n  {a: {b: 1}},\n  {a: {b: 2, c: 3}}\n)\n// =\u003e {a: {b: 1, c: 3}}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeDeepLeft\u003cOutput\u003e(newProps: object, target: object): Output;\nmergeDeepLeft\u003cOutput\u003e(newProps: object): (target: object) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeDeepLeft\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { mergeDeepRight } from './mergeDeepRight.js';\n\nexport function mergeDeepLeft(newProps, target) {\n\treturn mergeDeepRight(target, newProps);\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mergeDeepLeft } from './mergeDeepLeft';\n\nit('takes two objects, recursively merges their own properties and returns a new object', () =\u003e {\n\tconst a = { w: 1, x: 2, y: { z: 3 } };\n\tconst b = { a: 4, b: 5, c: { d: 6 } };\n\texpect(mergeDeepLeft(a, b)).toEqual({\n\t\tw: 1,\n\t\tx: 2,\n\t\ty: { z: 3 },\n\t\ta: 4,\n\t\tb: 5,\n\t\tc: { d: 6 },\n\t});\n});\n\nit('overrides properties in the second object with properties in the first object', () =\u003e {\n\tconst a = { a: { b: 1, c: 2 }, y: 0 };\n\tconst b = { a: { b: 3, d: 4 }, z: 0 };\n\texpect(mergeDeepLeft(a, b)).toEqual({ a: { b: 1, c: 2, d: 4 }, y: 0, z: 0 });\n});\n\nit('is not destructive', () =\u003e {\n\tconst a = { w: 1, x: { y: 2 } };\n\tconst res = mergeDeepLeft(a, { x: { y: 3 } });\n\texpect(a).not.toBe(res);\n\texpect(a.x).not.toBe(res.x);\n\texpect(res).toEqual({ w: 1, x: { y: 2 } });\n});\n\nit('reports only own properties', () =\u003e {\n\tconst a = { w: 1, x: { y: 2 } };\n\tfunction Cla() {}\n\tCla.prototype.y = 5;\n\texpect(mergeDeepLeft({ x: new Cla() }, a)).toEqual({ w: 1, x: { y: 2 } });\n\texpect(mergeDeepLeft(a, { x: new Cla() })).toEqual({ w: 1, x: { y: 2 } });\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeDeepLeft)\n\n### mergeDeepRight\n\n```typescript\n\nmergeDeepRight\u003cOutput\u003e(target: object, newProps: object): Output\n```\n\nCreates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:\n\n  - and both values are objects, the two values will be recursively merged\n  - otherwise the value from the second object will be used.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeDeepRight\u003cOutput\u003e(target: object, newProps: object): Output;\nmergeDeepRight\u003cOutput\u003e(target: object): (newProps: object) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeDeepRight\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { clone } from './clone.js'\nimport { type } from './type.js'\n\nexport function mergeDeepRight(target, source){\n  if (arguments.length === 1){\n    return sourceHolder =\u003e mergeDeepRight(target, sourceHolder)\n  }\n\n  const willReturn = clone(target)\n\n  Object.keys(source).forEach(key =\u003e {\n    if (type(source[ key ]) === 'Object'){\n      if (type(target[ key ]) === 'Object'){\n        willReturn[ key ] = mergeDeepRight(target[ key ], source[ key ])\n      } else {\n        willReturn[ key ] = source[ key ]\n      }\n    } else {\n      willReturn[ key ] = source[ key ]\n    }\n  })\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mergeDeepRight } from './mergeDeepRight.js'\n\nconst student = {\n  name    : 'foo',\n  age     : 10,\n  contact : {\n    a     : 1,\n    email : 'foo@example.com',\n  },\n}\nconst teacher = {\n  age     : 40,\n  contact : { email : 'baz@example.com' },\n  songs   : { title : 'Remains the same' },\n}\n\ntest('when merging object with lists inside them', () =\u003e {\n  const a = {\n    a : [ 1, 2, 3 ],\n    b : [ 4, 5, 6 ],\n  }\n  const b = {\n    a : [ 7, 8, 9 ],\n    b : [ 10, 11, 12 ],\n  }\n  const result = mergeDeepRight(a, b)\n  const expected = {\n    a : [ 7, 8, 9 ],\n    b : [ 10, 11, 12 ],\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('happy', () =\u003e {\n  const result = mergeDeepRight(student, teacher)\n  const curryResult = mergeDeepRight(student)(teacher)\n  const expected = {\n    age     : 40,\n    name    : 'foo',\n    contact : {\n      a     : 1,\n      email : 'baz@example.com',\n    },\n    songs : { title : 'Remains the same' },\n  }\n\n  expect(result).toEqual(expected)\n  expect(curryResult).toEqual(expected)\n})\n\ntest('issue 650', () =\u003e {\n  expect(Object.keys(mergeDeepRight({ a : () =\u003e {} }, { b : () =\u003e {} }))).toEqual([\n    'a',\n    'b',\n  ])\n})\n\ntest('ramda compatible test 1', () =\u003e {\n  const a = {\n    w : 1,\n    x : 2,\n    y : { z : 3 },\n  }\n  const b = {\n    a : 4,\n    b : 5,\n    c : { d : 6 },\n  }\n  const result = mergeDeepRight(a, b)\n  const expected = {\n    w : 1,\n    x : 2,\n    y : { z : 3 },\n    a : 4,\n    b : 5,\n    c : { d : 6 },\n  }\n\n  expect(result).toEqual(expected)\n})\n\ntest('ramda compatible test 2', () =\u003e {\n  const a = {\n    a : {\n      b : 1,\n      c : 2,\n    },\n    y : 0,\n  }\n  const b = {\n    a : {\n      b : 3,\n      d : 4,\n    },\n    z : 0,\n  }\n  const result = mergeDeepRight(a, b)\n  const expected = {\n    a : {\n      b : 3,\n      c : 2,\n      d : 4,\n    },\n    y : 0,\n    z : 0,\n  }\n\n  expect(result).toEqual(expected)\n})\n\ntest('ramda compatible test 3', () =\u003e {\n  const a = {\n    w : 1,\n    x : { y : 2 },\n  }\n  const result = mergeDeepRight(a, { x : { y : 3 } })\n  const expected = {\n    w : 1,\n    x : { y : 3 },\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('functions are not discarded', () =\u003e {\n  const obj = { foo : () =\u003e {} }\n  expect(typeof mergeDeepRight(obj, {}).foo).toBe('function')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mergeDeepRight} from 'rambda'\n\ninterface Output {\n  foo: {\n    bar: number,\n  },\n}\n\ndescribe('R.mergeDeepRight', () =\u003e {\n  const result = mergeDeepRight\u003cOutput\u003e({foo: {bar: 1}}, {foo: {bar: 2}})\n  result.foo.bar // $ExpectType number\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeDeepRight)\n\n### mergeLeft\n\n```typescript\n\nmergeLeft\u003cOutput\u003e(newProps: object, target: object): Output\n```\n\nSame as `R.merge`, but in opposite direction.\n\n```javascript\nconst result = R.mergeLeft(\n  {a: 10},\n  {a: 1, b: 2}\n)\n// =\u003e {a:10, b: 2}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeLeft\u003cOutput\u003e(newProps: object, target: object): Output;\nmergeLeft\u003cOutput\u003e(newProps: object): (target: object) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeLeft\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { mergeRight } from './mergeRight.js'\n\nexport function mergeLeft(x, y){\n  if (arguments.length === 1) return _y =\u003e mergeLeft(x, _y)\n\n  return mergeRight(y, x)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mergeLeft } from './mergeLeft.js'\n\nconst obj = {\n  foo : 1,\n  bar : 2,\n}\n\ntest('happy', () =\u003e {\n  expect(mergeLeft({ bar : 20 }, obj)).toEqual({\n    foo : 1,\n    bar : 20,\n  })\n})\n\ntest('curry', () =\u003e {\n  expect(mergeLeft({ baz : 3 })(obj)).toEqual({\n    foo : 1,\n    bar : 2,\n    baz : 3,\n  })\n})\n\ntest('when undefined or null instead of object', () =\u003e {\n  expect(mergeLeft(null, undefined)).toEqual({})\n  expect(mergeLeft(obj, null)).toEqual(obj)\n  expect(mergeLeft(obj, undefined)).toEqual(obj)\n  expect(mergeLeft(undefined, obj)).toEqual(obj)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mergeLeft} from 'rambda'\n\ninterface Output {\n  foo: number,\n  bar: number,\n}\n\ndescribe('R.mergeLeft', () =\u003e {\n  const result = mergeLeft\u003cOutput\u003e({foo: 1}, {bar: 2})\n  const curriedResult = mergeLeft\u003cOutput\u003e({foo: 1})({bar: 2})\n\n  result.foo // $ExpectType number\n  result.bar // $ExpectType number\n  curriedResult.bar // $ExpectType number\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeLeft)\n\n### mergeRight\n\n```typescript\n\nmergeRight\u003cA, B\u003e(target: A, newProps: B): A \u0026 B\nexport function mergeRight\u003cOutput\u003e(target: any): (newProps: any) =\u003e Output\n```\n\nIt creates a copy of `target` object with overwritten `newProps` properties. Previously known as `R.merge` but renamed after Ramda did the same.\n\n```javascript\nconst target = { 'foo': 0, 'bar': 1 }\nconst newProps = { 'foo': 7 }\n\nconst result = R.mergeRight(target, newProps)\n// =\u003e { 'foo': 7, 'bar': 1 }\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeRight\u003cA, B\u003e(target: A, newProps: B): A \u0026 B\nmergeRight\u003cOutput\u003e(target: any): (newProps: any) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeRight\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function mergeRight(target, newProps){\n  if (arguments.length === 1)\n    return _newProps =\u003e mergeRight(target, _newProps)\n\n  return Object.assign(\n    {}, target || {}, newProps || {}\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { mergeRight } from './mergeRight.js'\n\nconst obj = {\n  foo : 1,\n  bar : 2,\n}\n\ntest('happy', () =\u003e {\n  expect(mergeRight(obj, { bar : 20 })).toEqual({\n    foo : 1,\n    bar : 20,\n  })\n})\n\ntest('curry', () =\u003e {\n  expect(mergeRight(obj)({ baz : 3 })).toEqual({\n    foo : 1,\n    bar : 2,\n    baz : 3,\n  })\n})\n\n/**\n * https://github.com/selfrefactor/rambda/issues/77\n */\ntest('when undefined or null instead of object', () =\u003e {\n  expect(mergeRight(null, undefined)).toEqual({})\n  expect(mergeRight(obj, null)).toEqual(obj)\n  expect(mergeRight(obj, undefined)).toEqual(obj)\n  expect(mergeRight(undefined, obj)).toEqual(obj)\n})\n\ntest('with function inside object', () =\u003e {\n  const result = mergeRight({ a : 1 }, { b : () =\u003e 1 })\n  expect(typeof result.b).toBe('function')\n})\n\ndescribe('acts as if nil values are simply empty objects', () =\u003e {\n  const a = {\n    w : 1,\n    x : 2,\n  }\n  const b = {\n    w : 100,\n    y : 3,\n    z : 4,\n  }\n\n  it('if the first object is nil', () =\u003e {\n    expect(mergeRight(null, b)).toEqual(b)\n  })\n\n  it('if the second object is nil', () =\u003e {\n    expect(mergeRight(a, undefined)).toEqual(a)\n  })\n\n  it('if both objects are nil', () =\u003e {\n    expect(mergeRight(null, undefined)).toEqual({})\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {mergeRight} from 'rambda'\n\ninterface Output {\n  foo: number,\n  bar: number,\n}\n\ndescribe('R.mergeRight', () =\u003e {\n  const result = mergeRight({foo: 1}, {bar: 2})\n  const curriedResult = mergeRight\u003cOutput\u003e({foo: 1})({bar: 2})\n\n  result.foo // $ExpectType number\n  result.bar // $ExpectType number\n  curriedResult.bar // $ExpectType number\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeRight)\n\n### mergeWith\n\n```typescript\n\nmergeWith(fn: (x: any, z: any) =\u003e any, a: Record\u003cstring, unknown\u003e, b: Record\u003cstring, unknown\u003e): Record\u003cstring, unknown\u003e\n```\n\nIt takes two objects and a function, which will be used when there is an overlap between the keys.\n\n```javascript\nconst result = R.mergeWith(\n  R.concat,\n  {values : [ 10, 20 ]},\n  {values : [ 15, 35 ]}\n)\n// =\u003e [ 10, 20, 15, 35 ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmergeWith(fn: (x: any, z: any) =\u003e any, a: Record\u003cstring, unknown\u003e, b: Record\u003cstring, unknown\u003e): Record\u003cstring, unknown\u003e;\nmergeWith\u003cOutput\u003e(fn: (x: any, z: any) =\u003e any, a: Record\u003cstring, unknown\u003e, b: Record\u003cstring, unknown\u003e): Output;\nmergeWith(fn: (x: any, z: any) =\u003e any, a: Record\u003cstring, unknown\u003e): (b: Record\u003cstring, unknown\u003e) =\u003e Record\u003cstring, unknown\u003e;\nmergeWith\u003cOutput\u003e(fn: (x: any, z: any) =\u003e any, a: Record\u003cstring, unknown\u003e): (b: Record\u003cstring, unknown\u003e) =\u003e Output;\nmergeWith(fn: (x: any, z: any) =\u003e any): \u003cU, V\u003e(a: U, b: V) =\u003e Record\u003cstring, unknown\u003e;\nmergeWith\u003cOutput\u003e(fn: (x: any, z: any) =\u003e any): \u003cU, V\u003e(a: U, b: V) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.mergeWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nexport function mergeWithFn(\n  mergeFn, aInput, bInput\n){\n  const a = aInput ?? {}\n  const b = bInput ?? {}\n  const willReturn = {}\n\n  Object.keys(a).forEach(key =\u003e {\n    if (b[ key ] === undefined) willReturn[ key ] = a[ key ]\n    else willReturn[ key ] = mergeFn(a[ key ], b[ key ])\n  })\n\n  Object.keys(b).forEach(key =\u003e {\n    if (willReturn[ key ] !== undefined) return\n\n    if (a[ key ] === undefined) willReturn[ key ] = b[ key ]\n    else willReturn[ key ] = mergeFn(a[ key ], b[ key ])\n  })\n\n  return willReturn\n}\n\nexport const mergeWith = curry(mergeWithFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { concat } from './concat.js'\nimport { mergeWithFn } from './mergeWith.js'\n\ntest('happy', () =\u003e {\n  const result = mergeWithFn(\n    concat,\n    {\n      a      : true,\n      values : [ 10, 20 ],\n    },\n    {\n      b      : true,\n      values : [ 15, 35 ],\n    }\n  )\n  const expected = {\n    a      : true,\n    b      : true,\n    values : [ 10, 20, 15, 35 ],\n  }\n  expect(result).toEqual(expected)\n})\n\n// https://github.com/ramda/ramda/pull/3222/files#diff-d925d9188b478d2f1d4b26012c6dddac374f9e9d7a336604d654b9a113bfc857\ndescribe('acts as if nil values are simply empty objects', () =\u003e {\n  it('if the first object is nil and the second empty', () =\u003e {\n    expect(mergeWithFn(\n      concat, undefined, {}\n    )).toEqual({})\n  })\n\n  it('if the first object is empty and the second nil', () =\u003e {\n    expect(mergeWithFn(\n      concat, {}, null\n    )).toEqual({})\n  })\n\n  it('if both objects are nil', () =\u003e {\n    expect(mergeWithFn(\n      concat, undefined, null\n    )).toEqual({})\n  })\n\n  it('if the first object is not empty and the second is nil', () =\u003e {\n    expect(mergeWithFn(\n      concat, { a : 'a' }, null\n    )).toEqual({ a : 'a' })\n  })\n\n  it('if the first object is nil and the second is not empty', () =\u003e {\n    expect(mergeWithFn(\n      concat, undefined, { a : 'a' }\n    )).toEqual({ a : 'a' })\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {concat, mergeWith} from 'rambda'\n\ninterface Output {\n  a: boolean,\n  b: boolean,\n  values: number[],\n}\nconst A = {\n  a: true,\n  values: [10, 20],\n}\nconst B = {\n  b: true,\n  values: [15, 35],\n}\n\ndescribe('R.mergeWith', () =\u003e {\n  test('no curry | without explicit types', () =\u003e {\n    const result = mergeWith(concat, A, B)\n    result // $ExpectType Record\u003cstring, unknown\u003e\n  })\n  test('no curry | with explicit types', () =\u003e {\n    const result = mergeWith\u003cOutput\u003e(concat, A, B)\n    result // $ExpectType Output\n  })\n  test('curry 1 | without explicit types', () =\u003e {\n    const result = mergeWith(concat, A)(B)\n    result // $ExpectType Record\u003cstring, unknown\u003e\n  })\n  test('curry 1 | with explicit types', () =\u003e {\n    const result = mergeWith\u003cOutput\u003e(concat, A)(B)\n    result // $ExpectType Output\n  })\n  test('curry 2 | without explicit types', () =\u003e {\n    const result = mergeWith(concat)(A, B)\n    result // $ExpectType Record\u003cstring, unknown\u003e\n  })\n  test('curry 2 | with explicit types', () =\u003e {\n    const result = mergeWith\u003cOutput\u003e(concat)(A, B)\n    result // $ExpectType Output\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#mergeWith)\n\n### min\n\n```typescript\n\nmin\u003cT extends Ord\u003e(x: T, y: T): T\n```\n\nIt returns the lesser value between `x` and `y`.\n\n```javascript\nconst result = [\n  R.min(5, 7),  \n  R.min('bar', 'foo'),  \n]\n// =\u003e [5, 'bar']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmin\u003cT extends Ord\u003e(x: T, y: T): T;\nmin\u003cT extends Ord\u003e(x: T): (y: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.min\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function min(x, y){\n  if (arguments.length === 1) return _y =\u003e min(x, _y)\n\n  return y \u003c x ? y : x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { min } from './min.js'\n\ntest('happy', () =\u003e {\n  expect(min(2, 1)).toBe(1)\n  expect(min(1)(2)).toBe(1)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {min} from 'rambda'\n\nconst first = 1\nconst second = 2\n\ndescribe('R.min', () =\u003e {\n  it('happy', () =\u003e {\n    const result = min(first, second)\n    result // $ExpectType 1 | 2\n  })\n  it('curried', () =\u003e {\n    const result = min(first, second)\n    result // $ExpectType 1 | 2\n  })\n  it('curried - cann pass type', () =\u003e {\n    const result = min\u003cnumber\u003e(first, second)\n    result // $ExpectType number\n  })\n  it('can pass type', () =\u003e {\n    const result = min\u003cnumber\u003e(first, second)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#min)\n\n### minBy\n\n```typescript\n\nminBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T, y: T): T\n```\n\nIt returns the lesser value between `x` and `y` according to `compareFn` function.\n\n```javascript\nconst compareFn = Math.abs\n\nR.minBy(compareFn, -5, 2) // =\u003e -5\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nminBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T, y: T): T;\nminBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord, x: T): (y: T) =\u003e T;\nminBy\u003cT\u003e(compareFn: (input: T) =\u003e Ord): (x: T) =\u003e (y: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.minBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nexport function minByFn(\n  compareFn, x, y\n){\n  return compareFn(y) \u003c compareFn(x) ? y : x\n}\n\nexport const minBy = curry(minByFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { minBy } from './minBy.js'\n\ntest('happy', () =\u003e {\n  expect(minBy(\n    Math.abs, -5, 2\n  )).toBe(2)\n})\n\ntest('curried', () =\u003e {\n  expect(minBy(Math.abs)(2, -5)).toBe(2)\n  expect(minBy(Math.abs)(2)(-5)).toBe(2)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {minBy} from 'rambda'\n\nconst compareFn = (x: number) =\u003e x % 2 === 0 ? 1 : -1\nconst first = 1\nconst second = 2\n\ndescribe('R.minBy', () =\u003e {\n  it('happy', () =\u003e {\n    const result = minBy(compareFn, first, second)\n    result // $ExpectType 1 | 2\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#minBy)\n\n### modify\n\n```typescript\n\nmodify\u003cK extends PropertyKey, T\u003e(prop: K, fn: (value: T) =\u003e T): \u003cU extends Record\u003cK, T\u003e\u003e(object: U) =\u003e U\n```\n\n```javascript\nconst result = R.modify()\n// =\u003e\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmodify\u003cK extends PropertyKey, T\u003e(prop: K, fn: (value: T) =\u003e T): \u003cU extends Record\u003cK, T\u003e\u003e(object: U) =\u003e U;\nmodify\u003cU, K extends keyof U\u003e(prop: K, fn: (value: U[K]) =\u003e U[K], object: U): U;\nmodify\u003cK extends PropertyKey\u003e(prop: K): {\n  \u003cT\u003e(fn: (value: T) =\u003e T): \u003cU extends Record\u003cK, T\u003e\u003e(object: U) =\u003e U;\n  \u003cT, U extends Record\u003cK, T\u003e\u003e(fn: (value: T) =\u003e T, object: U): U;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.modify\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { isIterable } from './_internals/isIterable.js'\nimport { curry } from './curry.js'\nimport { updateFn } from './update.js'\n\nfunction modifyFn(\n  property, fn, iterable\n){\n  if (!isIterable(iterable)) return iterable\n  if (iterable[ property ] === undefined) return iterable\n  if (isArray(iterable)){\n    return updateFn(\n      property, fn(iterable[ property ]), iterable\n    )\n  }\n\n  return {\n    ...iterable,\n    [ property ] : fn(iterable[ property ]),\n  }\n}\n\nexport const modify = curry(modifyFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { modify as modifyRamda } from 'ramda'\n\nimport { compareCombinations, FALSY_VALUES } from './_internals/testUtils.js'\nimport { add } from './add.js'\nimport { compose } from './compose.js'\nimport { modify } from './modify.js'\n\nconst person = {\n  name : 'foo',\n  age  : 20,\n}\n\ntest('happy', () =\u003e {\n  expect(modify(\n    'age', x =\u003e x + 1, person\n  )).toEqual({\n    name : 'foo',\n    age  : 21,\n  })\n})\n\ntest('property is missing', () =\u003e {\n  expect(modify(\n    'foo', x =\u003e x + 1, person\n  )).toEqual(person)\n})\n\ntest('adjust if `array` at the given key with the `transformation` function', () =\u003e {\n  expect(modify(\n    1, add(1), [ 100, 1400 ]\n  )).toEqual([ 100, 1401 ])\n})\n\ndescribe('ignores transformations if the input value is not Array and Object', () =\u003e {\n  ;[ 42, undefined, null, '' ].forEach(value =\u003e {\n    it(`${ value }`, () =\u003e {\n      expect(modify(\n        'a', add(1), value\n      )).toEqual(value)\n    })\n  })\n})\n\nconst possibleProperties = [ ...FALSY_VALUES, 'foo', 0 ]\nconst possibleTransformers = [\n  ...FALSY_VALUES,\n  add(1),\n  add('foo'),\n  compose,\n  String,\n]\nconst possibleObjects = [\n  ...FALSY_VALUES,\n  {},\n  [ 1, 2, 3 ],\n  {\n    a   : 1,\n    foo : 2,\n  },\n  {\n    a   : 1,\n    foo : [ 1 ],\n  },\n  {\n    a   : 1,\n    foo : 'bar',\n  },\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : modify,\n    fnRamda     : modifyRamda,\n    firstInput  : possibleProperties,\n    secondInput : possibleTransformers,\n    thirdInput  : possibleObjects,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 630,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport { add, identity, map, modify, pipe, toUpper } from 'rambda';\n\ntype Obj = {\n\tfoo: string;\n\tbar: number;\n};\n\ndescribe('R.modify', () =\u003e {\n\tit('ramda tests', () =\u003e {\n\t\tconst result1 = modify('foo', toUpper, {} as Obj);\n\t\tresult1; // $ExpectType Obj\n\n\t\tconst result2 = modify('bar', add(1), {} as Obj);\n\t\tresult2; // $ExpectType Obj\n\n\t\tconst result3 = modify('foo', toUpper)({} as Obj);\n\t\tresult3; // $ExpectType Obj\n\n\t\tconst result4 = modify('bar', add(1))({} as Obj);\n\t\tresult4; // $ExpectType Obj\n\n\t\tconst result5 = modify('foo')(toUpper)({} as Obj);\n\t\tresult5; // $ExpectType Obj\n\n\t\tconst result6 = modify('bar')(add(1))({} as Obj);\n\t\tresult6; // $ExpectType Obj\n\n\t\tconst result7 = modify('foo')(toUpper, {} as Obj);\n\t\tresult7; // $ExpectType Obj\n\n\t\tconst result8 = modify('bar')(add(1), {} as Obj);\n\t\tresult8; // $ExpectType Obj\n\n\t\tconst result9 = modify('foo', identity, {} as Obj);\n\t\tresult9; // $ExpectType Obj\n\n\t\t// @ts-expect-error\n\t\tmodify('foo', add(1), {} as Obj);\n\t\t// @ts-expect-error\n\t\tmodify('bar', toUpper, {} as Obj);\n\n\t\tconst f = pipe(map\u003cObj, Obj\u003e(modify('foo', toUpper)));\n\n\t\tf([] as Obj[]); // $ExpectType Obj[]\n\t});\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#modify)\n\n### modifyPath\n\n```typescript\n\nmodifyPath\u003cT extends Record\u003cstring, unknown\u003e\u003e(path: Path, fn: (x: any) =\u003e unknown, object: Record\u003cstring, unknown\u003e): T\n```\n\nIt changes a property of object on the base of provided path and transformer function.\n\n```javascript\nconst result = R.modifyPath('a.b.c', x=\u003e x+1, {a:{b: {c:1}}})\n// =\u003e {a:{b: {c:2}}}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmodifyPath\u003cT extends Record\u003cstring, unknown\u003e\u003e(path: Path, fn: (x: any) =\u003e unknown, object: Record\u003cstring, unknown\u003e): T;\nmodifyPath\u003cT extends Record\u003cstring, unknown\u003e\u003e(path: Path, fn: (x: any) =\u003e unknown): (object: Record\u003cstring, unknown\u003e) =\u003e T;\nmodifyPath\u003cT extends Record\u003cstring, unknown\u003e\u003e(path: Path): (fn: (x: any) =\u003e unknown) =\u003e (object: Record\u003cstring, unknown\u003e) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.modifyPath\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from './_internals/createPath.js'\nimport { isArray } from './_internals/isArray.js'\nimport { assoc } from './assoc.js'\nimport { curry } from './curry.js'\nimport { path as pathModule } from './path.js'\n\nexport function modifyPathFn(\n  pathInput, fn, object\n){\n  const path = createPath(pathInput)\n  if (path.length === 1){\n    return {\n      ...object,\n      [ path[ 0 ] ] : fn(object[ path[ 0 ] ]),\n    }\n  }\n  if (pathModule(path, object) === undefined) return object\n\n  const val = modifyPath(\n    Array.prototype.slice.call(path, 1),\n    fn,\n    object[ path[ 0 ] ]\n  )\n  if (val === object[ path[ 0 ] ]){\n    return object\n  }\n\n  return assoc(\n    path[ 0 ], val, object\n  )\n}\n\nexport const modifyPath = curry(modifyPathFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { modifyPath } from './modifyPath.js'\n\ntest('happy', () =\u003e {\n  const result = modifyPath(\n    'a.b.c', x =\u003e x + 1, { a : { b : { c : 1 } } }\n  )\n  expect(result).toEqual({ a : { b : { c : 2 } } })\n})\n\ntest('with array', () =\u003e {\n  const input = { foo : [ { bar : '123' } ] }\n  const result = modifyPath(\n    'foo.0.bar', x =\u003e x + 'foo', input\n  )\n  expect(result).toEqual({ foo : { 0 : { bar : '123foo' } } })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {modifyPath} from 'rambda'\n\nconst obj = {a: {b: {c: 1}}}\n\ndescribe('R.modifyPath', () =\u003e {\n  it('happy', () =\u003e {\n    const result = modifyPath('a.b.c', (x: number) =\u003e x + 1, obj)\n    result // $ExpectType Record\u003cstring, unknown\u003e\n  })\n  it('explicit return type', () =\u003e {\n    interface Foo extends Record\u003cstring, unknown\u003e {\n      a: 1,\n    }\n    const result = modifyPath\u003cFoo\u003e('a.b.c', (x: number) =\u003e x + 1, obj)\n    result // $ExpectType Foo\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#modifyPath)\n\n### modulo\n\n```typescript\n\nmodulo(x: number, y: number): number\n```\n\nCurried version of `x%y`.\n\n```javascript\nR.modulo(17, 3) // =\u003e 2\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmodulo(x: number, y: number): number;\nmodulo(x: number): (y: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.modulo\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function modulo(x, y){\n  if (arguments.length === 1) return _y =\u003e modulo(x, _y)\n\n  return x % y\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { modulo } from './modulo.js'\n\ntest('happy', () =\u003e {\n  expect(modulo(17, 3)).toBe(2)\n  expect(modulo(15)(6)).toBe(3)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {modulo} from 'rambda'\n\ndescribe('R.modulo', () =\u003e {\n  it('happy', () =\u003e {\n    const result = modulo(4, 1)\n\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = modulo(4)(1)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#modulo)\n\n### move\n\n```typescript\n\nmove\u003cT\u003e(fromIndex: number, toIndex: number, list: T[]): T[]\n```\n\nIt returns a copy of `list` with exchanged `fromIndex` and `toIndex` elements.\n\n\u003e :boom: Rambda.move doesn't support negative indexes - it throws an error.\n\n```javascript\nconst list = [1, 2, 3]\nconst result = R.move(0, 1, list)\n// =\u003e [2, 1, 3]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmove\u003cT\u003e(fromIndex: number, toIndex: number, list: T[]): T[];\nmove(fromIndex: number, toIndex: number): \u003cT\u003e(list: T[]) =\u003e T[];\nmove(fromIndex: number): {\n    \u003cT\u003e(toIndex: number, list: T[]): T[];\n    (toIndex: number): \u003cT\u003e(list: T[]) =\u003e T[];\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.move\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { curry } from './curry.js'\n\nfunction moveFn(\n  fromIndex, toIndex, list\n){\n  if (fromIndex \u003c 0 || toIndex \u003c 0){\n    throw new Error('Rambda.move does not support negative indexes')\n  }\n  if (fromIndex \u003e list.length - 1 || toIndex \u003e list.length - 1) return list\n\n  const clone = cloneList(list)\n  clone[ fromIndex ] = list[ toIndex ]\n  clone[ toIndex ] = list[ fromIndex ]\n\n  return clone\n}\n\nexport const move = curry(moveFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { move } from './move.js'\nconst list = [ 1, 2, 3, 4 ]\n\ntest('happy', () =\u003e {\n  const result = move(\n    0, 1, list\n  )\n\n  expect(result).toEqual([ 2, 1, 3, 4 ])\n})\n\ntest('with negative index', () =\u003e {\n  const errorMessage = 'Rambda.move does not support negative indexes'\n  expect(() =\u003e move(\n    0, -1, list\n  )).toThrowErrorMatchingInlineSnapshot('\"Rambda.move does not support negative indexes\"')\n  expect(() =\u003e move(\n    -1, 0, list\n  )).toThrowErrorMatchingInlineSnapshot('\"Rambda.move does not support negative indexes\"')\n})\n\ntest('when indexes are outside the list outbounds', () =\u003e {\n  const result1 = move(\n    10, 1, list\n  )\n  const result2 = move(\n    1, 10, list\n  )\n\n  expect(result1).toEqual(list)\n  expect(result2).toEqual(list)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {move} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.move', () =\u003e {\n  it('happy', () =\u003e {\n    const result = move(0, 1, list)\n\n    result // $ExpectType number[]\n  })\n  it('curried 1', () =\u003e {\n    const result = move(0, 1)(list)\n\n    result // $ExpectType number[]\n  })\n  it('curried 2', () =\u003e {\n    const result = move(0)(1)(list)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#move)\n\n### multiply\n\n```typescript\n\nmultiply(x: number, y: number): number\n```\n\nCurried version of `x*y`.\n\n```javascript\nR.multiply(2, 4) // =\u003e 8\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nmultiply(x: number, y: number): number;\nmultiply(x: number): (y: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.multiply\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function multiply(x, y){\n  if (arguments.length === 1) return _y =\u003e multiply(x, _y)\n\n  return x * y\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { multiply } from './multiply.js'\n\ntest('happy', () =\u003e {\n  expect(multiply(2, 4)).toBe(8)\n  expect(multiply(2)(4)).toBe(8)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {multiply} from 'rambda'\n\ndescribe('R.multiply', () =\u003e {\n  it('happy', () =\u003e {\n    const result = multiply(4, 1)\n\n    result // $ExpectType number\n  })\n  it('curried', () =\u003e {\n    const result = multiply(4)(1)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#multiply)\n\n### negate\n\n```typescript\n\nnegate(x: number): number\n```\n\n```javascript\nR.negate(420)// =\u003e -420\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nnegate(x: number): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.negate\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function negate(x){\n  return -x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { negate } from './negate.js'\n\ntest('negate', () =\u003e {\n  expect(negate(420)).toBe(-420)\n  expect(negate(-13)).toBe(13)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#negate)\n\n### none\n\n```typescript\n\nnone\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean\n```\n\nIt returns `true`, if all members of array `list` returns `false`, when applied as argument to `predicate` function.\n\n```javascript\nconst list = [ 0, 1, 2, 3, 4 ]\nconst predicate = x =\u003e x \u003e 6\n\nconst result = R.none(predicate, arr)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nnone\u003cT\u003e(predicate: (x: T) =\u003e boolean, list: T[]): boolean;\nnone\u003cT\u003e(predicate: (x: T) =\u003e boolean): (list: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.none\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function none(predicate, list){\n  if (arguments.length === 1) return _list =\u003e none(predicate, _list)\n\n  for (let i = 0; i \u003c list.length; i++){\n    if (predicate(list[ i ])) return false\n  }\n\n  return true\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { none } from './none.js'\n\nconst isEven = n =\u003e n % 2 === 0\n\ntest('when true', () =\u003e {\n  expect(none(isEven, [ 1, 3, 5, 7 ])).toBeTrue()\n})\n\ntest('when false curried', () =\u003e {\n  expect(none(input =\u003e input \u003e 1, [ 1, 2, 3 ])).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {none} from 'rambda'\n\ndescribe('R.none', () =\u003e {\n  it('happy', () =\u003e {\n    const result = none(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 0\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType boolean\n  })\n  it('curried needs a type', () =\u003e {\n    const result = none\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 0\n    })([1, 2, 3])\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#none)\n\n### not\n\n```typescript\n\nnot(input: any): boolean\n```\n\nIt returns a boolean negated version of `input`.\n\n```javascript\nR.not(false) // true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nnot(input: any): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.not\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function not(input){\n  return !input\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { not } from './not.js'\n\ntest('not', () =\u003e {\n  expect(not(false)).toBeTrue()\n  expect(not(true)).toBeFalse()\n  expect(not(0)).toBeTrue()\n  expect(not(1)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {not} from 'rambda'\n\ndescribe('R.not', () =\u003e {\n  it('happy', () =\u003e {\n    const result = not(4)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#not)\n\n### nth\n\n```typescript\n\nnth(index: number, input: string): string\n```\n\nCurried version of `input[index]`.\n\n```javascript\nconst list = [1, 2, 3]\nconst str = 'foo'\n\nconst result = [\n  R.nth(2, list),\n  R.nth(6, list),\n  R.nth(0, str),\n]\n// =\u003e [3, undefined, 'f']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nnth(index: number, input: string): string;\t\nnth\u003cT\u003e(index: number, input: T[]): T | undefined;\t\nnth(n: number): {\n  \u003cT\u003e(input: T[]): T | undefined;\n  (input: string): string;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.nth\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function nth(index, input){\n  if (arguments.length === 1) return _input =\u003e nth(index, _input)\n\n  const idx = index \u003c 0 ? input.length + index : index\n\n  return Object.prototype.toString.call(input) === '[object String]' ?\n    input.charAt(idx) :\n    input[ idx ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { nth } from './nth.js'\n\ntest('happy', () =\u003e {\n  expect(nth(2, [ 1, 2, 3, 4 ])).toBe(3)\n})\n\ntest('with curry', () =\u003e {\n  expect(nth(2)([ 1, 2, 3, 4 ])).toBe(3)\n})\n\ntest('with string and correct index', () =\u003e {\n  expect(nth(2)('foo')).toBe('o')\n})\n\ntest('with string and invalid index', () =\u003e {\n  expect(nth(20)('foo')).toBe('')\n})\n\ntest('with negative index', () =\u003e {\n  expect(nth(-3)([ 1, 2, 3, 4 ])).toBe(2)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {nth} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.nth', () =\u003e {\n  it('happy', () =\u003e {\n    const result = nth(4, list)\n\n    result // $ExpectType number | undefined\n  })\n  it('curried', () =\u003e {\n    const result = nth(1)(list)\n\n    result // $ExpectType number | undefined\n  })\n})\n\ndescribe('R.nth - string', () =\u003e {\n  const str = 'abc'\n  it('happy', () =\u003e {\n    const result = nth(4, str)\n\n    result // $ExpectType string\n  })\n  it('curried', () =\u003e {\n    const result = nth(1)(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#nth)\n\n### objOf\n\n```typescript\n\nobjOf\u003cT, K extends string\u003e(key: K, value: T): Record\u003cK, T\u003e\n```\n\nIt creates an object with a single key-value pair.\n\n```javascript\nconst result = R.objOf('foo', 'bar')\n// =\u003e {foo: 'bar'}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nobjOf\u003cT, K extends string\u003e(key: K, value: T): Record\u003cK, T\u003e;\nobjOf\u003cK extends string\u003e(key: K): \u003cT\u003e(value: T) =\u003e Record\u003cK, T\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.objOf\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function objOf(key, value){\n  if (arguments.length === 1){\n    return _value =\u003e objOf(key, _value)\n  }\n\n  return { [ key ] : value }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { objOf as objOfRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { objOf } from './objOf.js'\n\ntest('happy', () =\u003e {\n  expect(objOf('foo', 42)).toEqual({ foo : 42 })\n})\n\ntest('with bad inputs', () =\u003e {\n  expect(objOf(null, undefined)).toEqual({ null : undefined })\n})\n\ntest('curried', () =\u003e {\n  expect(objOf('foo')(42)).toEqual({ foo : 42 })\n})\n\ndescribe('brute force', () =\u003e {\n  const possibleInputs = [ 0, 1, null, undefined, [], {} ]\n\n  compareCombinations({\n    firstInput  : possibleInputs,\n    secondInput : possibleInputs,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 36,\n        }\n      `)\n    },\n    fn      : objOf,\n    fnRamda : objOfRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {objOf} from 'rambda'\n\nconst key = 'foo'\nconst value = 42\n\ndescribe('R.objOf', () =\u003e {\n  it('happy', () =\u003e {\n    const result = objOf(key, value)\n\n    result.foo // $ExpectType number\n\n    // @ts-expect-error\n    result.bar\n  })\n  it('curried', () =\u003e {\n    const result = objOf(key)(value)\n\n    result.foo // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#objOf)\n\n### of\n\n```typescript\n\nof\u003cT\u003e(x: T): T[]\n```\n\n```javascript\nR.of(null); // =\u003e [null]\nR.of([42]); // =\u003e [[42]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nof\u003cT\u003e(x: T): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.of\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function of(value){\n  return [ value ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { of } from './of.js'\n\ntest('happy', () =\u003e {\n  expect(of(3)).toEqual([ 3 ])\n\n  expect(of(null)).toEqual([ null ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {of} from 'rambda'\n\nconst list = [1, 2, 3]\n\ndescribe('R.of', () =\u003e {\n  it('happy', () =\u003e {\n    const result = of(4)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = of(list)\n\n    result // $ExpectType number[][]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#of)\n\n### omit\n\n```typescript\n\nomit\u003cT, K extends string\u003e(propsToOmit: K[], obj: T): Omit\u003cT, K\u003e\n```\n\nIt returns a partial copy of an `obj` without `propsToOmit` properties.\n\n\u003e :boom: When using this method with `TypeScript`, it is much easier to pass `propsToOmit` as an array. If passing a string, you will need to explicitly declare the output type.\n\n```javascript\nconst obj = {a: 1, b: 2, c: 3}\nconst propsToOmit = 'a,c,d'\nconst propsToOmitList = ['a', 'c', 'd']\n\nconst result = [\n  R.omit(propsToOmit, Record\u003cstring, unknown\u003e), \n  R.omit(propsToOmitList, Record\u003cstring, unknown\u003e) \n]\n// =\u003e [{b: 2}, {b: 2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nomit\u003cT, K extends string\u003e(propsToOmit: K[], obj: T): Omit\u003cT, K\u003e;\nomit\u003cK extends string\u003e(propsToOmit: K[]): \u003cT\u003e(obj: T) =\u003e Omit\u003cT, K\u003e;\nomit\u003cT, U\u003e(propsToOmit: string, obj: T): U;\nomit\u003cT, U\u003e(propsToOmit: string): (obj: T) =\u003e U;\nomit\u003cT\u003e(propsToOmit: string, obj: object): T;\nomit\u003cT\u003e(propsToOmit: string): (obj: object) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.omit\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from './_internals/createPath.js'\nimport { includes } from './_internals/includes.js'\n\nexport function omit(propsToOmit, obj){\n  if (arguments.length === 1) return _obj =\u003e omit(propsToOmit, _obj)\n\n  if (obj === null || obj === undefined)\n    return undefined\n\n  const propsToOmitValue = createPath(propsToOmit, ',')\n  const willReturn = {}\n\n  for (const key in obj)\n    if (!includes(key, propsToOmitValue))\n      willReturn[ key ] = obj[ key ]\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { omit } from './omit.js'\n\ntest('with string as condition', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n    c : 3,\n  }\n  const result = omit('a,c', obj)\n  const resultCurry = omit('a,c')(obj)\n  const expectedResult = { b : 2 }\n\n  expect(result).toEqual(expectedResult)\n  expect(resultCurry).toEqual(expectedResult)\n})\n\ntest.only('with number as property to omit', () =\u003e {\n  const obj = {\n    1 : 1,\n    b : 2,\n  }\n  const result = omit([ 1 ], obj)\n  expect(result).toEqual({ b : 2 })\n})\n\ntest('with null', () =\u003e {\n  expect(omit('a,b', null)).toBeUndefined()\n})\n\ntest('happy', () =\u003e {\n  expect(omit([ 'a', 'c' ])({\n    a : 'foo',\n    b : 'bar',\n    c : 'baz',\n  })).toEqual({ b : 'bar' })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {omit} from 'rambda'\n\ndescribe('R.omit with array as props input', () =\u003e {\n  it('allow Typescript to infer object type', () =\u003e {\n    const input = {a: 'foo', b: 2, c: 3, d: 4}\n    const result = omit(['b,c'], input)\n\n    result.a // $ExpectType string\n    result.d // $ExpectType number\n\n    const curriedResult = omit(['a,c'], input)\n\n    curriedResult.a // $ExpectType string\n    curriedResult.d // $ExpectType number\n  })\n\n  it('declare type of input object', () =\u003e {\n    interface Input {\n      a: string,\n      b: number,\n      c: number,\n      d: number,\n    }\n    const input: Input = {a: 'foo', b: 2, c: 3, d: 4}\n    const result = omit(['b,c'], input)\n    result // $ExpectType Omit\u003cInput, \"b,c\"\u003e\n\n    result.a // $ExpectType string\n    result.d // $ExpectType number\n\n    const curriedResult = omit(['a,c'], input)\n\n    curriedResult.a // $ExpectType string\n    curriedResult.d // $ExpectType number\n  })\n})\n\ndescribe('R.omit with string as props input', () =\u003e {\n  interface Output {\n    b: number,\n    d: number,\n  }\n\n  it('explicitly declare output', () =\u003e {\n    const result = omit\u003cOutput\u003e('a,c', {a: 1, b: 2, c: 3, d: 4})\n    result // $ExpectType Output\n    result.b // $ExpectType number\n\n    const curriedResult = omit\u003cOutput\u003e('a,c')({a: 1, b: 2, c: 3, d: 4})\n\n    curriedResult.b // $ExpectType number\n  })\n\n  it('explicitly declare input and output', () =\u003e {\n    interface Input {\n      a: number,\n      b: number,\n      c: number,\n      d: number,\n    }\n    const result = omit\u003cInput, Output\u003e('a,c', {a: 1, b: 2, c: 3, d: 4})\n    result // $ExpectType Output\n    result.b // $ExpectType number\n\n    const curriedResult = omit\u003cInput, Output\u003e('a,c')({\n      a: 1,\n      b: 2,\n      c: 3,\n      d: 4,\n    })\n\n    curriedResult.b // $ExpectType number\n  })\n\n  it('without passing type', () =\u003e {\n    const result = omit('a,c', {a: 1, b: 2, c: 3, d: 4})\n    result // $ExpectType unknown\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#omit)\n\n### on\n\n```typescript\n\non\u003cT, U, R\u003e(binaryFn: (a: U, b: U) =\u003e R, unaryFn: (value: T) =\u003e U, a: T, b: T): R\n```\n\nIt passes the two inputs through `unaryFn` and then the results are passed as inputs the the `binaryFn` to receive the final result(`binaryFn(unaryFn(FIRST_INPUT), unaryFn(SECOND_INPUT))`). \n\nThis method is also known as P combinator.\n\n```javascript\nconst result = R.on((a, b) =\u003e a + b, R.prop('a'), {b:0, a:1}, {a:2})\n// =\u003e 3\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\non\u003cT, U, R\u003e(binaryFn: (a: U, b: U) =\u003e R, unaryFn: (value: T) =\u003e U, a: T, b: T): R;\non\u003cT, U, R\u003e(binaryFn: (a: U, b: U) =\u003e R, unaryFn: (value: T) =\u003e U, a: T): (b: T) =\u003e R;\non\u003cT, U, R\u003e(binaryFn: (a: U, b: U) =\u003e R, unaryFn: (value: T) =\u003e U): {\n    (a: T, b: T): R;\n    (a: T): (b: T) =\u003e R;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.on\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function on(\n  binaryFn, unaryFn, a, b\n){\n  if (arguments.length === 3){\n    return _b =\u003e on(\n      binaryFn, unaryFn, a, _b\n    )\n  }\n  if (arguments.length === 2){\n    return (_a, _b) =\u003e on(\n      binaryFn, unaryFn, _a, _b\n    )\n  }\n\n  return binaryFn(unaryFn(a), unaryFn(b))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { on } from './on.js'\n\nconst binaryFn = (a, b) =\u003e a === b\nconst unaryFn = x =\u003e x.a\nconst a = {\n  b : 0,\n  a : 1,\n}\nconst b = { a : 1 }\n\ntest('happy', () =\u003e {\n  expect(on(\n    binaryFn, unaryFn, a, b\n  )).toBeTrue()\n})\n\ntest('return type is not limited to boolean', () =\u003e {\n  expect(on(\n    binaryFn, unaryFn, a, b\n  )).toBeTrue()\n})\n\ntest('curried - last input', () =\u003e {\n  expect(on(\n    binaryFn, unaryFn, a\n  )(b)).toBeTrue()\n})\n\ntest('curried - last two inputs', () =\u003e {\n  expect(on(binaryFn, unaryFn)(a, b)).toBeTrue()\n})\n\ntest('not supported curried case', () =\u003e {\n  expect(() =\u003e\n    on(binaryFn, unaryFn)(a)(b)).toThrowErrorMatchingInlineSnapshot('\"Cannot read properties of undefined (reading \\'a\\')\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {on} from 'rambda'\n\nconst binaryFn = (a: number, b: number) =\u003e a === b\nconst unaryFn = (x: {a: number}) =\u003e x.a\nconst a = {\n  b: 0,\n  a: 1,\n}\nconst b = {a: 1}\n\ndescribe('R.on', () =\u003e {\n  it('with boolean as result', () =\u003e {\n    const result = on(binaryFn, unaryFn, a, b)\n\n    result // $ExpectType boolean\n  })\n  it('with number as result', () =\u003e {\n    const result = on((a: number, b: number) =\u003e a + b, unaryFn, a, b)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#on)\n\n### once\n\n```typescript\n\nonce\u003cT extends AnyFunction, C = unknown\u003e(fn: T, context?: C): T\n```\n\nIt returns a function, which invokes only once `fn` function.\n\n```javascript\nlet result = 0\nconst addOnce = R.once((x) =\u003e result = result + x)\n\naddOnce(1)\naddOnce(1)\n// =\u003e 1\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nonce\u003cT extends AnyFunction, C = unknown\u003e(fn: T, context?: C): T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.once\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction onceFn(fn, context){\n  let result\n\n  return function (){\n    if (fn){\n      result = fn.apply(context || this, arguments)\n      fn = null\n    }\n\n    return result\n  }\n}\n\nexport function once(fn, context){\n  if (arguments.length === 1){\n    const wrap = onceFn(fn, context)\n\n    return curry(wrap)\n  }\n\n  return onceFn(fn, context)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { once } from './once.js'\n\ntest('with counter', () =\u003e {\n  let counter = 0\n  const runOnce = once(x =\u003e {\n    counter++\n\n    return x + 2\n  })\n  expect(runOnce(1)).toBe(3)\n  runOnce(1)\n  runOnce(1)\n  runOnce(1)\n  expect(counter).toBe(1)\n})\n\ntest('happy path', () =\u003e {\n  const addOneOnce = once((\n    a, b, c\n  ) =\u003e a + b + c, 1)\n\n  expect(addOneOnce(\n    10, 20, 30\n  )).toBe(60)\n  expect(addOneOnce(40)).toBe(60)\n})\n\ntest('with context', () =\u003e {\n  const context = { name: 'fris' }\n  const getNameOnce = once(function (){\n    return this.name\n  }, context)\n\n  expect(getNameOnce()).toBe('fris')\n  expect(getNameOnce()).toBe('fris')\n  expect(getNameOnce()).toBe('fris')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {once} from 'rambda'\n\ndescribe('R.once', () =\u003e {\n  it('happy', () =\u003e {\n    const runOnce = once((x: number) =\u003e {\n      return x + 2\n    })\n\n    const result = runOnce(1)\n    result // $ExpectType number\n  })\n  it('with context', () =\u003e {\n    const runOnce = once(function (this: any, x: number) {\n      return x + 2\n    })\n\n    const result = runOnce.call({}, 1)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#once)\n\n### or\n\n```typescript\n\nor\u003cT, U\u003e(a: T, b: U): T | U\n```\n\nLogical OR\n\n```javascript\nR.or(false, true); // =\u003e true\nR.or(false, false); // =\u003e false\nR.or(false, 'foo'); // =\u003e 'foo'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nor\u003cT, U\u003e(a: T, b: U): T | U;\nor\u003cT\u003e(a: T): \u003cU\u003e(b: U) =\u003e T | U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.or\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function or(a, b){\n  if (arguments.length === 1) return _b =\u003e or(a, _b)\n\n  return a || b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { or } from './or.js'\n\ntest('happy', () =\u003e {\n  expect(or(0, 'foo')).toBe('foo')\n  expect(or(true, true)).toBeTrue()\n  expect(or(false)(true)).toBeTrue()\n  expect(or(false, false)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {or} from 'rambda'\n\ndescribe('R.or', () =\u003e {\n  it('happy', () =\u003e {\n    const result = or(true, false)\n    result // $ExpectType boolean\n  })\n  it('with falsy value as first input', () =\u003e {\n    const result = or('', false)\n    result // $ExpectType false | \"\"\n  })\n  it('curried', () =\u003e {\n    const result = or(1)('foo')\n    result // $ExpectType number | \"foo\"\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#or)\n\n### over\n\n```typescript\n\nover\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): {\n  (fn: (a: A) =\u003e A): (value: S) =\u003e S\n```\n\nIt returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.\n\n```javascript\nconst headLens = R.lensIndex(0)\n \nR.over(headLens, R.toUpper, ['foo', 'bar', 'baz']) // =\u003e ['FOO', 'bar', 'baz']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nover\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): {\n  (fn: (a: A) =\u003e A): (value: S) =\u003e S;\n  (fn: (a: A) =\u003e A, value: S): S;\n};\nover\u003cS, A\u003e(lens: Lens\u003cS, A\u003e, fn: (a: A) =\u003e A): (value: S) =\u003e S;\nover\u003cS, A\u003e(lens: Lens\u003cS, A\u003e, fn: (a: A) =\u003e A, value: S): S;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.over\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nconst Identity = x =\u003e ({\n  x,\n  map : fn =\u003e Identity(fn(x)),\n})\n\nfunction overFn(\n  lens, fn, object\n){\n  return lens(x =\u003e Identity(fn(x)))(object).x\n}\n\nexport const over = curry(overFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { assoc } from './assoc.js'\nimport { lens } from './lens.js'\nimport { lensIndex } from './lensIndex.js'\nimport { lensPath } from './lensPath.js'\nimport { over } from './over.js'\nimport { prop } from './prop.js'\nimport { toUpper } from './toUpper.js'\n\nconst testObject = {\n  foo : 'bar',\n  baz : {\n    a : 'x',\n    b : 'y',\n  },\n}\n\ntest('assoc lens', () =\u003e {\n  const assocLens = lens(prop('foo'), assoc('foo'))\n  const result = over(\n    assocLens, toUpper, testObject\n  )\n  const expected = {\n    ...testObject,\n    foo : 'BAR',\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('path lens', () =\u003e {\n  const pathLens = lensPath('baz.a')\n  const result = over(\n    pathLens, toUpper, testObject\n  )\n  const expected = {\n    ...testObject,\n    baz : {\n      a : 'X',\n      b : 'y',\n    },\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('index lens', () =\u003e {\n  const indexLens = lensIndex(0)\n  const result = over(indexLens, toUpper)([ 'foo', 'bar' ])\n  expect(result).toEqual([ 'FOO', 'bar' ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#over)\n\n### partial\n\n```typescript\n\npartial\u003cV0, V1, T\u003e(fn: (x0: V0, x1: V1) =\u003e T, args: [V0]): (x1: V1) =\u003e T\n```\n\nIt is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.\n\n`R.partial` will keep returning a function until all the arguments that the function `fn` expects are passed.\nThe name comes from the fact that you partially inject the inputs.\n\n\u003e :boom: Rambda's partial doesn't need the input arguments to be wrapped as array.\n\n```javascript\nconst fn = (title, firstName, lastName) =\u003e {\n  return title + ' ' + firstName + ' ' + lastName + '!'\n}\n\nconst canPassAnyNumberOfArguments = R.partial(fn, 'Hello')\nconst ramdaStyle = R.partial(fn, ['Hello'])\n\nconst finalFn = canPassAnyNumberOfArguments('Foo')\n\nfinalFn('Bar') // =\u003e  'Hello, Foo Bar!'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npartial\u003cV0, V1, T\u003e(fn: (x0: V0, x1: V1) =\u003e T, args: [V0]): (x1: V1) =\u003e T;\npartial\u003cV0, V1, V2, T\u003e(fn: (x0: V0, x1: V1, x2: V2) =\u003e T, args: [V0, V1]): (x2: V2) =\u003e T;\npartial\u003cV0, V1, V2, T\u003e(fn: (x0: V0, x1: V1, x2: V2) =\u003e T, args: [V0]): (x1: V1, x2: V2) =\u003e T;\npartial\u003cV0, V1, V2, V3, T\u003e(\n  fn: (x0: V0, x1: V1, x2: V2, x3: V3) =\u003e T,\n  args: [V0, V1, V2],\n): (x2: V3) =\u003e T;\npartial\u003cV0, V1, V2, V3, T\u003e(\n  fn: (x0: V0, x1: V1, x2: V2, x3: V3) =\u003e T,\n  args: [V0, V1],\n): (x2: V2, x3: V3) =\u003e T;\npartial\u003cV0, V1, V2, V3, T\u003e(\n  fn: (x0: V0, x1: V1, x2: V2, x3: V3) =\u003e T,\n  args: [V0],\n): (x1: V1, x2: V2, x3: V3) =\u003e T;\npartial\u003cT\u003e(fn: (...a: any[]) =\u003e T, args: any[]): (...a: any[]) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.partial\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function partial(fn, ...args){\n  const len = fn.length\n\n  // If a single array argument is given, those are the args (a la Ramda).\n  // Otherwise, the variadic arguments are the args.\n  const argList = args.length === 1 \u0026\u0026 isArray(args[0]) ? args[0] : args\n\n  return (...rest) =\u003e {\n    if (argList.length + rest.length \u003e= len){\n      return fn(...argList, ...rest)\n    }\n\n    return partial(fn, ...[ ...argList, ...rest ])\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { partial } from './partial.js'\nimport { type } from './type.js'\n\nconst greet = (\n  salutation, title, firstName, lastName\n) =\u003e\n  [salutation, title, firstName, lastName]\n\ntest('happy', () =\u003e {\n  const canPassAnyNumberOfArguments = partial(\n    greet, 'Hello', 'Ms.'\n  )\n  const fn = canPassAnyNumberOfArguments('foo')\n  const sayHello = partial(greet, [ 'Hello' ])\n  const sayHelloRamda = partial(sayHello, [ 'Ms.' ])\n\n  expect(type(fn)).toBe('Function')\n\n  expect(fn('bar')).toStrictEqual(['Hello', 'Ms.', 'foo', 'bar'])\n  expect(sayHelloRamda('foo', 'bar')).toStrictEqual(['Hello', 'Ms.', 'foo', 'bar'])\n})\n\ntest('extra arguments are ignored', () =\u003e {\n  const canPassAnyNumberOfArguments = partial(\n    greet, 'Hello', 'Ms.'\n  )\n  const fn = canPassAnyNumberOfArguments('foo')\n\n  expect(type(fn)).toBe('Function')\n\n  expect(fn(\n    'bar', 1, 2\n  )).toStrictEqual(['Hello', 'Ms.', 'foo', 'bar'])\n})\n\ntest('when array is input', () =\u003e {\n  const fooFn = (\n    a, b, c, d\n  ) =\u003e ({\n    a,\n    b,\n    c,\n    d,\n  })\n  const barFn = partial(\n    fooFn, [ 1, 2 ], []\n  )\n\n  expect(barFn(1, 2)).toEqual({\n    a : [ 1, 2 ],\n    b : [],\n    c : 1,\n    d : 2,\n  })\n})\n\ntest('ramda spec', () =\u003e {\n  const sayHello = partial(greet, 'Hello')\n  const sayHelloToMs = partial(sayHello, 'Ms.')\n\n  expect(sayHelloToMs('Jane', 'Jones')).toStrictEqual(['Hello', 'Ms.', 'Jane', 'Jones'])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {partial} from 'rambda'\n\ndescribe('R.partial', () =\u003e {\n  it('happy', () =\u003e {\n    function fn(\n      aString: string,\n      aNumber: number,\n      aBoolean: boolean,\n      aNull: null\n    ) {\n      return {aString, aNumber, aBoolean, aNull}\n    }\n\n    // @ts-expect-error\n    partial(fn, 1)\n\n    const fn1 = partial(fn, ['a'])\n    partial(fn1, ['b'])\n\n    const fn2 = partial(fn1, [2])\n    const result = fn2(true, null)\n    result // $ExpectType { aString: string; aNumber: number; aBoolean: boolean; aNull: null; }\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#partial)\n\n### partialObject\n\n```typescript\n\npartialObject\u003cInput, PartialInput, Output\u003e(\n  fn: (input: Input) =\u003e Output, \n  partialInput: PartialInput,\n): (input: Pick\u003cInput, Exclude\u003ckeyof Input, keyof PartialInput\u003e\u003e) =\u003e Output\n```\n\n`R.partialObject` is a curry helper designed specifically for functions accepting object as a single argument.\n\nInitially the function knows only a part from the whole input object and then `R.partialObject` helps in preparing the function for the second part, when it receives the rest of the input.\n\n\u003e :boom: Function input can be asynchronous\n\n```javascript\nconst fn = ({ a, b, c }) =\u003e a + b + c\nconst curried = R.partialObject(fn, { a : 1 })\nconst result = curried({\n  b : 2,\n  c : 3,\n})\n// =\u003e 6\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npartialObject\u003cInput, PartialInput, Output\u003e(\n  fn: (input: Input) =\u003e Output, \n  partialInput: PartialInput,\n): (input: Pick\u003cInput, Exclude\u003ckeyof Input, keyof PartialInput\u003e\u003e) =\u003e Output;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.partialObject\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { mergeDeepRight } from './mergeDeepRight.js'\n\nexport function partialObject(fn, input){\n  return nextInput =\u003e fn(mergeDeepRight(nextInput, input))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { delay } from './delay.js'\nimport { partialObject } from './partialObject.js'\nimport { type } from './type.js'\n\ntest('with plain function', () =\u003e {\n  const fn = ({ a, b, c }) =\u003e a + b + c\n  const curried = partialObject(fn, { a : 1 })\n\n  expect(type(curried)).toBe('Function')\n  expect(curried({\n    b : 2,\n    c : 3,\n  })).toBe(6)\n})\n\ntest('with function that throws an error', () =\u003e {\n  const fn = ({ a, b, c }) =\u003e {\n    throw new Error('foo')\n  }\n  const curried = partialObject(fn, { a : 1 })\n\n  expect(type(curried)).toBe('Function')\n  expect(() =\u003e\n    curried({\n      b : 2,\n      c : 3,\n    })).toThrowErrorMatchingInlineSnapshot('\"foo\"')\n})\n\ntest('with async', async () =\u003e {\n  const fn = async ({ a, b, c }) =\u003e {\n    await delay(100)\n\n    return a + b + c\n  }\n\n  const curried = partialObject(fn, { a : 1 })\n\n  const result = await curried({\n    b : 2,\n    c : 3,\n  })\n\n  expect(result).toBe(6)\n})\n\ntest('async function throwing an error', async () =\u003e {\n  const fn = async ({ a, b, c }) =\u003e {\n    await delay(100)\n    throw new Error('foo')\n  }\n\n  const curried = partialObject(fn, { a : 1 })\n\n  try {\n    await curried({\n      b : 2,\n      c : 3,\n    })\n    expect(true).toBeFalsy()\n  } catch (e){\n    expect(e.message).toBe('foo')\n  }\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {partialObject, delay} from 'rambda'\n\ndescribe('R.partialObject', () =\u003e {\n  it('happy', () =\u003e {\n    interface Input {\n      a: number,\n      b: number,\n      c: string,\n    }\n    const fn = ({a, b, c}: Input) =\u003e a + b + c\n    const curried = partialObject(fn, {a: 1})\n    const result = curried({\n      b: 2,\n      c: 'foo',\n    })\n    result // $ExpectType string\n  })\n  it('asynchronous', async() =\u003e {\n    interface Input {\n      a: number,\n      b: number,\n      c: string,\n    }\n    const fn = async({a, b, c}: Input) =\u003e {\n      await delay(100)\n      return a + b + c\n    }\n    const curried = partialObject(fn, {a: 1})\n    const result = await curried({\n      b: 2,\n      c: 'foo',\n    })\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#partialObject)\n\n### partition\n\n```typescript\n\npartition\u003cT\u003e(\n  predicate: Predicate\u003cT\u003e,\n  input: T[]\n): [T[], T[]]\n```\n\nIt will return array of two objects/arrays according to `predicate` function. The first member holds all instances of `input` that pass the `predicate` function, while the second member - those who doesn't.\n\n```javascript\nconst list = [1, 2, 3]\nconst obj = {a: 1, b: 2, c: 3}\nconst predicate = x =\u003e x \u003e 2\n\nconst result = [\n  R.partition(predicate, list),\n  R.partition(predicate, Record\u003cstring, unknown\u003e)\n]\nconst expected = [\n  [[3], [1, 2]],\n  [{c: 3},  {a: 1, b: 2}],\n]\n// `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npartition\u003cT\u003e(\n  predicate: Predicate\u003cT\u003e,\n  input: T[]\n): [T[], T[]];\npartition\u003cT\u003e(\n  predicate: Predicate\u003cT\u003e\n): (input: T[]) =\u003e [T[], T[]];\npartition\u003cT\u003e(\n  predicate: (x: T, prop?: string) =\u003e boolean,\n  input: { [key: string]: T}\n): [{ [key: string]: T}, { [key: string]: T}];\npartition\u003cT\u003e(\n  predicate: (x: T, prop?: string) =\u003e boolean\n): (input: { [key: string]: T}) =\u003e [{ [key: string]: T}, { [key: string]: T}];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.partition\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function partitionObject(predicate, iterable){\n  const yes = {}\n  const no = {}\n  Object.entries(iterable).forEach(([ prop, value ]) =\u003e {\n    if (predicate(value, prop)){\n      yes[ prop ] = value\n    } else {\n      no[ prop ] = value\n    }\n  })\n\n  return [ yes, no ]\n}\n\nexport function partitionArray(\n  predicate, list, indexed = false\n){\n  const yes = []\n  const no = []\n  let counter = -1\n\n  while (counter++ \u003c list.length - 1){\n    if (\n      indexed ? predicate(list[ counter ], counter) : predicate(list[ counter ])\n    ){\n      yes.push(list[ counter ])\n    } else {\n      no.push(list[ counter ])\n    }\n  }\n\n  return [ yes, no ]\n}\n\nexport function partition(predicate, iterable){\n  if (arguments.length === 1){\n    return listHolder =\u003e partition(predicate, listHolder)\n  }\n  if (!isArray(iterable)) return partitionObject(predicate, iterable)\n\n  return partitionArray(predicate, iterable)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { partition } from './partition.js'\n\ntest('with array', () =\u003e {\n  const predicate = x =\u003e x \u003e 2\n  const list = [ 1, 2, 3, 4 ]\n\n  const result = partition(predicate, list)\n  const expectedResult = [\n    [ 3, 4 ],\n    [ 1, 2 ],\n  ]\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('with object', () =\u003e {\n  const predicate = (value, prop) =\u003e {\n    expect(typeof prop).toBe('string')\n\n    return value \u003e 2\n  }\n  const hash = {\n    a : 1,\n    b : 2,\n    c : 3,\n    d : 4,\n  }\n\n  const result = partition(predicate)(hash)\n  const expectedResult = [\n    {\n      c : 3,\n      d : 4,\n    },\n    {\n      a : 1,\n      b : 2,\n    },\n  ]\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('readme example', () =\u003e {\n  const list = [ 1, 2, 3 ]\n  const obj = {\n    a : 1,\n    b : 2,\n    c : 3,\n  }\n  const predicate = x =\u003e x \u003e 2\n\n  const result = [ partition(predicate, list), partition(predicate, obj) ]\n  const expected = [\n    [ [ 3 ], [ 1, 2 ] ],\n    [\n      { c : 3 },\n      {\n        a : 1,\n        b : 2,\n      },\n    ],\n  ]\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {partition} from 'rambda'\n\ndescribe('R.partition', () =\u003e {\n  it('with array', () =\u003e {\n    const predicate = (x: number) =\u003e {\n      return x \u003e 2\n    }\n    const list = [1, 2, 3, 4]\n\n    const result = partition(predicate, list)\n    const curriedResult = partition(predicate)(list)\n    result // $ExpectType [number[], number[]]\n    curriedResult // $ExpectType [number[], number[]]\n  })\n\n  /*\n    revert to old version of `dtslint` and `R.partition` typing\n    as there is diff between VSCode types(correct) and dtslint(incorrect)\n    \n    it('with object', () =\u003e {\n      const predicate = (value: number, prop?: string) =\u003e {\n        return value \u003e 2\n      }\n      const hash = {\n        a: 1,\n        b: 2,\n        c: 3,\n        d: 4,\n      }\n  \n      const result = partition(predicate, hash)\n      const curriedResult = partition(predicate)(hash)\n      result[0] // $xExpectType { [key: string]: number; }\n      result[1] // $xExpectType { [key: string]: number; }\n      curriedResult[0] // $xExpectType { [key: string]: number; }\n      curriedResult[1] // $xExpectType { [key: string]: number; }\n    })\n    */\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#partition)\n\n### path\n\n```typescript\n\npath\u003cS, K0 extends keyof S = keyof S\u003e(path: [K0], obj: S): S[K0]\n```\n\nIf `pathToSearch` is `'a.b'` then it will return `1` if `obj` is `{a:{b:1}}`.\n\nIt will return `undefined`, if such path is not found.\n\n\u003e :boom: String annotation of `pathToSearch` is one of the differences between `Rambda` and `Ramda`.\n\n```javascript\nconst obj = {a: {b: 1}}\nconst pathToSearch = 'a.b'\nconst pathToSearchList = ['a', 'b']\n\nconst result = [\n  R.path(pathToSearch, obj),\n  R.path(pathToSearchList, obj),\n  R.path('a.b.c.d', obj)\n]\n// =\u003e [1, 1, undefined]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npath\u003cS, K0 extends keyof S = keyof S\u003e(path: [K0], obj: S): S[K0];\npath\u003cS, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]\u003e(path: [K0, K1], obj: S): S[K0][K1];\npath\u003c\n    S,\n    K0 extends keyof S = keyof S,\n    K1 extends keyof S[K0] = keyof S[K0],\n    K2 extends keyof S[K0][K1] = keyof S[K0][K1]\n\u003e(path: [K0, K1, K2], obj: S): S[K0][K1][K2];\npath\u003c\n    S,\n    K0 extends keyof S = keyof S,\n    K1 extends keyof S[K0] = keyof S[K0],\n    K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n    K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],\n\u003e(path: [K0, K1, K2, K3], obj: S): S[K0][K1][K2][K3];\npath\u003c\n    S,\n    K0 extends keyof S = keyof S,\n    K1 extends keyof S[K0] = keyof S[K0],\n    K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n    K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],\n    K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],\n\u003e(path: [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];\npath\u003c\n    S,\n    K0 extends keyof S = keyof S,\n    K1 extends keyof S[K0] = keyof S[K0],\n    K2 extends keyof S[K0][K1] = keyof S[K0][K1],\n    K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],\n    K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],\n    K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4],\n\u003e(path: [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];\npath\u003cT\u003e(pathToSearch: string, obj: any): T | undefined;\npath\u003cT\u003e(pathToSearch: string): (obj: any) =\u003e T | undefined;\npath\u003cT\u003e(pathToSearch: RamdaPath): (obj: any) =\u003e T | undefined;\npath\u003cT\u003e(pathToSearch: RamdaPath, obj: any): T | undefined;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.path\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from './_internals/createPath.js'\n\nexport function pathFn(pathInput, obj){\n  let willReturn = obj\n  let counter = 0\n\n  const pathArrValue = createPath(pathInput)\n\n  while (counter \u003c pathArrValue.length){\n    if (willReturn === null || willReturn === undefined){\n      return undefined\n    }\n    if (willReturn[ pathArrValue[ counter ] ] === null) return undefined\n\n    willReturn = willReturn[ pathArrValue[ counter ] ]\n    counter++\n  }\n\n  return willReturn\n}\n\nexport function path(pathInput, obj){\n  if (arguments.length === 1) return _obj =\u003e path(pathInput, _obj)\n\n  if (obj === null || obj === undefined){\n    return undefined\n  }\n\n  return pathFn(pathInput, obj)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { path } from './path.js'\n\ntest('with array inside object', () =\u003e {\n  const obj = { a : { b : [ 1, { c : 1 } ] } }\n\n  expect(path('a.b.1.c', obj)).toBe(1)\n})\n\ntest('works with undefined', () =\u003e {\n  const obj = { a : { b : { c : 1 } } }\n\n  expect(path('a.b.c.d.f', obj)).toBeUndefined()\n  expect(path('foo.babaz', undefined)).toBeUndefined()\n  expect(path('foo.babaz')(undefined)).toBeUndefined()\n})\n\ntest('works with string instead of array', () =\u003e {\n  expect(path('foo.bar.baz')({ foo : { bar : { baz : 'yes' } } })).toBe('yes')\n})\n\ntest('path', () =\u003e {\n  expect(path([ 'foo', 'bar', 'baz' ])({ foo : { bar : { baz : 'yes' } } })).toBe('yes')\n  expect(path([ 'foo', 'bar', 'baz' ])(null)).toBeUndefined()\n  expect(path([ 'foo', 'bar', 'baz' ])({ foo : { bar : 'baz' } })).toBeUndefined()\n})\n\ntest('with number string in between', () =\u003e {\n\texpect(path(['a','1','b'], {a: [{b: 1}, {b: 2}]})).toBe(2)\n})\n\ntest('null is not a valid path', () =\u003e {\n  expect(path('audio_tracks', {\n    a            : 1,\n    audio_tracks : null,\n  })).toBeUndefined()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {path} from 'rambda'\n\nconst input = {a: {b: {c: true}}}\n\ndescribe('R.path with string as path', () =\u003e {\n  it('without specified output type', () =\u003e {\n    // $ExpectType unknown\n    path('a.b.c', input)\n    // $ExpectType unknown\n    path('a.b.c')(input)\n  })\n  it('with specified output type', () =\u003e {\n    // $ExpectType boolean | undefined\n    path\u003cboolean\u003e('a.b.c', input)\n    // $ExpectType boolean | undefined\n    path\u003cboolean\u003e('a.b.c')(input)\n  })\n})\n\ndescribe('R.path with list as path', () =\u003e {\n  it('with array as path', () =\u003e {\n    // $ExpectType boolean\n    path(['a', 'b', 'c'], input)\n    // $ExpectType unknown\n    path(['a', 'b', 'c'])(input)\n  })\n  test('shallow property', () =\u003e {\n    // $ExpectType number\n    path(['a'], {a: 1})\n\n    // $ExpectType unknown\n    path(['b'], {a: 1})\n  })\n  test('deep property', () =\u003e {\n    const testObject = {a: {b: {c: {d: {e: {f: 1}}}}}}\n    const result = path(['a', 'b', 'c', 'd', 'e', 'f'], testObject)\n    // $ExpectType number\n    result\n    const curriedResult = path(['a', 'b', 'c', 'd', 'e', 'f'])(testObject)\n    // $ExpectType unknown\n    curriedResult\n  })\n  test('issue #668 - path is not correct', () =\u003e {\n    const object = {\n      is: {\n        a: 'path',\n      },\n    }\n    const result = path(['is', 'not', 'a'], object)\n    // $ExpectType unknown\n    result\n    const curriedResult = path(['is', 'not', 'a'])(object)\n    // $ExpectType unknown\n    curriedResult\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#path)\n\n### pathEq\n\n```typescript\n\npathEq(pathToSearch: Path, target: any, input: any): boolean\n```\n\nIt returns `true` if `pathToSearch` of `input` object is equal to `target` value.\n\n`pathToSearch` is passed to `R.path`, which means that it can be either a string or an array. Also equality between `target` and the found value is determined by `R.equals`.\n\n```javascript\nconst path = 'a.b'\nconst target = {c: 1}\nconst input = {a: {b: {c: 1}}}\n\nconst result = R.pathEq(\n  path,\n  target,\n  input\n)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npathEq(pathToSearch: Path, target: any, input: any): boolean;\npathEq(pathToSearch: Path, target: any): (input: any) =\u003e boolean;\npathEq(pathToSearch: Path): (target: any) =\u003e (input: any) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pathEq\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { equals } from './equals.js'\nimport { path } from './path.js'\n\nfunction pathEqFn(\n  pathToSearch, target, input\n){\n  return equals(path(pathToSearch, input), target)\n}\n\nexport const pathEq = curry(pathEqFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pathEq } from './pathEq.js'\n\ntest('when true', () =\u003e {\n  const path = 'a.b'\n  const obj = { a : { b : { c : 1 } } }\n  const target = { c : 1 }\n\n  expect(pathEq(\n    path, target, obj\n  )).toBeTrue()\n})\n\ntest('when false', () =\u003e {\n  const path = 'a.b'\n  const obj = { a : { b : 1 } }\n  const target = 2\n\n  expect(pathEq(path, target)(obj)).toBeFalse()\n})\n\ntest('when wrong path', () =\u003e {\n  const path = 'foo.bar'\n  const obj = { a : { b : 1 } }\n  const target = 2\n\n  expect(pathEq(\n    path, target, obj\n  )).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {pathEq} from 'rambda'\n\ndescribe('R.pathEq', () =\u003e {\n  it('with string path', () =\u003e {\n    const pathToSearch = 'a.b.c'\n    const input = {a: {b: {c: 1}}}\n    const target = {c: 1}\n\n    const result = pathEq(pathToSearch, input, target)\n    const curriedResult = pathEq(pathToSearch, input, target)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n\n  it('with array path', () =\u003e {\n    const pathToSearch = ['a', 'b', 'c']\n    const input = {a: {b: {c: 1}}}\n    const target = {c: 1}\n\n    const result = pathEq(pathToSearch, input, target)\n    const curriedResult = pathEq(pathToSearch, input, target)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n\ndescribe('with ramda specs', () =\u003e {\n  const testPath = ['x', 0, 'y']\n  const testObj = {\n    x: [\n      {y: 2, z: 3},\n      {y: 4, z: 5},\n    ],\n  }\n\n  const result1 = pathEq(testPath, 2, testObj)\n  const result2 = pathEq(testPath, 2)(testObj)\n  const result3 = pathEq(testPath)(2)(testObj)\n  result1 // $ExpectType boolean\n  result2 // $ExpectType boolean\n  result3 // $ExpectType boolean\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pathEq)\n\n### pathOr\n\n```typescript\n\npathOr\u003cT\u003e(defaultValue: T, pathToSearch: Path, obj: any): T\n```\n\nIt reads `obj` input and returns either `R.path(pathToSearch, Record\u003cstring, unknown\u003e)` result or `defaultValue` input.\n\n```javascript\nconst defaultValue = 'DEFAULT_VALUE'\nconst pathToSearch = 'a.b'\nconst pathToSearchList = ['a', 'b']\n\nconst obj = {\n  a : {\n    b : 1\n  }\n}\n\nconst result = [\n  R.pathOr(DEFAULT_VALUE, pathToSearch, Record\u003cstring, unknown\u003e),\n  R.pathOr(DEFAULT_VALUE, pathToSearchList, Record\u003cstring, unknown\u003e), \n  R.pathOr(DEFAULT_VALUE, 'a.b.c', Record\u003cstring, unknown\u003e)\n]\n// =\u003e [1, 1, 'DEFAULT_VALUE']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npathOr\u003cT\u003e(defaultValue: T, pathToSearch: Path, obj: any): T;\npathOr\u003cT\u003e(defaultValue: T, pathToSearch: Path): (obj: any) =\u003e T;\npathOr\u003cT\u003e(defaultValue: T): (pathToSearch: Path) =\u003e (obj: any) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pathOr\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { defaultTo } from './defaultTo.js'\nimport { path } from './path.js'\n\nfunction pathOrFn(\n  defaultValue, pathInput, obj\n){\n  return defaultTo(defaultValue, path(pathInput, obj))\n}\n\nexport const pathOr = curry(pathOrFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pathOr } from './pathOr.js'\n\ntest('with undefined', () =\u003e {\n  const result = pathOr(\n    'foo', 'x.y', { x : { y : 1 } }\n  )\n\n  expect(result).toBe(1)\n})\n\ntest('with null', () =\u003e {\n  const result = pathOr(\n    'foo', 'x.y', null\n  )\n\n  expect(result).toBe('foo')\n})\n\ntest('with NaN', () =\u003e {\n  const result = pathOr(\n    'foo', 'x.y', NaN\n  )\n\n  expect(result).toBe('foo')\n})\n\ntest('curry case (x)(y)(z)', () =\u003e {\n  const result = pathOr('foo')('x.y.z')({ x : { y : { a : 1 } } })\n\n  expect(result).toBe('foo')\n})\n\ntest('curry case (x)(y,z)', () =\u003e {\n  const result = pathOr('foo', 'x.y.z')({ x : { y : { a : 1 } } })\n\n  expect(result).toBe('foo')\n})\n\ntest('curry case (x,y)(z)', () =\u003e {\n  const result = pathOr('foo')('x.y.z', { x : { y : { a : 1 } } })\n\n  expect(result).toBe('foo')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {pathOr} from 'rambda'\n\ndescribe('R.pathOr', () =\u003e {\n  it('with string path', () =\u003e {\n    const x = pathOr\u003cstring\u003e('foo', 'x.y', {x: {y: 'bar'}})\n    x // $ExpectType string\n  })\n  it('with array path', () =\u003e {\n    const x = pathOr\u003cstring\u003e('foo', ['x', 'y'], {x: {y: 'bar'}})\n    x // $ExpectType string\n  })\n  it('without passing type looks bad', () =\u003e {\n    const x = pathOr('foo', 'x.y', {x: {y: 'bar'}})\n    x // $ExpectType \"foo\"\n  })\n  it('curried', () =\u003e {\n    const x = pathOr\u003cstring\u003e('foo', 'x.y')({x: {y: 'bar'}})\n    x // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pathOr)\n\n### paths\n\n```typescript\n\npaths\u003cInput, T\u003e(pathsToSearch: Path[], obj: Input): (T | undefined)[]\n```\n\nIt loops over members of `pathsToSearch` as `singlePath` and returns the array produced by `R.path(singlePath, Record\u003cstring, unknown\u003e)`.\n\nBecause it calls `R.path`, then `singlePath` can be either string or a list.\n\n```javascript\nconst obj = {\n  a : {\n    b : {\n      c : 1,\n      d : 2\n    }\n  }\n}\n\nconst result = R.paths([\n  'a.b.c',\n  'a.b.d',\n  'a.b.c.d.e',\n], Record\u003cstring, unknown\u003e)\n// =\u003e [1, 2, undefined]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npaths\u003cInput, T\u003e(pathsToSearch: Path[], obj: Input): (T | undefined)[];\npaths\u003cInput, T\u003e(pathsToSearch: Path[]): (obj: Input) =\u003e (T | undefined)[];\npaths\u003cT\u003e(pathsToSearch: Path[], obj: any): (T | undefined)[];\npaths\u003cT\u003e(pathsToSearch: Path[]): (obj: any) =\u003e (T | undefined)[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.paths\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { path } from './path.js'\n\nexport function paths(pathsToSearch, obj){\n  if (arguments.length === 1){\n    return _obj =\u003e paths(pathsToSearch, _obj)\n  }\n\n  return pathsToSearch.map(singlePath =\u003e path(singlePath, obj))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { paths } from './paths.js'\n\nconst obj = {\n  a : {\n    b : {\n      c : 1,\n      d : 2,\n    },\n  },\n  p : [ { q : 3 } ],\n  x : {\n    y : 'FOO',\n    z : [ [ {} ] ],\n  },\n}\n\ntest('with string path + curry', () =\u003e {\n  const pathsInput = [ 'a.b.d', 'p.q' ]\n  const expected = [ 2, undefined ]\n  const result = paths(pathsInput, obj)\n  const curriedResult = paths(pathsInput)(obj)\n\n  expect(result).toEqual(expected)\n  expect(curriedResult).toEqual(expected)\n})\n\ntest('with array path', () =\u003e {\n  const result = paths([\n    [ 'a', 'b', 'c' ],\n    [ 'x', 'y' ],\n  ],\n  obj)\n\n  expect(result).toEqual([ 1, 'FOO' ])\n})\n\ntest('takes a paths that contains indices into arrays', () =\u003e {\n  expect(paths([\n    [ 'p', 0, 'q' ],\n    [ 'x', 'z', 0, 0 ],\n  ],\n  obj)).toEqual([ 3, {} ])\n  expect(paths([\n    [ 'p', 0, 'q' ],\n    [ 'x', 'z', 2, 1 ],\n  ],\n  obj)).toEqual([ 3, undefined ])\n})\n\ntest('gets a deep property\\'s value from objects', () =\u003e {\n  expect(paths([ [ 'a', 'b' ] ], obj)).toEqual([ obj.a.b ])\n  expect(paths([ [ 'p', 0 ] ], obj)).toEqual([ obj.p[ 0 ] ])\n})\n\ntest('returns undefined for items not found', () =\u003e {\n  expect(paths([ [ 'a', 'x', 'y' ] ], obj)).toEqual([ undefined ])\n  expect(paths([ [ 'p', 2 ] ], obj)).toEqual([ undefined ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {paths} from 'rambda'\n\ninterface Input {\n  a: number,\n  b: number,\n  c: number,\n}\n\nconst input: Input = {a: 1, b: 2, c: 3}\n\ndescribe('R.paths', () =\u003e {\n  it('with dot notation', () =\u003e {\n    const result = paths\u003cnumber\u003e(['a.b.c', 'foo.bar'], input)\n    result // $ExpectType (number | undefined)[]\n  })\n\n  it('without type', () =\u003e {\n    const result = paths(['a.b.c', 'foo.bar'], input)\n    result // $ExpectType unknown[]\n  })\n\n  it('with array as path', () =\u003e {\n    const result = paths\u003cnumber\u003e([['a', 'b', 'c'], ['foo.bar']], input)\n    result // $ExpectType (number | undefined)[]\n  })\n\n  it('curried', () =\u003e {\n    const result = paths\u003cnumber\u003e([['a', 'b', 'c'], ['foo.bar']])(input)\n    result // $ExpectType (number | undefined)[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#paths)\n\n### pathSatisfies\n\n```typescript\n\npathSatisfies\u003cT, U\u003e(pred: (val: T) =\u003e boolean, path: Path): (obj: U) =\u003e boolean\n```\n\n```javascript\nconst result = R.pathSatisfies(\n  x =\u003e x \u003e 0,\n  ['a', 'b', 'c'],\n  {a: {b: {c: 1}}}\n)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npathSatisfies\u003cT, U\u003e(pred: (val: T) =\u003e boolean, path: Path): (obj: U) =\u003e boolean;\npathSatisfies\u003cT, U\u003e(pred: (val: T) =\u003e boolean, path: Path, obj: U): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pathSatisfies\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { path } from \"./path.js\";\nimport { curry } from \"./curry.js\";\n\nexport function pathSatisfiesFn(fn, pathInput, obj) {\n  if(pathInput.length === 0) throw new Error(\"R.pathSatisfies received an empty path\")\n  return Boolean(fn(path(pathInput, obj))) \n}\n\nexport const pathSatisfies = curry(pathSatisfiesFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pathSatisfies } from './pathSatisfies';\n\nconst isPositive = (n) =\u003e n \u003e 0;\n\nit('returns true if the specified object path satisfies the given predicate', () =\u003e {\n\texpect(\n\t\tpathSatisfies(isPositive, ['x', 1, 'y'], { x: [{ y: -1 }, { y: 1 }] }),\n\t).toBe(true);\n\texpect(\n\t\tpathSatisfies(isPositive, 'x.1.y', { x: [{ y: -1 }, { y: 1 }] }),\n\t).toBe(true);\n});\n\nit('returns false if the specified path does not exist', () =\u003e {\n\texpect(pathSatisfies(isPositive, ['x', 'y'], { x: { z: 42 } })).toBe(false);\n\texpect(pathSatisfies(isPositive, 'x.y', { x: { z: 42 } })).toBe(false);\n});\n\nit('throws on empty paths', () =\u003e {\n\texpect(() =\u003e pathSatisfies(Object.is, [], { x: { z: 42 } })).toThrow();\n});\n\nit('returns false otherwise', () =\u003e {\n\texpect(pathSatisfies(isPositive, ['x', 'y'], { x: { y: 0 } })).toBe(false);\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pathSatisfies)\n\n### pick\n\n```typescript\n\npick\u003cT, K extends string | number | symbol\u003e(propsToPick: K[], input: T): Pick\u003cT, Exclude\u003ckeyof T, Exclude\u003ckeyof T, K\u003e\u003e\u003e\n```\n\nIt returns a partial copy of an `input` containing only `propsToPick` properties.\n\n`input` can be either an object or an array.\n\nString annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.\n\n\u003e :boom: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.\n\n```javascript\nconst obj = {\n  a : 1,\n  b : false,\n  foo: 'cherry'\n}\nconst list = [1, 2, 3, 4]\nconst propsToPick = 'a,foo'\nconst propsToPickList = ['a', 'foo']\n\nconst result = [\n  R.pick(propsToPick, Record\u003cstring, unknown\u003e),\n  R.pick(propsToPickList, Record\u003cstring, unknown\u003e),\n  R.pick('a,bar', Record\u003cstring, unknown\u003e),\n  R.pick('bar', Record\u003cstring, unknown\u003e),\n  R.pick([0, 3, 5], list),\n  R.pick('0,3,5', list),\n]\n\nconst expected = [\n  {a:1, foo: 'cherry'},\n  {a:1, foo: 'cherry'},\n  {a:1},\n  {},\n  {0: 1, 3: 4},\n  {0: 1, 3: 4},\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npick\u003cT, K extends string | number | symbol\u003e(propsToPick: K[], input: T): Pick\u003cT, Exclude\u003ckeyof T, Exclude\u003ckeyof T, K\u003e\u003e\u003e;\npick\u003cK extends string | number | symbol\u003e(propsToPick: K[]): \u003cT\u003e(input: T) =\u003e Pick\u003cT, Exclude\u003ckeyof T, Exclude\u003ckeyof T, K\u003e\u003e\u003e;\npick\u003cT, U\u003e(propsToPick: string, input: T): U;\npick\u003cT, U\u003e(propsToPick: string): (input: T) =\u003e U;\npick\u003cT\u003e(propsToPick: string, input: object): T;\npick\u003cT\u003e(propsToPick: string): (input: object) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pick\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from './_internals/createPath.js'\n\nexport function pick(propsToPick, input){\n  if (arguments.length === 1) return _input =\u003e pick(propsToPick, _input)\n\n  if (input === null || input === undefined){\n    return undefined\n  }\n  const keys = createPath(propsToPick, ',')\n  const willReturn = {}\n  let counter = 0\n\n  while (counter \u003c keys.length){\n    if (keys[ counter ] in input){\n      willReturn[ keys[ counter ] ] = input[ keys[ counter ] ]\n    }\n    counter++\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pick } from './pick.js'\n\nconst obj = {\n  a : 1,\n  b : 2,\n  c : 3,\n}\n\ntest('props to pick is a string', () =\u003e {\n  const result = pick('a,c', obj)\n  const resultCurry = pick('a,c')(obj)\n  const expectedResult = {\n    a : 1,\n    c : 3,\n  }\n\n  expect(result).toEqual(expectedResult)\n  expect(resultCurry).toEqual(expectedResult)\n})\n\ntest('when prop is missing', () =\u003e {\n  const result = pick('a,d,f', obj)\n  expect(result).toEqual({ a : 1 })\n})\n\ntest('with list indexes as props', () =\u003e {\n  const list = [ 1, 2, 3 ]\n  const expected = {\n    0 : 1,\n    2 : 3,\n  }\n  expect(pick([ 0, 2, 3 ], list)).toEqual(expected)\n  expect(pick('0,2,3', list)).toEqual(expected)\n})\n\ntest('props to pick is an array', () =\u003e {\n  expect(pick([ 'a', 'c' ])({\n    a : 'foo',\n    b : 'bar',\n    c : 'baz',\n  })).toEqual({\n    a : 'foo',\n    c : 'baz',\n  })\n\n  expect(pick([ 'a', 'd', 'e', 'f' ])({\n    a : 'foo',\n    b : 'bar',\n    c : 'baz',\n  })).toEqual({ a : 'foo' })\n\n  expect(pick('a,d,e,f')(null)).toBeUndefined()\n})\n\ntest('works with list as input and number as props - props to pick is an array', () =\u003e {\n  const result = pick([ 1, 2 ], [ 'a', 'b', 'c', 'd' ])\n  expect(result).toEqual({\n    1 : 'b',\n    2 : 'c',\n  })\n})\n\ntest('works with list as input and number as props - props to pick is a string', () =\u003e {\n  const result = pick('1,2', [ 'a', 'b', 'c', 'd' ])\n  expect(result).toEqual({\n    1 : 'b',\n    2 : 'c',\n  })\n})\n\ntest('with symbol', () =\u003e {\n  const symbolProp = Symbol('s')\n  expect(pick([ symbolProp ], { [ symbolProp ] : 'a' })).toMatchInlineSnapshot(`\n{\n  Symbol(s): \"a\",\n}\n`)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {pick} from 'rambda'\n\nconst input = {a: 'foo', b: 2, c: 3, d: 4}\n\ndescribe('R.pick with array as props input', () =\u003e {\n  it('without passing type', () =\u003e {\n    const result = pick(['a', 'c'], input)\n    result.a // $ExpectType string\n    result.c // $ExpectType number\n  })\n})\n\ndescribe('R.pick with string as props input', () =\u003e {\n  interface Input {\n    a: string,\n    b: number,\n    c: number,\n    d: number,\n  }\n  interface Output {\n    a: string,\n    c: number,\n  }\n  it('explicitly declare output', () =\u003e {\n    const result = pick\u003cOutput\u003e('a,c', input)\n    result // $ExpectType Output\n    result.a // $ExpectType string\n    result.c // $ExpectType number\n\n    const curriedResult = pick\u003cOutput\u003e('a,c')(input)\n\n    curriedResult.a // $ExpectType string\n  })\n\n  it('explicitly declare input and output', () =\u003e {\n    const result = pick\u003cInput, Output\u003e('a,c', input)\n    result // $ExpectType Output\n    result.a // $ExpectType string\n\n    const curriedResult = pick\u003cInput, Output\u003e('a,c')(input)\n\n    curriedResult.a // $ExpectType string\n  })\n\n  it('without passing type', () =\u003e {\n    const result = pick('a,c', input)\n    result // $ExpectType unknown\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pick)\n\n### pickAll\n\n```typescript\n\npickAll\u003cT, K extends keyof T\u003e(propsToPicks: K[], input: T): Pick\u003cT, K\u003e\n```\n\nSame as `R.pick` but it won't skip the missing props, i.e. it will assign them to `undefined`.\n\n\u003e :boom: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.\n\n```javascript\nconst obj = {\n  a : 1,\n  b : false,\n  foo: 'cherry'\n}\nconst propsToPick = 'a,foo,bar'\nconst propsToPickList = ['a', 'foo', 'bar']\n\nconst result = [\n  R.pickAll(propsToPick, Record\u003cstring, unknown\u003e),\n  R.pickAll(propsToPickList, Record\u003cstring, unknown\u003e),\n  R.pickAll('a,bar', Record\u003cstring, unknown\u003e),\n  R.pickAll('bar', Record\u003cstring, unknown\u003e),\n]\nconst expected = [\n  {a:1, foo: 'cherry', bar: undefined},\n  {a:1, foo: 'cherry', bar: undefined},\n  {a:1, bar: undefined},\n  {bar: undefined}\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npickAll\u003cT, K extends keyof T\u003e(propsToPicks: K[], input: T): Pick\u003cT, K\u003e;\npickAll\u003cT, U\u003e(propsToPicks: string[], input: T): U;\npickAll(propsToPicks: string[]): \u003cT, U\u003e(input: T) =\u003e U;\npickAll\u003cT, U\u003e(propsToPick: string, input: T): U;\npickAll\u003cT, U\u003e(propsToPick: string): (input: T) =\u003e U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pickAll\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { createPath } from './_internals/createPath.js'\n\nexport function pickAll(propsToPick, obj){\n  if (arguments.length === 1) return _obj =\u003e pickAll(propsToPick, _obj)\n\n  if (obj === null || obj === undefined){\n    return undefined\n  }\n  const keysValue = createPath(propsToPick, ',')\n  const willReturn = {}\n  let counter = 0\n\n  while (counter \u003c keysValue.length){\n    if (keysValue[ counter ] in obj){\n      willReturn[ keysValue[ counter ] ] = obj[ keysValue[ counter ] ]\n    } else {\n      willReturn[ keysValue[ counter ] ] = undefined\n    }\n    counter++\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pickAll } from './pickAll.js'\n\ntest('when input is undefined or null', () =\u003e {\n  expect(pickAll('a', null)).toBeUndefined()\n  expect(pickAll('a', undefined)).toBeUndefined()\n})\n\ntest('with string as condition', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n    c : 3,\n  }\n  const result = pickAll('a,c', obj)\n  const resultCurry = pickAll('a,c')(obj)\n  const expectedResult = {\n    a : 1,\n    b : undefined,\n    c : 3,\n  }\n\n  expect(result).toEqual(expectedResult)\n  expect(resultCurry).toEqual(expectedResult)\n})\n\ntest('with array as condition', () =\u003e {\n  expect(pickAll([ 'a', 'b', 'c' ], {\n    a : 'foo',\n    c : 'baz',\n  })).toEqual({\n    a : 'foo',\n    b : undefined,\n    c : 'baz',\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {pickAll} from 'rambda'\n\ninterface Input {\n  a: string,\n  b: number,\n  c: number,\n  d: number,\n}\ninterface Output {\n  a?: string,\n  c?: number,\n}\nconst input = {a: 'foo', b: 2, c: 3, d: 4}\n\ndescribe('R.pickAll with array as props input', () =\u003e {\n  it('without passing type', () =\u003e {\n    const result = pickAll(['a', 'c'], input)\n    result.a // $ExpectType string\n    result.c // $ExpectType number\n  })\n  it('without passing type + curry', () =\u003e {\n    const result = pickAll(['a', 'c'])(input)\n    result // $ExpectType unknown\n  })\n  it('explicitly passing types', () =\u003e {\n    const result = pickAll\u003cInput, Output\u003e(['a', 'c'], input)\n    result.a // $ExpectType string | undefined\n    result.c // $ExpectType number | undefined\n  })\n})\n\ndescribe('R.pickAll with string as props input', () =\u003e {\n  it('without passing type', () =\u003e {\n    const result = pickAll('a,c', input)\n    result // $ExpectType unknown\n  })\n  it('without passing type + curry', () =\u003e {\n    const result = pickAll('a,c')(input)\n    result // $ExpectType unknown\n  })\n  it('explicitly passing types', () =\u003e {\n    const result = pickAll\u003cInput, Output\u003e('a,c', input)\n    result.a // $ExpectType string | undefined\n    result.c // $ExpectType number | undefined\n  })\n  it('explicitly passing types + curry', () =\u003e {\n    const result = pickAll\u003cInput, Output\u003e('a,c')(input)\n    result.a // $ExpectType string | undefined\n    result.c // $ExpectType number | undefined\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pickAll)\n\n### pickBy\n\n```typescript\n\npickBy\u003cT\u003e(pred: ObjPred\u003cT\u003e): \u003cU, V extends T\u003e(obj: V) =\u003e U\n```\n\n```javascript\nconst result = R.pickBy(\n  x =\u003e x \u003e 1,\n  {a: 1, b: 2, c: 3}\n)\n// =\u003e {b: 2, c: 3}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npickBy\u003cT\u003e(pred: ObjPred\u003cT\u003e): \u003cU, V extends T\u003e(obj: V) =\u003e U;\npickBy\u003cT, U\u003e(pred: ObjPred\u003cT\u003e, obj: T): U;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pickBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function pickBy(predicate, obj) {\n  if (arguments.length === 1){\n    return (_obj) =\u003e pickBy(predicate, _obj);\n  }\n  return Object.keys(obj).reduce((accum, key) =\u003e {\n    if (predicate(obj[ key ], key, obj)){\n      accum[ key ] = obj[ key ];\n    }\n    return accum;\n  }, {});\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { T, always } from 'rambdax'\nimport { pickBy } from './pickBy'\n\nvar obj = {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}\n\nit('creates a copy of the object', () =\u003e {\n  expect(pickBy(always(true), obj)).not.toBe(obj)\n})\n\nit('when returning truthy, keeps the key', () =\u003e {\n  expect(pickBy(T, obj)).toEqual(obj)\n  expect(pickBy(always({}), obj)).toEqual(obj)\n  expect(pickBy(always(1), obj)).toEqual(obj)\n})\n\nit('when returning falsy, keeps the key', () =\u003e {\n  expect(pickBy(always(false), obj)).toEqual({})\n  expect(pickBy(always(0), obj)).toEqual({})\n  expect(pickBy(always(null), obj)).toEqual({})\n})\n\nit('is called with (val,key,obj)', () =\u003e {\n  expect(\n    pickBy((val, key, _obj) =\u003e {\n      expect(_obj).toBe(obj)\n      return key === 'd' \u0026\u0026 val === 4\n    }, obj)\n  ).toEqual({d: 4})\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pickBy)\n\n### pipe\n\n```typescript\n\npipe\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult\u003e(\n  ...funcs: [\n      f1: (...args: TArgs) =\u003e R1,\n      f2: (a: R1) =\u003e R2,\n      f3: (a: R2) =\u003e R3,\n      f4: (a: R3) =\u003e R4,\n      f5: (a: R4) =\u003e R5,\n      f6: (a: R5) =\u003e R6,\n      f7: (a: R6) =\u003e R7,\n      ...func: Array\u003c(a: any) =\u003e any\u003e,\n      fnLast: (a: any) =\u003e TResult\n  ]\n): (...args: TArgs) =\u003e TResult\n```\n\nIt performs left-to-right function composition.\n\n```javascript\nconst result = R.pipe(\n  R.filter(val =\u003e val \u003e 2),\n  R.map(a =\u003e a * 2)\n)([1, 2, 3, 4])\n\n// =\u003e [6, 8]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npipe\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult\u003e(\n  ...funcs: [\n      f1: (...args: TArgs) =\u003e R1,\n      f2: (a: R1) =\u003e R2,\n      f3: (a: R2) =\u003e R3,\n      f4: (a: R3) =\u003e R4,\n      f5: (a: R4) =\u003e R5,\n      f6: (a: R5) =\u003e R6,\n      f7: (a: R6) =\u003e R7,\n      ...func: Array\u003c(a: any) =\u003e any\u003e,\n      fnLast: (a: any) =\u003e TResult\n  ]\n): (...args: TArgs) =\u003e TResult;  // fallback overload if number of piped functions greater than 7\npipe\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6, R7\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2,\n  f3: (a: R2) =\u003e R3,\n  f4: (a: R3) =\u003e R4,\n  f5: (a: R4) =\u003e R5,\n  f6: (a: R5) =\u003e R6,\n  f7: (a: R6) =\u003e R7\n): (...args: TArgs) =\u003e R7;\npipe\u003cTArgs extends any[], R1, R2, R3, R4, R5, R6\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2,\n  f3: (a: R2) =\u003e R3,\n  f4: (a: R3) =\u003e R4,\n  f5: (a: R4) =\u003e R5,\n  f6: (a: R5) =\u003e R6\n): (...args: TArgs) =\u003e R6;\npipe\u003cTArgs extends any[], R1, R2, R3, R4, R5\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2,\n  f3: (a: R2) =\u003e R3,\n  f4: (a: R3) =\u003e R4,\n  f5: (a: R4) =\u003e R5\n): (...args: TArgs) =\u003e R5;\npipe\u003cTArgs extends any[], R1, R2, R3, R4\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2,\n  f3: (a: R2) =\u003e R3,\n  f4: (a: R3) =\u003e R4\n): (...args: TArgs) =\u003e R4;\npipe\u003cTArgs extends any[], R1, R2, R3\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2,\n  f3: (a: R2) =\u003e R3\n): (...args: TArgs) =\u003e R3;\npipe\u003cTArgs extends any[], R1, R2\u003e(\n  f1: (...args: TArgs) =\u003e R1,\n  f2: (a: R1) =\u003e R2\n): (...args: TArgs) =\u003e R2;\npipe\u003cTArgs extends any[], R1\u003e(\n  f1: (...args: TArgs) =\u003e R1\n): (...args: TArgs) =\u003e R1;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pipe\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _arity } from './_internals/_arity.js'\nimport { reduceFn } from './reduce.js'\n\nexport function _pipe(f, g){\n  return function (){\n    return g.call(this, f.apply(this, arguments))\n  }\n}\n\nexport function pipe(){\n  if (arguments.length === 0){\n    throw new Error('pipe requires at least one argument')\n  }\n\n  return _arity(arguments[ 0 ].length,\n    reduceFn(\n      _pipe,\n      arguments[ 0 ],\n      Array.prototype.slice.call(\n        arguments, 1, Infinity\n      )\n    ))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add, last, length, map } from '../rambda.js'\nimport { __findHighestArity } from './applySpec.js'\nimport { pipe } from './pipe.js'\n\ntest('happy', () =\u003e {\n  const list = [ 1, 2, 3 ]\n  const result = pipe(\n    map(add(1)), map(add(10)), last\n  )(list)\n\n  expect(result).toBe(14)\n})\n\ntest('issue #627', () =\u003e {\n  expect(__findHighestArity({ len : pipe(length) })).toBe(1)\n})\n\ntest('with bad input', () =\u003e {\n  expect(() =\u003e pipe()).toThrowErrorMatchingInlineSnapshot('\"pipe requires at least one argument\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {\n  add,\n  subtract,\n  pipe,\n  map,\n  filter,\n  identity,\n  dissoc,\n  inc,\n  negate,\n} from 'rambda'\n\ninterface Input {\n  a: string,\n  b: string,\n}\ninterface Output {\n  c: string,\n}\n\ndescribe('R.pipe with explicit types', () =\u003e {\n  it('with explicit types - complex', () =\u003e {\n    const obj = {\n      a: 'foo',\n      b: 'bar',\n    }\n    interface AfterInput {\n      a: number,\n    }\n    interface BeforeOutput {\n      b: string,\n    }\n\n    const result = pipe\u003cInput[], AfterInput, BeforeOutput, Output\u003e(\n      x =\u003e ({a: x.a.length + x.b.length}),\n      x =\u003e ({b: x.a + 'foo'}),\n      x =\u003e ({c: x.b + 'bar'})\n    )(obj)\n\n    result // $ExpectType Output\n  })\n  it('with explicit types - correct', () =\u003e {\n    const obj = {\n      a: 'foo',\n      b: 'bar',\n    }\n\n    const result = pipe\u003cInput[], Output, Output\u003e(input =\u003e {\n      input // $ExpectType Input\n      return input as unknown as Output\n    }, identity)(obj)\n    result // $ExpectType Output\n  })\n  it('with explicit types - wrong', () =\u003e {\n    const obj: Input = {\n      a: 'foo',\n      b: 'bar',\n    }\n\n    // @ts-expect-error\n    pipe\u003cstring, number, Output\u003e(identity, dissoc('b'))(obj)\n  })\n})\n\ndescribe('R.pipe', () =\u003e {\n  it('happy', () =\u003e {\n    const result = pipe(subtract(11), add(1), add(1))(1)\n    result // $ExpectType number\n  })\n  it('happy - more complex', () =\u003e {\n    const result = pipe(\n      (x: string) =\u003e x.length + 1,\n      (x: number) =\u003e x + 1\n    )('foo')\n    result // $ExpectType number\n  })\n\n  it('with R.filter', () =\u003e {\n    const result = pipe(\n      filter\u003cnumber\u003e(x =\u003e x \u003e 2),\n      map(add(1))\n    )([1, 2, 3])\n    result // $ExpectType number[]\n  })\n\n  it('with native filter', () =\u003e {\n    const result = pipe(\n      (list: number[]) =\u003e list.filter(x =\u003e x \u003e 2),\n      (list: number[]) =\u003e {\n        list // $ExpectType number[]\n        return list\n      },\n      map(add(1))\n    )([1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n\n  it('with void', () =\u003e {\n    const result = pipe(\n      () =\u003e {},\n      () =\u003e {}\n    )()\n    result // $ExpectType void\n  })\n})\n\ndescribe('R.pipe - @types/ramda tests', () =\u003e {\n  test('complex', () =\u003e {\n    const fn = pipe(Math.pow, negate, inc, inc, inc, inc, inc, inc, inc, inc)\n    const result = fn(3, 4)\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pipe)\n\n### pluck\n\n```typescript\n\npluck\u003cK extends keyof T, T\u003e(property: K, list: T[]): T[K][]\n```\n\nIt returns list of the values of `property` taken from the all objects inside `list`.\n\n```javascript\nconst list = [{a: 1}, {a: 2}, {b: 3}]\nconst property = 'a'\n\nconst result = R.pluck(property, list) \n// =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npluck\u003cK extends keyof T, T\u003e(property: K, list: T[]): T[K][];\npluck\u003cT\u003e(property: number, list: { [k: number]: T }[]):  T[];\npluck\u003cP extends string\u003e(property: P): \u003cT\u003e(list: Record\u003cP, T\u003e[]) =\u003e T[];\npluck(property: number): \u003cT\u003e(list: { [k: number]: T }[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.pluck\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { map } from './map.js'\n\nexport function pluck(property, list){\n  if (arguments.length === 1) return _list =\u003e pluck(property, _list)\n\n  const willReturn = []\n\n  map(x =\u003e {\n    if (x[ property ] !== undefined){\n      willReturn.push(x[ property ])\n    }\n  }, list)\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { pluck } from './pluck.js'\n\ntest('happy', () =\u003e {\n  expect(pluck('a')([ { a : 1 }, { a : 2 }, { b : 1 } ])).toEqual([ 1, 2 ])\n})\n\ntest('with undefined', () =\u003e {\n  expect(pluck(undefined)([ { a : 1 }, { a : 2 }, { b : 1 } ])).toEqual([ ])\n})\n\ntest('with number', () =\u003e {\n  const input = [\n    [ 1, 2 ],\n    [ 3, 4 ],\n  ]\n\n  expect(pluck(0, input)).toEqual([ 1, 3 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {pluck} from 'rambda'\n\ndescribe('R.pluck', () =\u003e {\n  it('with object', () =\u003e {\n    interface ListMember {\n      a: number,\n      b: string,\n    }\n    const input: ListMember[] = [\n      {a: 1, b: 'foo'},\n      {a: 2, b: 'bar'},\n    ]\n    const resultA = pluck('a', input)\n    const resultB = pluck('b')(input)\n    resultA // $ExpectType number[]\n    resultB // $ExpectType string[]\n  })\n\n  it('with array', () =\u003e {\n    const input = [\n      [1, 2],\n      [3, 4],\n      [5, 6],\n    ]\n    const result = pluck(0, input)\n    const resultCurry = pluck(0)(input)\n    result // $ExpectType number[]\n    resultCurry // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#pluck)\n\n### prepend\n\n```typescript\n\nprepend\u003cT\u003e(xToPrepend: T, iterable: T[]): T[]\n```\n\nIt adds element `x` at the beginning of `list`.\n\n```javascript\nconst result = R.prepend('foo', ['bar', 'baz'])\n// =\u003e ['foo', 'bar', 'baz']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nprepend\u003cT\u003e(xToPrepend: T, iterable: T[]): T[];\nprepend\u003cT, U\u003e(xToPrepend: T, iterable: IsFirstSubtypeOfSecond\u003cT, U\u003e[]) : U[];\nprepend\u003cT\u003e(xToPrepend: T): \u003cU\u003e(iterable: IsFirstSubtypeOfSecond\u003cT, U\u003e[]) =\u003e U[];\nprepend\u003cT\u003e(xToPrepend: T): (iterable: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.prepend\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function prepend(x, input){\n  if (arguments.length === 1) return _input =\u003e prepend(x, _input)\n\n  if (typeof input === 'string') return [ x ].concat(input.split(''))\n\n  return [ x ].concat(input)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { prepend } from './prepend.js'\n\ntest('happy', () =\u003e {\n  expect(prepend('yes', [ 'foo', 'bar', 'baz' ])).toEqual([\n    'yes',\n    'foo',\n    'bar',\n    'baz',\n  ])\n})\n\ntest('with empty list', () =\u003e {\n  expect(prepend('foo')([])).toEqual([ 'foo' ])\n})\n\ntest('with string instead of array', () =\u003e {\n  expect(prepend('foo')('bar')).toEqual([ 'foo', 'b', 'a', 'r' ])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#prepend)\n\n### product\n\n```typescript\n\nproduct(list: number[]): number\n```\n\n```javascript\nR.product([ 2, 3, 4 ])\n// =\u003e 24)\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nproduct(list: number[]): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.product\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { multiply } from './multiply.js'\nimport { reduce } from './reduce.js'\n\nexport const product = reduce(multiply, 1)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { product } from './product.js'\n\ntest('happy', () =\u003e {\n  expect(product([ 2, 3, 4 ])).toBe(24)\n})\n\ntest('bad input', () =\u003e {\n  expect(product([ null ])).toBe(0)\n  expect(product([])).toBe(1)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {product} from 'rambda'\n\ndescribe('R.product', () =\u003e {\n  it('happy', () =\u003e {\n    const result = product([1, 2, 3])\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#product)\n\n### prop\n\n```typescript\n\nprop\u003c_, P extends keyof never, T\u003e(p: P, value: T): Prop\u003cT, P\u003e\n```\n\nIt returns the value of property `propToFind` in `obj`.\n\nIf there is no such property, it returns `undefined`.\n\n```javascript\nconst result = [\n  R.prop('x', {x: 100}), \n  R.prop('x', {a: 1}) \n]\n// =\u003e [100, undefined]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nprop\u003c_, P extends keyof never, T\u003e(p: P, value: T): Prop\u003cT, P\u003e;\nprop\u003cV\u003e(p: keyof never, value: unknown): V;\nprop\u003c_, P extends keyof never\u003e(p: P): \u003cT\u003e(value: T) =\u003e Prop\u003cT, P\u003e;\nprop\u003cV\u003e(p: keyof never): (value: unknown) =\u003e V;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.prop\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function propFn(searchProperty, obj){\n  if (!obj) return undefined\n\n  return obj[ searchProperty ]\n}\n\nexport function prop(searchProperty, obj){\n  if (arguments.length === 1) return _obj =\u003e prop(searchProperty, _obj)\n\n  return propFn(searchProperty, obj)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { prop } from './prop.js'\n\ntest('prop', () =\u003e {\n  expect(prop('foo')({ foo : 'baz' })).toBe('baz')\n\n  expect(prop('bar')({ foo : 'baz' })).toBeUndefined()\n\n  expect(prop('bar')(null)).toBeUndefined()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {prop} from 'rambda'\n\ndescribe('R.prop', () =\u003e {\n  interface Foo {\n    a: number,\n    b: string,\n    c?: number,\n  }\n  const obj: Foo = {a: 1, b: 'foo'}\n\n  it('issue #553', () =\u003e {\n    const result = {\n      a: prop('a', obj),\n      b: prop('b', obj),\n      c: prop('c', obj),\n    }\n    const curriedResult = {\n      a: prop('a')(obj),\n      b: prop('b')(obj),\n      c: prop('c')(obj),\n    }\n\n    result // $ExpectType { a: number; b: string; c: number | undefined; }\n    curriedResult // $ExpectType { a: number; b: string; c: number | undefined; }\n  })\n})\n\ndescribe('with number as prop', () =\u003e {\n  const list = [1, 2, 3]\n  const index = 1\n  it('happy', () =\u003e {\n    const result = prop(index, list)\n\n    result // $ExpectType number\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = prop\u003cnumber\u003e(index)(list)\n\n    result // $ExpectType number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#prop)\n\n### propEq\n\n```typescript\n\npropEq\u003cK extends string | number\u003e(valueToMatch: any, propToFind: K, obj: Record\u003cK, any\u003e): boolean\n```\n\nIt returns true if `obj` has property `propToFind` and its value is equal to `valueToMatch`.\n\n```javascript\nconst obj = { foo: 'bar' }\nconst secondObj = { foo: 1 }\n\nconst propToFind = 'foo'\nconst valueToMatch = 'bar'\n\nconst result = [\n  R.propEq(propToFind, valueToMatch, Record\u003cstring, unknown\u003e),\n  R.propEq(propToFind, valueToMatch, secondRecord\u003cstring, unknown\u003e)\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npropEq\u003cK extends string | number\u003e(valueToMatch: any, propToFind: K, obj: Record\u003cK, any\u003e): boolean;\npropEq\u003cK extends string | number\u003e(valueToMatch: any, propToFind: K): (obj: Record\u003cK, any\u003e) =\u003e boolean;\npropEq(valueToMatch: any): {\n  \u003cK extends string | number\u003e(propToFind: K, obj: Record\u003cK, any\u003e): boolean;\n  \u003cK extends string | number\u003e(propToFind: K): (obj: Record\u003cK, any\u003e) =\u003e boolean;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.propEq\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { equals } from './equals.js'\nimport { prop } from './prop.js'\n\nfunction propEqFn(\n  valueToMatch, propToFind, obj\n){\n  if (!obj) return false\n\n  return equals(valueToMatch, prop(propToFind, obj))\n}\n\nexport const propEq = curry(propEqFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { BAR, FOO } from './_internals/testUtils.js'\nimport { propEq } from './propEq.js'\n\ntest('happy', () =\u003e {\n  const obj = { [ FOO ] : BAR }\n  expect(propEq(BAR, FOO)(obj)).toBeTrue()\n  expect(propEq(1, FOO)(obj)).toBeFalse()\n  expect(propEq(1)(FOO)(obj)).toBeFalse()\n  expect(propEq(\n    1, 1, null\n  )).toBeFalse()\n})\n\ntest('returns false if called with a null or undefined object', () =\u003e {\n  expect(propEq(\n    'name', 'Abby', null\n  )).toBeFalse()\n  expect(propEq(\n    'name', 'Abby', undefined\n  )).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {propEq} from 'rambda'\n\nconst property = 'foo'\nconst numberProperty = 1\nconst value = 'bar'\nconst obj = {[property]: value}\nconst objWithNumberIndex = {[numberProperty]: value}\n\ndescribe('R.propEq', () =\u003e {\n  it('happy', () =\u003e {\n    const result = propEq(value, property, obj)\n    result // $ExpectType boolean\n  })\n\n  it('number is property', () =\u003e {\n    const result = propEq(value, 1, objWithNumberIndex)\n    result // $ExpectType boolean\n  })\n\n  it('with optional property', () =\u003e {\n    interface MyType {\n      optional?: string | number,\n    }\n\n    const myObject: MyType = {}\n    const valueToFind = '1111'\n    // @ts-expect-error\n    propEq(valueToFind, 'optional', myObject)\n  })\n\n  it('imported from @types/ramda', () =\u003e {\n    interface A {\n      foo: string | null,\n    }\n    const obj: A = {\n      foo: 'bar',\n    }\n    const value = ''\n    const result = propEq(value, 'foo')(obj)\n    result // $ExpectType boolean\n\n    // @ts-expect-error\n    propEq(value, 'bar')(obj)\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#propEq)\n\n### propIs\n\n```typescript\n\npropIs\u003cC extends AnyFunction, K extends keyof any\u003e(type: C, name: K, obj: any): obj is Record\u003cK, ReturnType\u003cC\u003e\u003e\n```\n\nIt returns `true` if `property` of `obj` is from `target` type.\n\n```javascript\nconst obj = {a:1, b: 'foo'}\n\nconst result = [\n  R.propIs(Number, 'a', Record\u003cstring, unknown\u003e),\n  R.propIs(String, 'b', Record\u003cstring, unknown\u003e),\n  R.propIs(Number, 'b', Record\u003cstring, unknown\u003e),\n]\n// =\u003e [true, true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npropIs\u003cC extends AnyFunction, K extends keyof any\u003e(type: C, name: K, obj: any): obj is Record\u003cK, ReturnType\u003cC\u003e\u003e;\npropIs\u003cC extends AnyConstructor, K extends keyof any\u003e(type: C, name: K, obj: any): obj is Record\u003cK, InstanceType\u003cC\u003e\u003e;\npropIs\u003cC extends AnyFunction, K extends keyof any\u003e(type: C, name: K): (obj: any) =\u003e obj is Record\u003cK, ReturnType\u003cC\u003e\u003e;\npropIs\u003cC extends AnyConstructor, K extends keyof any\u003e(type: C, name: K): (obj: any) =\u003e obj is Record\u003cK, InstanceType\u003cC\u003e\u003e;\npropIs\u003cC extends AnyFunction\u003e(type: C): {\n    \u003cK extends keyof any\u003e(name: K, obj: any): obj is Record\u003cK, ReturnType\u003cC\u003e\u003e;\n    \u003cK extends keyof any\u003e(name: K): (obj: any) =\u003e obj is Record\u003cK, ReturnType\u003cC\u003e\u003e;\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.propIs\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { is } from './is.js'\n\nfunction propIsFn(\n  targetPrototype, property, obj\n){\n  return is(targetPrototype, obj[ property ])\n}\n\nexport const propIs = curry(propIsFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { propIs } from './propIs.js'\n\nconst obj = {\n  a : 1,\n  b : 'foo',\n}\n\ntest('when true', () =\u003e {\n  expect(propIs(\n    Number, 'a', obj\n  )).toBeTrue()\n  expect(propIs(\n    String, 'b', obj\n  )).toBeTrue()\n})\n\ntest('when false', () =\u003e {\n  expect(propIs(\n    String, 'a', obj\n  )).toBeFalse()\n  expect(propIs(\n    Number, 'b', obj\n  )).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {propIs} from 'rambda'\n\nconst property = 'a'\nconst obj = {a: 1}\n\ndescribe('R.propIs', () =\u003e {\n  it('happy', () =\u003e {\n    const result = propIs(Number, property, obj)\n    result // $ExpectType boolean\n  })\n\n  it('curried', () =\u003e {\n    const result = propIs(Number, property)(obj)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#propIs)\n\n### propOr\n\n```typescript\n\npropOr\u003cT, P extends string\u003e(defaultValue: T, property: P, obj: Partial\u003cRecord\u003cP, T\u003e\u003e | undefined): T\n```\n\nIt returns either `defaultValue` or the value of `property` in `obj`.\n\n```javascript\nconst obj = {a: 1}\nconst defaultValue = 'DEFAULT_VALUE'\nconst property = 'a'\n\nconst result = [\n  R.propOr(defaultValue, property, Record\u003cstring, unknown\u003e),\n  R.propOr(defaultValue, 'foo', Record\u003cstring, unknown\u003e)\n]\n// =\u003e [1, 'DEFAULT_VALUE']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npropOr\u003cT, P extends string\u003e(defaultValue: T, property: P, obj: Partial\u003cRecord\u003cP, T\u003e\u003e | undefined): T;\npropOr\u003cT, P extends string\u003e(defaultValue: T, property: P): (obj: Partial\u003cRecord\u003cP, T\u003e\u003e | undefined) =\u003e T;\npropOr\u003cT\u003e(defaultValue: T): {\n  \u003cP extends string\u003e(property: P, obj: Partial\u003cRecord\u003cP, T\u003e\u003e | undefined): T;\n  \u003cP extends string\u003e(property: P): (obj: Partial\u003cRecord\u003cP, T\u003e\u003e | undefined) =\u003e T;\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.propOr\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { defaultTo } from './defaultTo.js'\n\nfunction propOrFn(\n  defaultValue, property, obj\n){\n  if (!obj) return defaultValue\n\n  return defaultTo(defaultValue, obj[ property ])\n}\n\nexport const propOr = curry(propOrFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { propOr } from './propOr.js'\n\ntest('propOr (result)', () =\u003e {\n  const obj = { a : 1 }\n  expect(propOr(\n    'default', 'a', obj\n  )).toBe(1)\n  expect(propOr(\n    'default', 'notExist', obj\n  )).toBe('default')\n  expect(propOr(\n    'default', 'notExist', null\n  )).toBe('default')\n})\n\ntest('propOr (currying)', () =\u003e {\n  const obj = { a : 1 }\n  expect(propOr('default')('a', obj)).toBe(1)\n  expect(propOr('default', 'a')(obj)).toBe(1)\n  expect(propOr('default')('notExist', obj)).toBe('default')\n  expect(propOr('default', 'notExist')(obj)).toBe('default')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {propOr} from 'rambda'\n\nconst obj = {foo: 'bar'}\nconst property = 'foo'\nconst fallback = 'fallback'\n\ndescribe('R.propOr', () =\u003e {\n  it('happy', () =\u003e {\n    const result = propOr(fallback, property, obj)\n    result // $ExpectType string\n  })\n  it('curry 1', () =\u003e {\n    const result = propOr(fallback)(property, obj)\n    result // $ExpectType string\n  })\n  it('curry 2', () =\u003e {\n    const result = propOr(fallback, property)(obj)\n    result // $ExpectType string\n  })\n  it('curry 3', () =\u003e {\n    const result = propOr(fallback)(property)(obj)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#propOr)\n\n### props\n\n```typescript\n\nprops\u003cP extends string, T\u003e(propsToPick: P[], obj: Record\u003cP, T\u003e): T[]\n```\n\nIt takes list with properties `propsToPick` and returns a list with property values in `obj`.\n\n```javascript\nconst result = R.props(\n  ['a', 'b'], \n  {a:1, c:3}\n)\n// =\u003e [1, undefined]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nprops\u003cP extends string, T\u003e(propsToPick: P[], obj: Record\u003cP, T\u003e): T[];\nprops\u003cP extends string\u003e(propsToPick: P[]): \u003cT\u003e(obj: Record\u003cP, T\u003e) =\u003e T[];\nprops\u003cP extends string, T\u003e(propsToPick: P[]): (obj: Record\u003cP, T\u003e) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.props\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { mapArray } from './map.js'\n\nexport function props(propsToPick, obj){\n  if (arguments.length === 1){\n    return _obj =\u003e props(propsToPick, _obj)\n  }\n  if (!isArray(propsToPick)){\n    throw new Error('propsToPick is not a list')\n  }\n\n  return mapArray(prop =\u003e obj[ prop ], propsToPick)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { props } from './props.js'\n\nconst obj = {\n  a : 1,\n  b : 2,\n}\nconst propsToPick = [ 'a', 'c' ]\n\ntest('happy', () =\u003e {\n  const result = props(propsToPick, obj)\n  expect(result).toEqual([ 1, undefined ])\n})\n\ntest('curried', () =\u003e {\n  const result = props(propsToPick)(obj)\n  expect(result).toEqual([ 1, undefined ])\n})\n\ntest('wrong input', () =\u003e {\n  expect(() =\u003e props(null)(obj)).toThrowErrorMatchingInlineSnapshot('\"propsToPick is not a list\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {props} from 'rambda'\n\nconst obj = {a: 1, b: 2}\n\ndescribe('R.props', () =\u003e {\n  it('happy', () =\u003e {\n    const result = props(['a', 'b'], obj)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = props(['a', 'b'])(obj)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#props)\n\n### propSatisfies\n\n```typescript\n\npropSatisfies\u003cT\u003e(predicate: Predicate\u003cT\u003e, property: string, obj: Record\u003cstring, T\u003e): boolean\n```\n\nIt returns `true` if the object property satisfies a given predicate.\n\n```javascript\nconst obj = {a: {b:1}}\nconst property = 'a'\nconst predicate = x =\u003e x?.b === 1\n\nconst result = R.propSatisfies(predicate, property, Record\u003cstring, unknown\u003e)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\npropSatisfies\u003cT\u003e(predicate: Predicate\u003cT\u003e, property: string, obj: Record\u003cstring, T\u003e): boolean;\npropSatisfies\u003cT\u003e(predicate: Predicate\u003cT\u003e, property: string): (obj: Record\u003cstring, T\u003e) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.propSatisfies\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { prop } from './prop.js'\n\nfunction propSatisfiesFn(\n  predicate, property, obj\n){\n  return predicate(prop(property, obj))\n}\n\nexport const propSatisfies = curry(propSatisfiesFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { propSatisfies } from './propSatisfies.js'\n\nconst obj = { a : 1 }\n\ntest('when true', () =\u003e {\n  expect(propSatisfies(\n    x =\u003e x \u003e 0, 'a', obj\n  )).toBeTrue()\n})\n\ntest('when false', () =\u003e {\n  expect(propSatisfies(x =\u003e x \u003c 0, 'a')(obj)).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {propSatisfies} from 'rambda'\n\nconst obj = {a: 1}\n\ndescribe('R.propSatisfies', () =\u003e {\n  it('happy', () =\u003e {\n    const result = propSatisfies(x =\u003e x \u003e 0, 'a', obj)\n\n    result // $ExpectType boolean\n  })\n  it('curried requires explicit type', () =\u003e {\n    const result = propSatisfies\u003cnumber\u003e(x =\u003e x \u003e 0, 'a')(obj)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#propSatisfies)\n\n### range\n\n```typescript\n\nrange(startInclusive: number, endExclusive: number): number[]\n```\n\nIt returns list of numbers between `startInclusive` to `endExclusive` markers.\n\n```javascript\nR.range(0, 5)\n// =\u003e [0, 1, 2, 3, 4]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nrange(startInclusive: number, endExclusive: number): number[];\nrange(startInclusive: number): (endExclusive: number) =\u003e number[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.range\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function range(start, end){\n  if (arguments.length === 1) return _end =\u003e range(start, _end)\n\n  if (Number.isNaN(Number(start)) || Number.isNaN(Number(end))){\n    throw new TypeError('Both arguments to range must be numbers')\n  }\n\n  if (end \u003c start) return []\n\n  const len = end - start\n  const willReturn = Array(len)\n\n  for (let i = 0; i \u003c len; i++){\n    willReturn[ i ] = start + i\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { range } from './range.js'\n\ntest('happy', () =\u003e {\n  expect(range(0, 10)).toEqual([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ])\n})\n\ntest('end range is bigger than start range', () =\u003e {\n  expect(range(7, 3)).toEqual([])\n  expect(range(5, 5)).toEqual([])\n})\n\ntest('with bad input', () =\u003e {\n  const throwMessage = 'Both arguments to range must be numbers'\n  expect(() =\u003e range('a', 6)).toThrowWithMessage(Error, throwMessage)\n  expect(() =\u003e range(6, 'z')).toThrowWithMessage(Error, throwMessage)\n})\n\ntest('curry', () =\u003e {\n  expect(range(0)(10)).toEqual([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {range} from 'rambda'\n\ndescribe('R.range', () =\u003e {\n  it('happy', () =\u003e {\n    const result = range(1, 4)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = range(1)(4)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#range)\n\n### reduce\n\n```typescript\n\nreduce\u003cT, TResult\u003e(reducer: (prev: TResult, current: T, i: number) =\u003e TResult, initialValue: TResult, list: T[]): TResult\n```\n\n\u003e :boom: It passes index of the list as third argument to `reducer` function.\n\n```javascript\nconst list = [1, 2, 3]\nconst initialValue = 10\nconst reducer = (prev, current) =\u003e prev * current\n\nconst result = R.reduce(reducer, initialValue, list)\n// =\u003e 60\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nreduce\u003cT, TResult\u003e(reducer: (prev: TResult, current: T, i: number) =\u003e TResult, initialValue: TResult, list: T[]): TResult;\nreduce\u003cT, TResult\u003e(reducer: (prev: TResult, current: T) =\u003e TResult, initialValue: TResult, list: T[]): TResult;\nreduce\u003cT, TResult\u003e(reducer: (prev: TResult, current: T, i: number) =\u003e TResult): (initialValue: TResult, list: T[]) =\u003e TResult;\nreduce\u003cT, TResult\u003e(reducer: (prev: TResult, current: T, i: number) =\u003e TResult, initialValue: TResult): (list: T[]) =\u003e TResult;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.reduce\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { curry } from './curry.js'\n\nclass ReduceStopper{\n  constructor(value){\n    this.value = value\n  }\n}\n\nexport function reduceFn(\n  reducer, acc, list\n){\n  if (list == null){\n    return acc\n  }\n  if (!isArray(list)){\n    throw new TypeError('reduce: list must be array or iterable')\n  }\n  let index = 0\n  const len = list.length\n\n  while (index \u003c len){\n    acc = reducer(\n      acc, list[ index ], index, list\n    )\n    if (acc instanceof ReduceStopper){\n      return acc.value\n    }\n    index++\n  }\n\n  return acc\n}\n\nexport const reduce = curry(reduceFn)\nexport const reduceStopper = value =\u003e new ReduceStopper(value)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add } from './add.js'\nimport { concat } from './concat.js'\nimport { reduce, reduceStopper } from './reduce.js'\n\nconst reducer = (\n  prev, current, i\n) =\u003e {\n  expect(i).toBeNumber()\n\n  return prev + current\n}\nconst initialValue = 1\nconst list = [ 1, 2, 3 ]\nconst ERROR = 'reduce: list must be array or iterable'\n\ntest('happy', () =\u003e {\n  expect(reduce(\n    reducer, initialValue, list\n  )).toBe(7)\n})\n\ntest('with object as iterable', () =\u003e {\n  expect(() =\u003e\n    reduce(\n      reducer, initialValue, {\n        a : 1,\n        b : 2,\n      }\n    )).toThrowWithMessage(TypeError, ERROR)\n})\n\ntest('with undefined as iterable', () =\u003e {\n  expect(() =\u003e reduce(\n    reducer, 0, {}\n  )).toThrowWithMessage(TypeError, ERROR)\n})\n\ntest('with reduceStopper', () =\u003e {\n  let maxIndex\n  const reducer = (\n    prev, current, i\n  ) =\u003e {\n    maxIndex = i\n\n    return current === 2 ? reduceStopper(current) : prev\n  }\n  expect(reduce(\n    reducer, initialValue, list\n  )).toBe(2)\n  expect(maxIndex).toBe(1)\n})\n\ntest('returns the accumulator for a null list', () =\u003e {\n  expect(reduce(\n    add, 0, null\n  )).toBe(0)\n  expect(reduce(\n    concat, [], null\n  )).toEqual([])\n})\n\ntest('returns the accumulator for an undefined list', () =\u003e {\n  expect(reduce(\n    add, 0, undefined\n  )).toBe(0)\n  expect(reduce(\n    concat, [], undefined\n  )).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {reduce, reduceStopper} from 'rambda'\n\ndescribe('R.reduce', () =\u003e {\n  it('happy', () =\u003e {\n    const result = reduce\u003cnumber, number\u003e(\n      (acc, elem) =\u003e {\n        acc // $ExpectType number\n        elem // $ExpectType number\n        return acc + elem\n      },\n      1,\n      [1, 2, 3]\n    )\n\n    result // $ExpectType number\n  })\n\n  it('with two types', () =\u003e {\n    const result = reduce\u003cnumber, string\u003e(\n      (acc, elem) =\u003e {\n        acc // $ExpectType string\n        elem // $ExpectType number\n\n        return `${acc}${elem}`\n      },\n      'foo',\n      [1, 2, 3]\n    )\n\n    result // $ExpectType string\n  })\n\n  it('with index', () =\u003e {\n    const result = reduce\u003cnumber, number\u003e(\n      (acc, elem, i) =\u003e {\n        acc // $ExpectType number\n        elem // $ExpectType number\n        i // $ExpectType number\n        return acc + elem\n      },\n      1,\n      [1, 2, 3]\n    )\n\n    result // $ExpectType number\n  })\n\n  it('with index, curried', () =\u003e {\n    const result = reduce\u003cnumber, number\u003e(\n      (acc, elem, i) =\u003e {\n        acc // $ExpectType number\n        elem // $ExpectType number\n        i // $ExpectType number\n        return acc + elem\n      },\n      1,\n    )([1, 2, 3])\n\n    result // $ExpectType number\n  })\n\n  it('using `reduceStopper` to stop the loop', () =\u003e {\n    const result = reduce\u003cnumber, number\u003e(\n      (acc, elem, i) =\u003e {\n        acc // $ExpectType number\n        elem // $ExpectType number\n        i // $ExpectType number\n        return acc + elem \u003e 1 ? reduceStopper(elem) : acc\n      },\n      1,\n      [1, 2, 3]\n    )\n\n    result // $ExpectType number\n  })\n\n  it('fallback', () =\u003e {\n    const result = reduce(\n      (acc, val) =\u003e {\n        acc // $ExpectType number\n        return acc + val\n      },\n      1,\n      [1, 2, 3]\n    )\n\n    result // $ExpectType number\n  })\n\n  it('fallback with index', () =\u003e {\n    const result = reduce(\n      (acc, val, i) =\u003e {\n        acc // $ExpectType number\n        i // $ExpectType number\n        return acc + val\n      },\n      1,\n      [1, 2, 3]\n    )\n\n    result // $ExpectType number\n  })\n\n  it('fallback with two types', () =\u003e {\n    const result = reduce(\n      (acc, val) =\u003e {\n        acc // $ExpectType string\n        return acc + val\n      },\n      'foo',\n      [1, 2, 3]\n    )\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#reduce)\n\n### reduceBy\n\n```typescript\n\nreduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n): (a: TResult, b: (elem: T) =\u003e string, c: T[]) =\u003e { [index: string]: TResult }\nexport function reduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n  acc: TResult,\n): (a: (elem: T) =\u003e string, b: T[]) =\u003e { [index: string]: TResult }\nexport function reduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n  acc: TResult,\n  keyFn: (elem: T) =\u003e string,\n): (list: T[]) =\u003e { [index: string]: TResult }\n```\n\n```javascript\nconst result = R.reduceBy(\n  (acc, elem) =\u003e acc + elem,\n  0,\n  x =\u003e x \u003e 2 ? 'big' : 'small',\n  [1, 2, 3, 4, 5]\n)\n// =\u003e { big: 12, small: 3 }\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nreduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n): (a: TResult, b: (elem: T) =\u003e string, c: T[]) =\u003e { [index: string]: TResult }\nreduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n  acc: TResult,\n): (a: (elem: T) =\u003e string, b: T[]) =\u003e { [index: string]: TResult }\nreduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n  acc: TResult,\n  keyFn: (elem: T) =\u003e string,\n): (list: T[]) =\u003e { [index: string]: TResult };\nreduceBy\u003cT, TResult\u003e(\n  valueFn: (acc: TResult, elem: T) =\u003e TResult,\n  acc: TResult,\n  keyFn: (elem: T) =\u003e string,\n  list: T[],\n): { [index: string]: TResult };\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.reduceBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { clone } from './clone.js'\nimport { curry } from './curry.js'\nimport { has } from './has.js'\nimport { reduce } from './reduce.js'\n\nfunction reduceByFunction(\n  valueFn, valueAcc, keyFn, acc, elt\n){\n  const key = keyFn(elt)\n  const value = valueFn(has(key, acc) ? acc[ key ] : clone(valueAcc), elt)\n\n  acc[ key ] = value\n\n  return acc\n}\n\nexport function reduceByFn(\n  valueFn, valueAcc, keyFn, list\n){\n  return reduce(\n    (acc, elt) =\u003e reduceByFunction(\n      valueFn, valueAcc, keyFn, acc, elt\n    ),\n    {},\n    list\n  )\n}\n\nexport const reduceBy = curry(reduceByFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { reduceBy } from './reduceBy.js'\nimport { prop } from './prop.js'\n\nconst byType = prop('type')\nconst sumValues = function (acc, obj){\n  return acc + obj.val\n}\n\nconst grade = function (score){\n  return score \u003c 65 ?\n    'F' :\n    score \u003c 70 ?\n      'D' :\n      score \u003c 80 ?\n        'C' :\n        score \u003c 90 ?\n          'B' :\n          'A'\n}\n\nconst byGrade = function (student){\n  return grade(student.score || 0)\n}\n\ntest('splits the list into groups according to the grouping function', () =\u003e {\n  const collectNames = function (acc, student){\n    return acc.concat(student.name)\n  }\n  expect(reduceBy(\n    collectNames, [], byGrade, getStudents()\n  )).toEqual({\n    A : [ 'Dianne', 'Gillian' ],\n    B : [ 'Abby', 'Chris', 'Irene' ],\n    C : [ 'Brad', 'Hannah' ],\n    D : [ 'Fred', 'Jack' ],\n    F : [ 'Eddy' ],\n  })\n})\n\ntest('splits the list into mutation-free groups', () =\u003e {\n  const collectNames = function (acc, student){\n    acc.push(student.name)\n\n    return acc\n  }\n  expect(reduceBy(\n    collectNames, [], byGrade, getStudents()\n  )).toEqual({\n    A : [ 'Dianne', 'Gillian' ],\n    B : [ 'Abby', 'Chris', 'Irene' ],\n    C : [ 'Brad', 'Hannah' ],\n    D : [ 'Fred', 'Jack' ],\n    F : [ 'Eddy' ],\n  })\n})\n\ntest('returns an empty object if given an empty array', () =\u003e {\n  expect(reduceBy(\n    sumValues, 0, byType, []\n  )).toEqual({})\n})\n\nfunction getStudents(){\n  return [\n    {\n      name  : 'Abby',\n      score : 84,\n    },\n    {\n      name  : 'Brad',\n      score : 73,\n    },\n    {\n      name  : 'Chris',\n      score : 89,\n    },\n    {\n      name  : 'Dianne',\n      score : 99,\n    },\n    {\n      name  : 'Eddy',\n      score : 58,\n    },\n    {\n      name  : 'Fred',\n      score : 67,\n    },\n    {\n      name  : 'Gillian',\n      score : 91,\n    },\n    {\n      name  : 'Hannah',\n      score : 78,\n    },\n    {\n      name  : 'Irene',\n      score : 85,\n    },\n    {\n      name  : 'Jack',\n      score : 69,\n    },\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {reduceBy} from 'rambda'\n\ntest('R.reduceBy', () =\u003e {\n  interface Student {\n    name: string,\n    score: number,\n  }\n\n  const reduceToNamesBy = reduceBy(\n    (acc: string[], student: Student) =\u003e acc.concat(student.name),\n    []\n  )\n  const students = [\n    {name: 'Lucy', score: 92},\n    {name: 'Drew', score: 85},\n    {name: 'Bart', score: 62},\n  ]\n  const result = reduceToNamesBy(student =\u003e {\n    const score = student.score\n    return score \u003c 65\n      ? 'F'\n      : score \u003c 70\n        ? 'D'\n        : score \u003c 80\n          ? 'C'\n          : score \u003c 90\n            ? 'B'\n            : 'A'\n  }, students)\n  result // $ExpectType { [index: string]: string[]; }\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#reduceBy)\n\n### reject\n\n```typescript\n\nreject\u003cT\u003e(predicate: Predicate\u003cT\u003e, list: T[]): T[]\n```\n\nIt has the opposite effect of `R.filter`.\n\n```javascript\nconst list = [1, 2, 3, 4]\nconst obj = {a: 1, b: 2}\nconst predicate = x =\u003e x \u003e 1\n\nconst result = [\n  R.reject(predicate, list),\n  R.reject(predicate, Record\u003cstring, unknown\u003e)\n]\n// =\u003e [[1], {a: 1}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nreject\u003cT\u003e(predicate: Predicate\u003cT\u003e, list: T[]): T[];\nreject\u003cT\u003e(predicate: Predicate\u003cT\u003e): (list: T[]) =\u003e T[];\nreject\u003cT\u003e(predicate: Predicate\u003cT\u003e, obj: Dictionary\u003cT\u003e): Dictionary\u003cT\u003e;\nreject\u003cT, U\u003e(predicate: Predicate\u003cT\u003e): (obj: Dictionary\u003cT\u003e) =\u003e Dictionary\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.reject\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { filter } from './filter.js'\n\nexport function reject(predicate, list){\n  if (arguments.length === 1) return _list =\u003e reject(predicate, _list)\n\n  return filter(x =\u003e !predicate(x), list)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { reject } from './reject.js'\n\nconst isOdd = n =\u003e n % 2 === 1\n\ntest('with array', () =\u003e {\n  expect(reject(isOdd)([ 1, 2, 3, 4 ])).toEqual([ 2, 4 ])\n})\n\ntest('with object', () =\u003e {\n  const obj = {\n    a : 1,\n    b : 2,\n    c : 3,\n    d : 4,\n  }\n  expect(reject(isOdd, obj)).toEqual({\n    b : 2,\n    d : 4,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {reject} from 'rambda'\n\ndescribe('R.reject with array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = reject(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 1\n      },\n      [1, 2, 3]\n    )\n    result // $ExpectType number[]\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = reject\u003cnumber\u003e(x =\u003e {\n      x // $ExpectType number\n      return x \u003e 1\n    })([1, 2, 3])\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.reject with objects', () =\u003e {\n  it('happy', () =\u003e {\n    const result = reject(\n      x =\u003e {\n        x // $ExpectType number\n\n        return x \u003e 1\n      },\n      {a: 1, b: 2}\n    )\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n  it('curried require dummy type', () =\u003e {\n    const result = reject\u003cnumber, any\u003e(x =\u003e {\n      return x \u003e 1\n    })({a: 1, b: 2})\n    result // $ExpectType Dictionary\u003cnumber\u003e\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#reject)\n\n### removeIndex\n\n```typescript\n\nremoveIndex\u003cT\u003e(index: number, list: T[]): T[]\n```\n\nIt returns a copy of `list` input with removed `index`.\n\n```javascript\nconst list = [1, 2, 3, 4]\nconst result = R.removeIndex(1, list)\n// =\u003e [1, 3, 4]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nremoveIndex\u003cT\u003e(index: number, list: T[]): T[];\nremoveIndex(index: number): \u003cT\u003e(list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.removeIndex\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function removeIndex(index, list){\n  if (arguments.length === 1) return _list =\u003e removeIndex(index, _list)\n  if (index \u003c= 0) return list.slice(1)\n  if (index \u003e= list.length - 1) return list.slice(0, list.length - 1)\n\n  return [ ...list.slice(0, index), ...list.slice(index + 1) ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { removeIndex } from './removeIndex.js'\n\nconst list = [ 1, 2, 3, 4 ]\n\ntest('first or before first index', () =\u003e {\n  expect(removeIndex(-2, list)).toEqual([ 2, 3, 4 ])\n  expect(removeIndex(-2)(list)).toEqual([ 2, 3, 4 ])\n})\n\ntest('last or after last index', () =\u003e {\n  expect(removeIndex(4, list)).toEqual([ 1, 2, 3 ])\n  expect(removeIndex(10, list)).toEqual([ 1, 2, 3 ])\n})\n\ntest('middle index', () =\u003e {\n  expect(removeIndex(1, list)).toEqual([ 1, 3, 4 ])\n  expect(removeIndex(2, list)).toEqual([ 1, 2, 4 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {removeIndex} from 'rambda'\n\ndescribe('R.removeIndex', () =\u003e {\n  it('happy', () =\u003e {\n    const result = removeIndex(1, [1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = removeIndex(1)([1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#removeIndex)\n\n### repeat\n\n```typescript\n\nrepeat\u003cT\u003e(x: T): (timesToRepeat: number) =\u003e T[]\n```\n\n```javascript\nR.repeat('foo', 3)\n// =\u003e ['foo', 'foo', 'foo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nrepeat\u003cT\u003e(x: T): (timesToRepeat: number) =\u003e T[];\nrepeat\u003cT\u003e(x: T, timesToRepeat: number): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.repeat\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function repeat(x, timesToRepeat){\n  if (arguments.length === 1){\n    return _timesToRepeat =\u003e repeat(x, _timesToRepeat)\n  }\n\n  return Array(timesToRepeat).fill(x)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { repeat } from './repeat.js'\n\ntest('repeat', () =\u003e {\n  expect(repeat('')(3)).toEqual([ '', '', '' ])\n  expect(repeat('foo', 3)).toEqual([ 'foo', 'foo', 'foo' ])\n\n  const obj = {}\n  const arr = repeat(obj, 3)\n\n  expect(arr).toEqual([ {}, {}, {} ])\n\n  expect(arr[ 0 ] === arr[ 1 ]).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {repeat} from 'rambda'\n\ndescribe('R.repeat', () =\u003e {\n  it('happy', () =\u003e {\n    const result = repeat(4, 7)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = repeat(4)(7)\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#repeat)\n\n### replace\n\n```typescript\n\nreplace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string\n```\n\nIt replaces `strOrRegex` found in `str` with `replacer`.\n\n```javascript\nconst strOrRegex = /o/g\n\nconst result = R.replace(strOrRegex, '|0|', 'foo')\n// =\u003e 'f|0||0|'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nreplace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string;\nreplace(strOrRegex: RegExp | string, replacer: RegExpReplacer): (str: string) =\u003e string;\nreplace(strOrRegex: RegExp | string): (replacer: RegExpReplacer) =\u003e (str: string) =\u003e string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.replace\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction replaceFn(\n  pattern, replacer, str\n){\n  return str.replace(pattern, replacer)\n}\n\nexport const replace = curry(replaceFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { replace } from './replace.js'\n\ntest('happy', () =\u003e {\n  expect(replace(\n    /\\s/g, '|', 'foo bar baz'\n  )).toBe('foo|bar|baz')\n})\n\ntest('with function as replacer input', () =\u003e {\n  expect(replace(\n    /\\s/g,\n    (\n      match, offset, str\n    ) =\u003e {\n      expect(match).toBe(' ')\n      expect([ 3, 7 ].includes(offset)).toBeTrue()\n      expect(str).toBe('foo bar baz')\n\n      return '|'\n    },\n    'foo bar baz'\n  )).toBe('foo|bar|baz')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {replace} from 'rambda'\n\nconst str = 'foo bar foo'\nconst replacer = 'bar'\n\ndescribe('R.replace', () =\u003e {\n  it('happy', () =\u003e {\n    const result = replace(/foo/g, replacer, str)\n\n    result // $ExpectType string\n  })\n  it('with string as search pattern', () =\u003e {\n    const result = replace('foo', replacer, str)\n\n    result // $ExpectType string\n  })\n  it('with function as replacer', () =\u003e {\n    const result = replace('f(o)o', (m: string, p1: string, offset: number) =\u003e {\n      m // $ExpectType string\n      p1 // $ExpectType string\n      offset // $ExpectType number\n      return p1\n    }, str)\n\n    result // $ExpectType string\n  })\n})\n\ndescribe('R.replace - curried', () =\u003e {\n  it('happy', () =\u003e {\n    const result = replace(/foo/g, replacer)(str)\n\n    result // $ExpectType string\n  })\n  it('with string as search pattern', () =\u003e {\n    const result = replace('foo', replacer)(str)\n\n    result // $ExpectType string\n  })\n  it('with function as replacer', () =\u003e {\n    const result = replace('f(o)o')((m: string, p1: string, offset: number) =\u003e {\n      m // $ExpectType string\n      p1 // $ExpectType string\n      offset // $ExpectType number\n      return p1\n    })(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#replace)\n\n### reverse\n\n```typescript\n\nreverse\u003cT\u003e(input: T[]): T[]\n```\n\nIt returns a reversed copy of list or string `input`.\n\n```javascript\nconst result = [\n  R.reverse('foo'),\n  R.reverse([1, 2, 3])\n]\n// =\u003e ['oof', [3, 2, 1]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nreverse\u003cT\u003e(input: T[]): T[];\nreverse(input: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.reverse\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function reverse(listOrString) {\n  if (typeof listOrString === 'string') {\n    return listOrString.split('').reverse().join('')\n  }\n\n  const clone = listOrString.slice()\n\n  return clone.reverse()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport {reverse} from './reverse.js'\n\ntest('happy', () =\u003e {\n  expect(reverse([1, 2, 3])).toEqual([3, 2, 1])\n})\n\ntest('with string', () =\u003e {\n  expect(reverse('baz')).toBe('zab')\n})\n\ntest(\"it doesn't mutate\", () =\u003e {\n  const arr = [1, 2, 3]\n\n  expect(reverse(arr)).toEqual([3, 2, 1])\n\n  expect(arr).toEqual([1, 2, 3])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {reverse} from 'rambda'\n\nconst list = [1, 2, 3, 4, 5]\n\ndescribe('R.reverse', () =\u003e {\n  it('happy', () =\u003e {\n    const result = reverse(list)\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#reverse)\n\n### set\n\n```typescript\n\nset\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): {\n  (a: A): (obj: S) =\u003e S\n  (a: A, obj: S): S\n}\n```\n\nIt returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.\n\n```javascript\nconst input = {x: 1, y: 2}\nconst xLens = R.lensProp('x')\n\nconst result = [\n  R.set(xLens, 4, input),\n  R.set(xLens, 8, input) \n]\n// =\u003e [{x: 4, y: 2}, {x: 8, y: 2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nset\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): {\n  (a: A): (obj: S) =\u003e S\n  (a: A, obj: S): S\n};\nset\u003cS, A\u003e(lens: Lens\u003cS, A\u003e, a: A): (obj: S) =\u003e S;\nset\u003cS, A\u003e(lens: Lens\u003cS, A\u003e, a: A, obj: S): S;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.set\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport {always} from './always.js'\nimport {curry} from './curry.js'\nimport {over} from './over.js'\n\nfunction setFn(lens, replacer, x) {\n  return over(lens, always(replacer), x)\n}\n\nexport const set = curry(setFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport {assoc} from './assoc.js'\nimport {lens} from './lens.js'\nimport {lensIndex} from './lensIndex.js'\nimport {lensPath} from './lensPath.js'\nimport {prop} from './prop.js'\nimport {set} from './set.js'\n\nconst testObject = {\n  foo: 'bar',\n  baz: {\n    a: 'x',\n    b: 'y',\n  },\n}\n\ntest('assoc lens', () =\u003e {\n  const assocLens = lens(prop('foo'), assoc('foo'))\n  const result = set(assocLens, 'FOO', testObject)\n  const expected = {\n    ...testObject,\n    foo: 'FOO',\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('path lens', () =\u003e {\n  const pathLens = lensPath('baz.a')\n  const result = set(pathLens, 'z', testObject)\n  const expected = {\n    ...testObject,\n    baz: {\n      a: 'z',\n      b: 'y',\n    },\n  }\n  expect(result).toEqual(expected)\n})\n\ntest('index lens', () =\u003e {\n  const indexLens = lensIndex(0)\n\n  const result = set(indexLens, 3, [1, 2])\n  expect(result).toEqual([3, 2])\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#set)\n\n### slice\n\n```typescript\n\nslice(from: number, to: number, input: string): string\n```\n\n```javascript\nconst list = [0, 1, 2, 3, 4, 5]\nconst str = 'FOO_BAR'\nconst from = 1\nconst to = 4\n\nconst result = [\n  R.slice(from, to, str),\n  R.slice(from, to, list)\n]\n// =\u003e ['OO_', [1, 2, 3]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nslice(from: number, to: number, input: string): string;\nslice\u003cT\u003e(from: number, to: number, input: T[]): T[];\nslice(from: number, to: number): {\n  (input: string): string;\n  \u003cT\u003e(input: T[]): T[];\n};\nslice(from: number): {\n  (to: number, input: string): string;\n  \u003cT\u003e(to: number, input: T[]): T[];\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.slice\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction sliceFn(\n  from, to, list\n){\n  return list.slice(from, to)\n}\n\nexport const slice = curry(sliceFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { slice } from './slice.js'\n\ntest('slice', () =\u003e {\n  expect(slice(\n    1, 3, [ 'a', 'b', 'c', 'd' ]\n  )).toEqual([ 'b', 'c' ])\n  expect(slice(\n    1, Infinity, [ 'a', 'b', 'c', 'd' ]\n  )).toEqual([ 'b', 'c', 'd' ])\n  expect(slice(\n    0, -1, [ 'a', 'b', 'c', 'd' ]\n  )).toEqual([ 'a', 'b', 'c' ])\n  expect(slice(\n    -3, -1, [ 'a', 'b', 'c', 'd' ]\n  )).toEqual([ 'b', 'c' ])\n  expect(slice(\n    0, 3, 'ramda'\n  )).toBe('ram')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {slice} from 'rambda'\n\nconst list = [1, 2, 3, 4, 5]\n\ndescribe('R.slice', () =\u003e {\n  it('happy', () =\u003e {\n    const result = slice(1, 3, list)\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = slice(1, 3)(list)\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#slice)\n\n### sort\n\n```typescript\n\nsort\u003cT\u003e(sortFn: (a: T, b: T) =\u003e number, list: T[]): T[]\n```\n\nIt returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to return only `-1`, `0` or `1`.\n\n```javascript\nconst list = [\n  {a: 2},\n  {a: 3},\n  {a: 1}\n]\nconst sortFn = (x, y) =\u003e {\n  return x.a \u003e y.a ? 1 : -1\n}\n\nconst result = R.sort(sortFn, list)\nconst expected = [\n  {a: 1},\n  {a: 2},\n  {a: 3}\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsort\u003cT\u003e(sortFn: (a: T, b: T) =\u003e number, list: T[]): T[];\nsort\u003cT\u003e(sortFn: (a: T, b: T) =\u003e number): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.sort\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\n\nexport function sort(sortFn, list){\n  if (arguments.length === 1) return _list =\u003e sort(sortFn, _list)\n\n  return cloneList(list).sort(sortFn)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { sort } from './sort.js'\n\nconst fn = (a, b) =\u003e a \u003e b ? 1 : -1\n\ntest('sort', () =\u003e {\n  expect(sort((a, b) =\u003e a - b)([ 2, 3, 1 ])).toEqual([ 1, 2, 3 ])\n})\n\ntest('it doesn\\'t mutate', () =\u003e {\n  const list = [ 'foo', 'bar', 'baz' ]\n\n  expect(sort(fn, list)).toEqual([ 'bar', 'baz', 'foo' ])\n\n  expect(list[ 0 ]).toBe('foo')\n  expect(list[ 1 ]).toBe('bar')\n  expect(list[ 2 ]).toBe('baz')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {sort} from 'rambda'\n\nconst list = [3, 0, 5, 2, 1]\n\nfunction sortFn(a: number, b: number): number {\n  return a \u003e b ? 1 : -1\n}\n\ndescribe('R.sort', () =\u003e {\n  it('happy', () =\u003e {\n    const result = sort(sortFn, list)\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = sort(sortFn)(list)\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#sort)\n\n### sortBy\n\n```typescript\n\nsortBy\u003cT\u003e(sortFn: (a: T) =\u003e Ord, list: T[]): T[]\n```\n\nIt returns copy of `list` sorted by `sortFn` function, where `sortFn` function returns a value to compare, i.e. it doesn't need to return only `-1`, `0` or `1`.\n\n```javascript\nconst list = [\n  {a: 2},\n  {a: 3},\n  {a: 1}\n]\nconst sortFn = x =\u003e x.a\n\nconst result = R.sortBy(sortFn, list)\nconst expected = [\n  {a: 1},\n  {a: 2},\n  {a: 3}\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsortBy\u003cT\u003e(sortFn: (a: T) =\u003e Ord, list: T[]): T[];\nsortBy\u003cT\u003e(sortFn: (a: T) =\u003e Ord): (list: T[]) =\u003e T[];\nsortBy(sortFn: (a: any) =\u003e Ord): \u003cT\u003e(list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.sortBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\n\nexport function sortBy(sortFn, list){\n  if (arguments.length === 1) return _list =\u003e sortBy(sortFn, _list)\n\n  const clone = cloneList(list)\n\n  return clone.sort((a, b) =\u003e {\n    const aSortResult = sortFn(a)\n    const bSortResult = sortFn(b)\n\n    if (aSortResult === bSortResult) return 0\n\n    return aSortResult \u003c bSortResult ? -1 : 1\n  })\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { compose } from './compose.js'\nimport { prop } from './prop.js'\nimport { sortBy } from './sortBy.js'\nimport { toLower } from './toLower.js'\n\ntest('happy', () =\u003e {\n  const input = [ { a : 2 }, { a : 1 }, { a : 1 }, { a : 3 } ]\n  const expected = [ { a : 1 }, { a : 1 }, { a : 2 }, { a : 3 } ]\n\n  const result = sortBy(x =\u003e x.a)(input)\n  expect(result).toEqual(expected)\n})\n\ntest('with compose', () =\u003e {\n  const alice = {\n    name : 'ALICE',\n    age  : 101,\n  }\n  const bob = {\n    name : 'Bob',\n    age  : -10,\n  }\n  const clara = {\n    name : 'clara',\n    age  : 314.159,\n  }\n  const people = [ clara, bob, alice ]\n  const sortByNameCaseInsensitive = sortBy(compose(toLower, prop('name')))\n\n  expect(sortByNameCaseInsensitive(people)).toEqual([ alice, bob, clara ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {sortBy, pipe} from 'rambda'\n\ninterface Input {\n  a: number,\n}\n\ndescribe('R.sortBy', () =\u003e {\n  it('passing type to sort function', () =\u003e {\n    function fn(x: any): number {\n      return x.a\n    }\n    function fn2(x: Input): number {\n      return x.a\n    }\n\n    const input = [{a: 2}, {a: 1}, {a: 0}]\n    const result = sortBy(fn, input)\n    const curriedResult = sortBy(fn2)(input)\n\n    result // $ExpectType { a: number; }[]\n    curriedResult // $ExpectType Input[]\n    result[0].a // $ExpectType number\n    curriedResult[0].a // $ExpectType number\n  })\n  it('passing type to sort function and list', () =\u003e {\n    function fn(x: Input): number {\n      return x.a\n    }\n\n    const input: Input[] = [{a: 2}, {a: 1}, {a: 0}]\n    const result = sortBy(fn, input)\n    const curriedResult = sortBy(fn)(input)\n\n    result // $ExpectType Input[]\n    curriedResult // $ExpectType Input[]\n    result[0].a // $ExpectType number\n  })\n  it('with R.pipe', () =\u003e {\n    interface Obj {\n      value: number,\n    }\n    const fn = pipe(sortBy\u003cObj\u003e(x =\u003e x.value))\n\n    const result = fn([{value: 1}, {value: 2}])\n    result // $ExpectType Obj[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#sortBy)\n\n### sortWith\n\n```typescript\n\nsortWith\u003cT\u003e(fns: Array\u003c(a: T, b: T) =\u003e number\u003e): (list: T[]) =\u003e T[]\n```\n\n```javascript\nconst result = R.sortWith([\n    (a, b) =\u003e a.a === b.a ? 0 : a.a \u003e b.a ? 1 : -1,\n    (a, b) =\u003e a.b === b.b ? 0 : a.b \u003e b.b ? 1 : -1,\n], [\n  {a: 1, b: 2},\n  {a: 2, b: 1},\n  {a: 2, b: 2},\n  {a: 1, b: 1},\n])\nconst expected = [\n  {a: 1, b: 1},\n  {a: 1, b: 2},\n  {a: 2, b: 1},\n  {a: 2, b: 2},\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsortWith\u003cT\u003e(fns: Array\u003c(a: T, b: T) =\u003e number\u003e): (list: T[]) =\u003e T[];\nsortWith\u003cT\u003e(fns: Array\u003c(a: T, b: T) =\u003e number\u003e, list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.sortWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nfunction sortHelper(\n  a, b, listOfSortingFns\n){\n  let result = 0\n  let i = 0\n  while (result === 0 \u0026\u0026 i \u003c listOfSortingFns.length){\n    result = listOfSortingFns[ i ](a, b)\n    i += 1\n  }\n\n  return result\n}\n\nexport function sortWith(listOfSortingFns, list){\n  if (arguments.length === 1)\n    return _list =\u003e sortWith(listOfSortingFns, _list)\n\n  if (Array.isArray(list) === false)\n    return []\n\n  const clone = list.slice()\n  clone.sort((a, b) =\u003e sortHelper(\n    a, b, listOfSortingFns\n  ))\n\n  return clone\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { ascend, prop } from '../rambda.js'\nimport { sortWith } from './sortWith.js'\n\nconst albums = [\n  {\n    artist : 'Rush',\n    genre  : 'Rock',\n    score  : 3,\n    title  : 'A Farewell to Kings',\n  },\n  {\n    artist : 'Dave Brubeck Quartet',\n    genre  : 'Jazz',\n    score  : 3,\n    title  : 'Timeout',\n  },\n  {\n    artist : 'Rush',\n    genre  : 'Rock',\n    score  : 5,\n    title  : 'Fly By Night',\n  },\n  {\n    artist : 'Daniel Barenboim',\n    genre  : 'Baroque',\n    score  : 3,\n    title  : 'Goldberg Variations',\n  },\n  {\n    artist : 'Glenn Gould',\n    genre  : 'Baroque',\n    score  : 3,\n    title  : 'Art of the Fugue',\n  },\n  {\n    artist : 'Leonard Bernstein',\n    genre  : 'Romantic',\n    score  : 4,\n    title  : 'New World Symphony',\n  },\n  {\n    artist : 'Don Byron',\n    genre  : 'Jazz',\n    score  : 5,\n    title  : 'Romance with the Unseen',\n  },\n  {\n    artist : 'Iron Maiden',\n    genre  : 'Metal',\n    score  : 2,\n    title  : 'Somewhere In Time',\n  },\n  {\n    artist : 'Danny Holt',\n    genre  : 'Modern',\n    score  : 1,\n    title  : 'In Times of Desparation',\n  },\n  {\n    artist : 'Various',\n    genre  : 'Broadway',\n    score  : 3,\n    title  : 'Evita',\n  },\n  {\n    artist : 'Nick Drake',\n    genre  : 'Folk',\n    score  : 1,\n    title  : 'Five Leaves Left',\n  },\n  {\n    artist : 'John Eliot Gardiner',\n    genre  : 'Classical',\n    score  : 4,\n    title  : 'The Magic Flute',\n  },\n]\n\ntest('sorts by a simple property of the objects', () =\u003e {\n  const sortedAlbums = sortWith([ ascend(prop('title')) ], albums)\n  expect(sortedAlbums).toHaveLength(albums.length)\n  expect(sortedAlbums[ 0 ].title).toBe('A Farewell to Kings')\n  expect(sortedAlbums[ 11 ].title).toBe('Timeout')\n})\n\ntest('sorts by multiple properties of the objects', () =\u003e {\n  const sortedAlbums = sortWith([ ascend(prop('score')), ascend(prop('title')) ],\n    albums)\n  expect(sortedAlbums).toHaveLength(albums.length)\n  expect(sortedAlbums[ 0 ].title).toBe('Five Leaves Left')\n  expect(sortedAlbums[ 1 ].title).toBe('In Times of Desparation')\n  expect(sortedAlbums[ 11 ].title).toBe('Romance with the Unseen')\n})\n\ntest('sorts by 3 properties of the objects', () =\u003e {\n  const sortedAlbums = sortWith([ ascend(prop('genre')), ascend(prop('score')), ascend(prop('title')) ],\n    albums)\n  expect(sortedAlbums).toHaveLength(albums.length)\n  expect(sortedAlbums[ 0 ].title).toBe('Art of the Fugue')\n  expect(sortedAlbums[ 1 ].title).toBe('Goldberg Variations')\n  expect(sortedAlbums[ 11 ].title).toBe('New World Symphony')\n})\n\ntest('sorts by multiple properties using ascend and descend', () =\u003e {\n  const sortedAlbums = sortWith([ ascend(prop('score')), ascend(prop('title')) ],\n    albums)\n  expect(sortedAlbums).toHaveLength(albums.length)\n  expect(sortedAlbums[ 0 ].title).toBe('Five Leaves Left')\n  expect(sortedAlbums[ 1 ].title).toBe('In Times of Desparation')\n  expect(sortedAlbums[ 11 ].title).toBe('Romance with the Unseen')\n})\n\ntest('sorts only arrays not array-like object', () =\u003e {\n  const args = (function (){\n    return arguments\n  })(\n    'c', 'a', 'b'\n  )\n  expect(sortWith([ ascend(prop('value')) ], args)).toEqual([])\n})\n\ntest('sorts only arrays not primitives', () =\u003e {\n  const result =sortWith([\n    (a, b) =\u003e a.a === b.a ? 0 : a.a \u003e b.a ? 1 : -1,\n    (a, b) =\u003e a.b === b.b ? 0 : a.b \u003e b.b ? 1 : -1,\n  ], [\n    {a: 1, b: 2},\n    {a: 2, b: 1},\n    {a: 2, b: 2},\n    {a: 1, b: 1},\n  ])\n  const expected = [\n    {a: 1, b: 1},\n    {a: 1, b: 2},\n    {a: 2, b: 1},\n    {a: 2, b: 2},\n  ]\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#sortWith)\n\n### split\n\n```typescript\n\nsplit(separator: string | RegExp): (str: string) =\u003e string[]\n```\n\nCurried version of `String.prototype.split`\n\n```javascript\nconst str = 'foo|bar|baz'\nconst separator = '|'\nconst result = R.split(separator, str)\n// =\u003e [ 'foo', 'bar', 'baz' ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsplit(separator: string | RegExp): (str: string) =\u003e string[];\nsplit(separator: string | RegExp, str: string): string[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.split\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function split(separator, str){\n  if (arguments.length === 1) return _str =\u003e split(separator, _str)\n\n  return str.split(separator)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { split } from './split.js'\n\nconst str = 'foo|bar|baz'\nconst splitChar = '|'\nconst expected = [ 'foo', 'bar', 'baz' ]\n\ntest('happy', () =\u003e {\n  expect(split(splitChar, str)).toEqual(expected)\n})\n\ntest('curried', () =\u003e {\n  expect(split(splitChar)(str)).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {split} from 'rambda'\n\nconst str = 'foo|bar|baz'\nconst splitChar = '|'\n\ndescribe('R.split', () =\u003e {\n  it('happy', () =\u003e {\n    const result = split(splitChar, str)\n\n    result // $ExpectType string[]\n  })\n  it('curried', () =\u003e {\n    const result = split(splitChar)(str)\n\n    result // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#split)\n\n### splitAt\n\n```typescript\n\nsplitAt\u003cT\u003e(index: number, input: T[]): [T[], T[]]\n```\n\nIt splits string or array at a given index.\n\n```javascript\nconst list = [ 1, 2, 3 ]\nconst result = R.splitAt(2, list)\n// =\u003e [[ 1, 2 ], [ 3 ]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsplitAt\u003cT\u003e(index: number, input: T[]): [T[], T[]];\nsplitAt(index: number, input: string): [string, string];\nsplitAt(index: number): {\n    \u003cT\u003e(input: T[]): [T[], T[]];\n    (input: string): [string, string];\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.splitAt\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { drop } from './drop.js'\nimport { maybe } from './maybe.js'\nimport { take } from './take.js'\n\nexport function splitAt(index, input){\n  if (arguments.length === 1){\n    return _list =\u003e splitAt(index, _list)\n  }\n  if (!input) throw new TypeError(`Cannot read property 'slice' of ${ input }`)\n\n  if (!isArray(input) \u0026\u0026 typeof input !== 'string') return [ [], [] ]\n\n  const correctIndex = maybe(\n    index \u003c 0,\n    input.length + index \u003c 0 ? 0 : input.length + index,\n    index\n  )\n\n  return [ take(correctIndex, input), drop(correctIndex, input) ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { splitAt as splitAtRamda } from 'ramda'\n\nimport { splitAt } from './splitAt.js'\n\nconst list = [ 1, 2, 3 ]\nconst str = 'foo bar'\n\ntest('with array', () =\u003e {\n  const result = splitAt(2, list)\n  expect(result).toEqual([ [ 1, 2 ], [ 3 ] ])\n})\n\ntest('with array - index is negative number', () =\u003e {\n  const result = splitAt(-6, list)\n  expect(result).toEqual([ [], list ])\n})\n\ntest('with array - index is out of scope', () =\u003e {\n  const result = splitAt(4, list)\n  expect(result).toEqual([ [ 1, 2, 3 ], [] ])\n})\n\ntest('with string', () =\u003e {\n  const result = splitAt(4, str)\n  expect(result).toEqual([ 'foo ', 'bar' ])\n})\n\ntest('with string - index is negative number', () =\u003e {\n  const result = splitAt(-2, str)\n  expect(result).toEqual([ 'foo b', 'ar' ])\n})\n\ntest('with string - index is out of scope', () =\u003e {\n  const result = splitAt(10, str)\n  expect(result).toEqual([ str, '' ])\n})\n\ntest('with array - index is out of scope', () =\u003e {\n  const result = splitAt(4)(list)\n  expect(result).toEqual([ [ 1, 2, 3 ], [] ])\n})\n\nconst badInputs = [ 1, true, /foo/g, {} ]\nconst throwingBadInputs = [ null, undefined ]\n\ntest('with bad inputs', () =\u003e {\n  throwingBadInputs.forEach(badInput =\u003e {\n    expect(() =\u003e splitAt(1, badInput)).toThrowWithMessage(TypeError,\n      `Cannot read property 'slice' of ${ badInput }`)\n    expect(() =\u003e splitAtRamda(1, badInput)).toThrowWithMessage(TypeError,\n      `Cannot read properties of ${ badInput } (reading 'slice')`)\n  })\n\n  badInputs.forEach(badInput =\u003e {\n    const result = splitAt(1, badInput)\n    const ramdaResult = splitAtRamda(1, badInput)\n    expect(result).toEqual(ramdaResult)\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {splitAt} from 'rambda'\n\nconst index = 1\nconst str = 'foo'\nconst list = [1, 2, 3]\n\ndescribe('R.splitAt with array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = splitAt(index, list)\n\n    result // $ExpectType [number[], number[]]\n  })\n  it('curried', () =\u003e {\n    const result = splitAt(index)(list)\n\n    result // $ExpectType [number[], number[]]\n  })\n})\n\ndescribe('R.splitAt with string', () =\u003e {\n  it('happy', () =\u003e {\n    const result = splitAt(index, str)\n\n    result // $ExpectType [string, string]\n  })\n  it('curried', () =\u003e {\n    const result = splitAt(index)(str)\n\n    result // $ExpectType [string, string]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#splitAt)\n\n### splitEvery\n\n```typescript\n\nsplitEvery\u003cT\u003e(sliceLength: number, input: T[]): (T[])[]\n```\n\nIt splits `input` into slices of `sliceLength`.\n\n```javascript\nconst result = [\n  R.splitEvery(2, [1, 2, 3]), \n  R.splitEvery(3, 'foobar') \n]\n\nconst expected = [\n  [[1, 2], [3]],\n  ['foo', 'bar']\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsplitEvery\u003cT\u003e(sliceLength: number, input: T[]): (T[])[];\nsplitEvery(sliceLength: number, input: string): string[];\nsplitEvery(sliceLength: number): {\n  (input: string): string[];\n  \u003cT\u003e(input: T[]): (T[])[];\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.splitEvery\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function splitEvery(sliceLength, listOrString){\n  if (arguments.length === 1){\n    return _listOrString =\u003e splitEvery(sliceLength, _listOrString)\n  }\n\n  if (sliceLength \u003c 1){\n    throw new Error('First argument to splitEvery must be a positive integer')\n  }\n\n  const willReturn = []\n  let counter = 0\n\n  while (counter \u003c listOrString.length){\n    willReturn.push(listOrString.slice(counter, counter += sliceLength))\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { splitEvery } from './splitEvery.js'\n\ntest('happy', () =\u003e {\n  expect(splitEvery(3, [ 1, 2, 3, 4, 5, 6, 7 ])).toEqual([\n    [ 1, 2, 3 ],\n    [ 4, 5, 6 ],\n    [ 7 ],\n  ])\n\n  expect(splitEvery(3)('foobarbaz')).toEqual([ 'foo', 'bar', 'baz' ])\n})\n\ntest('with bad input', () =\u003e {\n  expect(() =\u003e\n    expect(splitEvery(0)('foo')).toEqual([ 'f', 'o', 'o' ])).toThrowErrorMatchingInlineSnapshot('\"First argument to splitEvery must be a positive integer\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {splitEvery} from 'rambda'\n\nconst list = [1, 2, 3, 4, 5, 6, 7]\n\ndescribe('R.splitEvery', () =\u003e {\n  it('happy', () =\u003e {\n    const result = splitEvery(3, list)\n\n    result // $ExpectType number[][]\n  })\n  it('curried', () =\u003e {\n    const result = splitEvery(3)(list)\n\n    result // $ExpectType number[][]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#splitEvery)\n\n### splitWhen\n\n```typescript\n\nsplitWhen\u003cT, U\u003e(predicate: Predicate\u003cT\u003e, list: U[]): (U[])[]\n```\n\nIt splits `list` to two arrays according to a `predicate` function. \n\nThe first array contains all members of `list` before `predicate` returns `true`.\n\n```javascript\nconst list = [1, 2, 1, 2]\nconst result = R.splitWhen(R.equals(2), list)\n// =\u003e [[1], [2, 1, 2]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsplitWhen\u003cT, U\u003e(predicate: Predicate\u003cT\u003e, list: U[]): (U[])[];\nsplitWhen\u003cT\u003e(predicate: Predicate\u003cT\u003e): \u003cU\u003e(list: U[]) =\u003e (U[])[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.splitWhen\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function splitWhen(predicate, input){\n  if (arguments.length === 1){\n    return _input =\u003e splitWhen(predicate, _input)\n  }\n  if (!input)\n    throw new TypeError(`Cannot read property 'length' of ${ input }`)\n\n  const preFound = []\n  const postFound = []\n  let found = false\n  let counter = -1\n\n  while (counter++ \u003c input.length - 1){\n    if (found){\n      postFound.push(input[ counter ])\n    } else if (predicate(input[ counter ])){\n      postFound.push(input[ counter ])\n      found = true\n    } else {\n      preFound.push(input[ counter ])\n    }\n  }\n\n  return [ preFound, postFound ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { splitWhen as splitWhenRamda } from 'ramda'\n\nimport { equals } from './equals.js'\nimport { splitWhen } from './splitWhen.js'\n\nconst list = [ 1, 2, 1, 2 ]\n\ntest('happy', () =\u003e {\n  const result = splitWhen(equals(2), list)\n  expect(result).toEqual([ [ 1 ], [ 2, 1, 2 ] ])\n})\n\ntest('when predicate returns false', () =\u003e {\n  const result = splitWhen(equals(3))(list)\n  expect(result).toEqual([ list, [] ])\n})\n\nconst badInputs = [ 1, true, /foo/g, {} ]\nconst throwingBadInputs = [ null, undefined ]\n\ntest('with bad inputs', () =\u003e {\n  throwingBadInputs.forEach(badInput =\u003e {\n    expect(() =\u003e splitWhen(equals(2), badInput)).toThrowWithMessage(TypeError,\n      `Cannot read property 'length' of ${ badInput }`)\n    expect(() =\u003e splitWhenRamda(equals(2), badInput)).toThrowWithMessage(TypeError,\n      `Cannot read properties of ${ badInput } (reading 'length')`)\n  })\n\n  badInputs.forEach(badInput =\u003e {\n    const result = splitWhen(equals(2), badInput)\n    const ramdaResult = splitWhenRamda(equals(2), badInput)\n    expect(result).toEqual(ramdaResult)\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {splitWhen} from 'rambda'\n\nconst list = [1, 2, 1, 2]\nconst predicate = (x: number) =\u003e x === 2\n\ndescribe('R.splitWhen', () =\u003e {\n  it('happy', () =\u003e {\n    const result = splitWhen(predicate, list)\n\n    result // $ExpectType number[][]\n  })\n  it('curried', () =\u003e {\n    const result = splitWhen(predicate)(list)\n\n    result // $ExpectType number[][]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#splitWhen)\n\n### startsWith\n\n```typescript\n\nstartsWith\u003cT extends string\u003e(question: T, input: string): boolean\n```\n\nWhen iterable is a string, then it behaves as `String.prototype.startsWith`.\nWhen iterable is a list, then it uses R.equals to determine if the target list starts in the same way as the given target.\n\n\u003e :boom: It doesn't work with arrays unlike its corresponding **Ramda** method.\n\n```javascript\nconst str = 'foo-bar'\nconst list = [{a:1}, {a:2}, {a:3}]\n\nconst result = [\n  R.startsWith('foo', str),\n  R.startsWith([{a:1}, {a:2}], list)\n]\n// =\u003e [true, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nstartsWith\u003cT extends string\u003e(question: T, input: string): boolean;\nstartsWith\u003cT extends string\u003e(question: T): (input: string) =\u003e boolean;\nstartsWith\u003cT\u003e(question: T[], input: T[]): boolean;\nstartsWith\u003cT\u003e(question: T[]): (input: T[]) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.startsWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { equals } from './equals.js'\n\nexport function startsWith(question, iterable){\n  if (arguments.length === 1)\n    return _iterable =\u003e startsWith(question, _iterable)\n\n  if (typeof iterable === 'string'){\n    return iterable.startsWith(question)\n  }\n  if (!isArray(question)) return false\n\n  let correct = true\n  const filtered = question.filter((x, index) =\u003e {\n    if (!correct) return false\n    const result = equals(x, iterable[ index ])\n    if (!result) correct = false\n\n    return result\n  })\n\n  return filtered.length === question.length\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { startsWith as startsWithRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { possibleIterables, possibleTargets } from './endsWith.spec.js'\nimport { startsWith } from './startsWith.js'\n\ntest('with string', () =\u003e {\n  expect(startsWith('foo', 'foo-bar')).toBeTrue()\n  expect(startsWith('baz')('foo-bar')).toBeFalse()\n})\n\ntest('use R.equals with array', () =\u003e {\n  const list = [ { a : 1 }, { a : 2 }, { a : 3 } ]\n  expect(startsWith({ a : 1 }, list)).toBeFalse()\n  expect(startsWith([ { a : 1 } ], list)).toBeTrue()\n  expect(startsWith([ { a : 1 }, { a : 2 } ], list)).toBeTrue()\n  expect(startsWith(list, list)).toBeTrue()\n  expect(startsWith([ { a : 2 } ], list)).toBeFalse()\n})\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    fn          : startsWith,\n    fnRamda     : startsWithRamda,\n    firstInput  : possibleTargets,\n    secondInput : possibleIterables,\n    callback    : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 0,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 32,\n        }\n      `)\n    },\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {startsWith} from 'rambda'\n\ndescribe('R.startsWith - array', () =\u003e {\n  const question = [{a: 1}]\n  const iterable = [{a: 1}, {a: 2}]\n  it('happy', () =\u003e {\n    const result = startsWith(question, iterable)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = startsWith(question)(iterable)\n    result // $ExpectType boolean\n  })\n})\n\ndescribe('R.startsWith - string', () =\u003e {\n  const question = 'foo'\n  const iterable = 'foo bar'\n  it('happy', () =\u003e {\n    const result = startsWith(question, iterable)\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = startsWith(question)(iterable)\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#startsWith)\n\n### subtract\n\n```typescript\n\nsubtract(x: number, y: number): number\n```\n\nCurried version of `x - y`\n\n```javascript\nconst x = 3\nconst y = 1\n\nconst result = R.subtract(x, y) \n// =\u003e 2\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsubtract(x: number, y: number): number;\nsubtract(x: number): (y: number) =\u003e number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.subtract\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function subtract(a, b){\n  if (arguments.length === 1) return _b =\u003e subtract(a, _b)\n\n  return a - b\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { subtract } from './subtract.js'\n\ntest('happy', () =\u003e {\n  expect(subtract(2, 1)).toBe(1)\n  expect(subtract(2)(1)).toBe(1)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#subtract)\n\n### sum\n\n```typescript\n\nsum(list: number[]): number\n```\n\n```javascript\nR.sum([1, 2, 3, 4, 5]) \n// =\u003e 15\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsum(list: number[]): number;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.sum\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function sum(list){\n  return list.reduce((prev, current) =\u003e prev + current, 0)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { sum } from './sum.js'\n\ntest('happy', () =\u003e {\n  expect(sum([ 1, 2, 3, 4, 5 ])).toBe(15)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#sum)\n\n### swap\n\n```typescript\n\nswap(indexA: number, indexB: number): \u003cT\u003e(list: T[]) =\u003e T[]\n```\n\n```javascript\nconst result = R.swap(1, 2, [1, 2, 3])\n// =\u003e [1, 3, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nswap(indexA: number, indexB: number): \u003cT\u003e(list: T[]) =\u003e T[];\nswap\u003cT\u003e(indexA: number, indexB: number, list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.swap\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js';\nimport { curry } from './curry.js';\n\nfunction swapArrayOrString(indexA, indexB, iterable) {\n\tconst actualIndexA = indexA \u003c 0 ? iterable.length + indexA : indexA;\n\tconst actualIndexB = indexB \u003c 0 ? iterable.length + indexB : indexB;\n\tif (\n\t\tactualIndexA === actualIndexB ||\n\t\tMath.min(actualIndexA, actualIndexB) \u003c 0 ||\n\t\tMath.max(actualIndexA, actualIndexB) \u003e= iterable.length\n\t)\n\t\treturn iterable;\n\tif (typeof iterable === 'string') {\n\t\treturn (\n\t\t\titerable.slice(0, actualIndexA) +\n\t\t\titerable[actualIndexB] +\n\t\t\titerable.slice(actualIndexA + 1, actualIndexB) +\n\t\t\titerable[actualIndexA] +\n\t\t\titerable.slice(actualIndexB + 1)\n\t\t);\n\t}\n\tconst clone = iterable.slice();\n\tconst temp = clone[actualIndexA];\n\tclone[actualIndexA] = clone[actualIndexB];\n\tclone[actualIndexB] = temp;\n\treturn clone;\n}\nfunction swapFn(indexA, indexB, iterable) {\n\tif (isArray(iterable) || typeof iterable === 'string')\n\t\treturn swapArrayOrString(indexA, indexB, iterable);\n\n\tconst aVal = iterable[indexA];\n\tconst bVal = iterable[indexB];\n\tif (aVal === undefined || bVal === undefined) return iterable;\n\treturn {\n\t\t...iterable,\n\t\t[indexA]: iterable[indexB],\n\t\t[indexB]: iterable[indexA],\n\t};\n}\n\nexport const swap = curry(swapFn);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { swap } from './swap';\nconst list = ['a', 'b', 'c', 'd', 'e', 'f'];\n\nit('swaps an element from one index to the other', () =\u003e {\n\texpect(swap(0, 1, list)).toEqual(['b', 'a', 'c', 'd', 'e', 'f']);\n\texpect(swap(2, 1, list)).toEqual(['a', 'c', 'b', 'd', 'e', 'f']);\n\texpect(swap(-1, 0, list)).toEqual(['f', 'b', 'c', 'd', 'e', 'a']);\n\texpect(swap(4, 1, list)).toEqual(['a', 'e', 'c', 'd', 'b', 'f']);\n});\n\nit('does nothing when indexes are outside the list boundaries', () =\u003e {\n\texpect(swap(-20, 2, list)).toEqual(list);\n\texpect(swap(20, 2, list)).toEqual(list);\n\texpect(swap(2, 20, list)).toEqual(list);\n\texpect(swap(2, -20, list)).toEqual(list);\n\texpect(swap(20, 20, list)).toEqual(list);\n\texpect(swap(-20, -20, list)).toEqual(list);\n});\n\nit('does nothing when indexes are equal', () =\u003e {\n\texpect(swap(0, 0, list)).toEqual(list);\n});\n\nit('should be the same when swapping index order', () =\u003e {\n\texpect(swap(0, 1, list)).toEqual(swap(1, 0, list));\n});\n\nit('swaps property values from one property to another', () =\u003e {\n\texpect(swap('a', 'b', { a: 1, b: 2 })).toEqual({ a: 2, b: 1 });\n\texpect(swap('b', 'a', { a: 1, b: 2 })).toEqual({ a: 2, b: 1 });\n});\n\nit('does nothing when property names are not defined', () =\u003e {\n\texpect(swap('a', 'b', { a: 1 })).toEqual({ a: 1 });\n\texpect(swap('a', 'b', { b: 2 })).toEqual({ b: 2 });\n});\n\nit('swaps characters in string from one index to another', () =\u003e {\n\texpect(swap(0, 2, 'foo')).toEqual('oof');\n});\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#swap)\n\n### symmetricDifference\n\n```typescript\n\nsymmetricDifference\u003cT\u003e(x: T[], y: T[]): T[]\n```\n\nIt returns a merged list of `x` and `y` with all equal elements removed.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst x = [ 1, 2, 3, 4 ]\nconst y = [ 3, 4, 5, 6 ]\n\nconst result = R.symmetricDifference(x, y)\n// =\u003e [ 1, 2, 5, 6 ]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nsymmetricDifference\u003cT\u003e(x: T[], y: T[]): T[];\nsymmetricDifference\u003cT\u003e(x: T[]): \u003cT\u003e(y: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.symmetricDifference\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { concat } from './concat.js'\nimport { filter } from './filter.js'\nimport { includes } from './includes.js'\n\nexport function symmetricDifference(x, y){\n  if (arguments.length === 1){\n    return _y =\u003e symmetricDifference(x, _y)\n  }\n\n  return concat(filter(value =\u003e !includes(value, y), x),\n    filter(value =\u003e !includes(value, x), y))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { symmetricDifference } from './symmetricDifference.js'\n\ntest('symmetricDifference', () =\u003e {\n  const list1 = [ 1, 2, 3, 4 ]\n  const list2 = [ 3, 4, 5, 6 ]\n  expect(symmetricDifference(list1)(list2)).toEqual([ 1, 2, 5, 6 ])\n\n  expect(symmetricDifference([], [])).toEqual([])\n})\n\ntest('symmetricDifference with objects', () =\u003e {\n  const list1 = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]\n  const list2 = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]\n  expect(symmetricDifference(list1)(list2)).toEqual([\n    { id : 1 },\n    { id : 2 },\n    { id : 5 },\n    { id : 6 },\n  ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {symmetricDifference} from 'rambda'\n\ndescribe('R.symmetricDifference', () =\u003e {\n  it('happy', () =\u003e {\n    const list1 = [1, 2, 3, 4]\n    const list2 = [3, 4, 5, 6]\n    const result = symmetricDifference(list1, list2)\n\n    result // $ExpectType number[]\n  })\n\n  it('curried', () =\u003e {\n    const list1 = [{id: 1}, {id: 2}, {id: 3}, {id: 4}]\n    const list2 = [{id: 3}, {id: 4}, {id: 5}, {id: 6}]\n    const result = symmetricDifference(list1)(list2)\n\n    result // $ExpectType { id: number; }[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#symmetricDifference)\n\n### T\n\n```typescript\n\nT(): boolean\n```\n\n```javascript\nR.T() \n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nT(): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.T\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function T(){\n  return true\n}\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#T)\n\n### tail\n\n```typescript\n\ntail\u003cT extends unknown[]\u003e(input: T): T extends [any, ...infer U] ? U : [...T]\n```\n\nIt returns all but the first element of `input`.\n\n```javascript\nconst result = [\n  R.tail([1, 2, 3]),  \n  R.tail('foo') \n]\n// =\u003e [[2, 3], 'oo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntail\u003cT extends unknown[]\u003e(input: T): T extends [any, ...infer U] ? U : [...T];\ntail(input: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.tail\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { drop } from './drop.js'\n\nexport function tail(listOrString){\n  return drop(1, listOrString)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { tail } from './tail.js'\n\ntest('tail', () =\u003e {\n  expect(tail([ 1, 2, 3 ])).toEqual([ 2, 3 ])\n  expect(tail([ 1, 2 ])).toEqual([ 2 ])\n  expect(tail([ 1 ])).toEqual([])\n  expect(tail([])).toEqual([])\n\n  expect(tail('abc')).toBe('bc')\n  expect(tail('ab')).toBe('b')\n  expect(tail('a')).toBe('')\n  expect(tail('')).toBe('')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {tail} from 'rambda'\n\ndescribe('R.tail', () =\u003e {\n  it('with string', () =\u003e {\n    const result = tail('foo')\n\n    result // $ExpectType string\n  })\n  it('with list - one type', () =\u003e {\n    const result = tail([1, 2, 3])\n\n    result // $ExpectType number[]\n  })\n  it('with list - mixed types', () =\u003e {\n    const result = tail(['foo', 'bar', 1, 2, 3])\n\n    result // $ExpectType (string | number)[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#tail)\n\n### take\n\n```typescript\n\ntake\u003cT\u003e(howMany: number, input: T): T extends string ? string : T\n```\n\nIt returns the first `howMany` elements of `input`.\n\n```javascript\nconst howMany = 2\n\nconst result = [\n  R.take(howMany, [1, 2, 3]),\n  R.take(howMany, 'foobar'),\n]\n// =\u003e [[1, 2], 'fo']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntake\u003cT\u003e(howMany: number, input: T): T extends string ? string : T;\ntake\u003cT\u003e(howMany: number) : (input: T) =\u003e T extends string ? string : T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.take\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport baseSlice from './_internals/baseSlice.js'\n\nexport function take(howMany, listOrString){\n  if (arguments.length === 1)\n    return _listOrString =\u003e take(howMany, _listOrString)\n  if (howMany \u003c 0) return listOrString.slice()\n  if (typeof listOrString === 'string') return listOrString.slice(0, howMany)\n\n  return baseSlice(\n    listOrString, 0, howMany\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { take } from './take.js'\n\ntest('happy', () =\u003e {\n  const arr = [ 'foo', 'bar', 'baz' ]\n\n  expect(take(1, arr)).toEqual([ 'foo' ])\n\n  expect(arr).toEqual([ 'foo', 'bar', 'baz' ])\n\n  expect(take(2)([ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar' ])\n  expect(take(3, [ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar', 'baz' ])\n  expect(take(4, [ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar', 'baz' ])\n  expect(take(3)('rambda')).toBe('ram')\n})\n\ntest('with negative index', () =\u003e {\n  expect(take(-1, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(take(-Infinity, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n})\n\ntest('with zero index', () =\u003e {\n  expect(take(0, [ 1, 2, 3 ])).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {take} from 'rambda'\n\nconst list = [1, 2, 3, 4]\nconst str = 'foobar'\nconst howMany = 2\n\ndescribe('R.take - array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = take(howMany, list)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = take\u003cnumber[]\u003e(howMany)(list)\n\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('R.take - string', () =\u003e {\n  it('happy', () =\u003e {\n    const result = take(howMany, str)\n\n    result // $ExpectType string\n  })\n  it('curried', () =\u003e {\n    const result = take\u003cstring\u003e(howMany)(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#take)\n\n### takeLast\n\n```typescript\n\ntakeLast\u003cT\u003e(howMany: number, input: T): T extends string ? string : T\n```\n\nIt returns the last `howMany` elements of `input`.\n\n```javascript\nconst howMany = 2\n\nconst result = [\n  R.takeLast(howMany, [1, 2, 3]),\n  R.takeLast(howMany, 'foobar'),\n]\n// =\u003e [[2, 3], 'ar']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntakeLast\u003cT\u003e(howMany: number, input: T): T extends string ? string : T;\ntakeLast\u003cT\u003e(howMany: number) : (input: T) =\u003e T extends string ? string : T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.takeLast\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport baseSlice from './_internals/baseSlice.js'\n\nexport function takeLast(howMany, listOrString){\n  if (arguments.length === 1)\n    return _listOrString =\u003e takeLast(howMany, _listOrString)\n\n  const len = listOrString.length\n  if (howMany \u003c 0) return listOrString.slice()\n  let numValue = howMany \u003e len ? len : howMany\n\n  if (typeof listOrString === 'string')\n    return listOrString.slice(len - numValue)\n\n  numValue = len - numValue\n\n  return baseSlice(\n    listOrString, numValue, len\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { takeLast } from './takeLast.js'\n\ntest('with arrays', () =\u003e {\n  expect(takeLast(1, [ 'foo', 'bar', 'baz' ])).toEqual([ 'baz' ])\n\n  expect(takeLast(2)([ 'foo', 'bar', 'baz' ])).toEqual([ 'bar', 'baz' ])\n\n  expect(takeLast(3, [ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar', 'baz' ])\n\n  expect(takeLast(4, [ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar', 'baz' ])\n\n  expect(takeLast(10, [ 'foo', 'bar', 'baz' ])).toEqual([ 'foo', 'bar', 'baz' ])\n})\n\ntest('with strings', () =\u003e {\n  expect(takeLast(3, 'rambda')).toBe('bda')\n\n  expect(takeLast(7, 'rambda')).toBe('rambda')\n})\n\ntest('with negative index', () =\u003e {\n  expect(takeLast(-1, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n  expect(takeLast(-Infinity, [ 1, 2, 3 ])).toEqual([ 1, 2, 3 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {filter, piped, takeLast} from 'rambda'\n\nconst list = [1, 2, 3, 4]\nconst str = 'foobar'\nconst howMany = 2\n\ndescribe('R.takeLast - array', () =\u003e {\n  it('happy', () =\u003e {\n    const result = takeLast(howMany, list)\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = takeLast\u003cnumber[]\u003e(howMany)(list)\n\n    result // $ExpectType number[]\n  })\n\tit('real case', () =\u003e {\n\t\tconst data = ['foo', 'bar', 'baz', 'qux']\n\t\tconst result = piped(\n\t\t\tdata,\n\t\t\tfilter(\n\t\t\t\tx =\u003e x.length \u003e= 100\n\t\t\t),\n\t\t\ttakeLast(2),\n\t\t)\n\t\tresult // $ExpectType string[]\n\t})\n})\n\ndescribe('R.takeLast - string', () =\u003e {\n  it('happy', () =\u003e {\n    const result = takeLast(howMany, str)\n\n    result // $ExpectType string\n  })\n  it('curried', () =\u003e {\n    const result = takeLast\u003cstring\u003e(howMany)(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#takeLast)\n\n### takeLastWhile\n\n```typescript\n\ntakeLastWhile(predicate: (x: string) =\u003e boolean, input: string): string\n```\n\n```javascript\nconst result = R.takeLastWhile(\n  x =\u003e x \u003e 2,\n  [1, 2, 3, 4]\n)\n// =\u003e [3, 4]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntakeLastWhile(predicate: (x: string) =\u003e boolean, input: string): string;\ntakeLastWhile(predicate: (x: string) =\u003e boolean): (input: string) =\u003e string;\ntakeLastWhile\u003cT\u003e(predicate: (x: T) =\u003e boolean, input: T[]): T[];\ntakeLastWhile\u003cT\u003e(predicate: (x: T) =\u003e boolean): \u003cT\u003e(input: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.takeLastWhile\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function takeLastWhile(predicate, input){\n  if (arguments.length === 1){\n    return _input =\u003e takeLastWhile(predicate, _input)\n  }\n  if (input.length === 0) return input\n\n  const toReturn = []\n  let counter = input.length\n\n  while (counter){\n    const item = input[ --counter ]\n    if (!predicate(item)){\n      break\n    }\n    toReturn.push(item)\n  }\n\n  return isArray(input) ? toReturn.reverse() : toReturn.reverse().join('')\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { takeLastWhile } from './takeLastWhile.js'\nconst assert = require('assert')\n\nconst list = [ 1, 2, 3, 4 ]\n\ntest('happy', () =\u003e {\n  const predicate = x =\u003e x \u003e 2\n  const result = takeLastWhile(predicate, list)\n  expect(result).toEqual([ 3, 4 ])\n})\n\ntest('predicate is always true', () =\u003e {\n  const predicate = () =\u003e true\n  const result = takeLastWhile(predicate)(list)\n  expect(result).toEqual(list)\n})\n\ntest('predicate is always false', () =\u003e {\n  const predicate = () =\u003e false\n  const result = takeLastWhile(predicate, list)\n  expect(result).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  const result = takeLastWhile(x =\u003e x !== 'F', 'FOOBAR')\n  expect(result).toBe('OOBAR')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {takeLastWhile} from 'rambda'\n\nconst list = [1, 2, 3]\nconst str = 'FOO'\n\ndescribe('R.takeLastWhile', () =\u003e {\n  it('with array', () =\u003e {\n    const result = takeLastWhile(x =\u003e x \u003e 1, list)\n\n    result // $ExpectType number[]\n  })\n  it('with array - curried', () =\u003e {\n    const result = takeLastWhile(x =\u003e x \u003e 1, list)\n\n    result // $ExpectType number[]\n  })\n  it('with string', () =\u003e {\n    const result = takeLastWhile(x =\u003e x !== 'F', str)\n\n    result // $ExpectType string\n  })\n  it('with string - curried', () =\u003e {\n    const result = takeLastWhile(x =\u003e x !== 'F')(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#takeLastWhile)\n\n### takeWhile\n\n```typescript\n\ntakeWhile(fn: Predicate\u003cstring\u003e, iterable: string): string\n```\n\n```javascript\nconst list = [1, 2, 3, 4]\nconst predicate = x =\u003e x \u003c 3\n\nconst result = R.takeWhile(predicate, list)\n// =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntakeWhile(fn: Predicate\u003cstring\u003e, iterable: string): string;\ntakeWhile(fn: Predicate\u003cstring\u003e): (iterable: string) =\u003e string;\ntakeWhile\u003cT\u003e(fn: Predicate\u003cT\u003e, iterable: T[]): T[];\ntakeWhile\u003cT\u003e(fn: Predicate\u003cT\u003e): (iterable: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.takeWhile\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray as isArrayModule } from './_internals/isArray.js'\n\nexport function takeWhile(predicate, iterable){\n  if (arguments.length === 1){\n    return _iterable =\u003e takeWhile(predicate, _iterable)\n  }\n  const isArray = isArrayModule(iterable)\n  if (!isArray \u0026\u0026 typeof iterable !== 'string'){\n    throw new Error('`iterable` is neither list nor a string')\n  }\n\n  const toReturn = []\n  let counter = 0\n\n  while (counter \u003c iterable.length){\n    const item = iterable[ counter++ ]\n    if (!predicate(item)){\n      break\n    }\n    toReturn.push(item)\n  }\n\n  return isArray ? toReturn : toReturn.join('')\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { takeWhile as takeWhileRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { takeWhile } from './takeWhile.js'\n\nconst list = [ 1, 2, 3, 4, 5 ]\n\ntest('happy', () =\u003e {\n  const result = takeWhile(x =\u003e x \u003c 3, list)\n  expect(result).toEqual([ 1, 2 ])\n})\n\ntest('always true', () =\u003e {\n  const result = takeWhile(x =\u003e true)(list)\n  expect(result).toEqual(list)\n})\n\ntest('always false', () =\u003e {\n  const result = takeWhile(x =\u003e 0, list)\n  expect(result).toEqual([])\n})\n\ntest('with string', () =\u003e {\n  const result = takeWhile(x =\u003e x !== 'b', 'foobar')\n  expect(result).toBe('foo')\n})\n\nconst possiblePredicates = [\n  null,\n  undefined,\n  () =\u003e 0,\n  () =\u003e true,\n  x =\u003e x !== 'b',\n  /foo/g,\n  {},\n  [],\n]\n\nconst possibleIterables = [\n  null,\n  undefined,\n  [],\n  {},\n  1,\n  '',\n  'foobar',\n  [ '' ],\n  [ 1, 2, 3, 4, 5 ],\n]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    firstInput : possiblePredicates,\n    callback   : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 15,\n          \"ERRORS_TYPE_MISMATCH\": 16,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 16,\n          \"SHOULD_THROW\": 0,\n          \"TOTAL_TESTS\": 72,\n        }\n      `)\n    },\n    secondInput : possibleIterables,\n    fn          : takeWhile,\n    fnRamda     : takeWhileRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {takeWhile} from 'rambda'\n\nconst list = [1, 2, 3, 4]\n\ndescribe('R.takeWhile', () =\u003e {\n  it('happy', () =\u003e {\n    const result = takeWhile(x =\u003e x \u003e 2, list)\n\n    result // $ExpectType number[]\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = takeWhile\u003cnumber\u003e(x =\u003e x \u003e 2)(list)\n\n    result // $ExpectType number[]\n  })\n})\n\ndescribe('with string as iterable', () =\u003e {\n  const str = 'foobar'\n  it('happy', () =\u003e {\n    const result = takeWhile(x =\u003e x !== 'b', str)\n\n    result // $ExpectType string\n  })\n  it('curried require explicit type', () =\u003e {\n    const result = takeWhile(x =\u003e x !== 'b')(str)\n\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#takeWhile)\n\n### tap\n\n```typescript\n\ntap\u003cT\u003e(fn: (x: T) =\u003e void, input: T): T\n```\n\nIt applies function `fn` to input `x` and returns `x`. \n\nOne use case is debugging in the middle of `R.compose`.\n\n```javascript\nconst list = [1, 2, 3]\n\nR.compose(\n  R.map(x =\u003e x * 2)\n  R.tap(console.log),\n  R.filter(x =\u003e x \u003e 1)\n)(list)\n// =\u003e `2` and `3` will be logged\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntap\u003cT\u003e(fn: (x: T) =\u003e void, input: T): T;\ntap\u003cT\u003e(fn: (x: T) =\u003e void): (input: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.tap\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function tap(fn, x){\n  if (arguments.length === 1) return _x =\u003e tap(fn, _x)\n\n  fn(x)\n\n  return x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { tap } from './tap.js'\n\ntest('tap', () =\u003e {\n  let a = 1\n  const sayX = x =\u003e a = x\n\n  expect(tap(sayX, 100)).toBe(100)\n  expect(tap(sayX)(100)).toBe(100)\n  expect(a).toBe(100)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {tap, pipe} from 'rambda'\n\ndescribe('R.tap', () =\u003e {\n  it('happy', () =\u003e {\n    pipe(\n      tap(x =\u003e {\n        x // $ExpectType number[]\n      }),\n      (x: number[]) =\u003e x.length\n    )([1, 2])\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#tap)\n\n### test\n\n```typescript\n\ntest(regExpression: RegExp): (str: string) =\u003e boolean\n```\n\nIt determines whether `str` matches `regExpression`.\n\n```javascript\nR.test(/^f/, 'foo')\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntest(regExpression: RegExp): (str: string) =\u003e boolean;\ntest(regExpression: RegExp, str: string): boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.test\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function test(pattern, str){\n  if (arguments.length === 1) return _str =\u003e test(pattern, _str)\n\n  if (typeof pattern === 'string'){\n    throw new TypeError(`R.test requires a value of type RegExp as its first argument; received \"${ pattern }\"`)\n  }\n\n  return str.search(pattern) !== -1\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { test as testMethod } from './test.js'\n\ntest('happy', () =\u003e {\n  expect(testMethod(/^x/, 'xyz')).toBeTrue()\n\n  expect(testMethod(/^y/)('xyz')).toBeFalse()\n})\n\ntest('throws if first argument is not regex', () =\u003e {\n  expect(() =\u003e testMethod('foo', 'bar')).toThrowErrorMatchingInlineSnapshot('\"R.test requires a value of type RegExp as its first argument; received \"foo\"\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {test} from 'rambda'\n\nconst input = 'foo   '\nconst regex = /foo/\n\ndescribe('R.test', () =\u003e {\n  it('happy', () =\u003e {\n    const result = test(regex, input)\n\n    result // $ExpectType boolean\n  })\n  it('curried', () =\u003e {\n    const result = test(regex)(input)\n\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#test)\n\n### times\n\n```typescript\n\ntimes\u003cT\u003e(fn: (i: number) =\u003e T, howMany: number): T[]\n```\n\nIt returns the result of applying function `fn` over members of range array.\n\nThe range array includes numbers between `0` and `howMany`(exclusive).\n\n```javascript\nconst fn = x =\u003e x * 2\nconst howMany = 5\n\nR.times(fn, howMany)\n// =\u003e [0, 2, 4, 6, 8]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntimes\u003cT\u003e(fn: (i: number) =\u003e T, howMany: number): T[];\ntimes\u003cT\u003e(fn: (i: number) =\u003e T): (howMany: number) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.times\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isInteger } from './_internals/isInteger.js'\nimport { map } from './map.js'\nimport { range } from './range.js'\n\nexport function times(fn, howMany){\n  if (arguments.length === 1) return _howMany =\u003e times(fn, _howMany)\n  if (!isInteger(howMany) || howMany \u003c 0){\n    throw new RangeError('n must be an integer')\n  }\n\n  return map(fn, range(0, howMany))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport assert from 'assert'\n\nimport { identity } from './identity.js'\nimport { times } from './times.js'\n\ntest('happy', () =\u003e {\n  const result = times(identity, 5)\n\n  expect(result).toEqual([ 0, 1, 2, 3, 4 ])\n})\n\ntest('with bad input', () =\u003e {\n  assert.throws(() =\u003e {\n    times(3)('cheers!')\n  }, RangeError)\n  assert.throws(() =\u003e {\n    times(identity, -1)\n  }, RangeError)\n})\n\ntest('curry', () =\u003e {\n  const result = times(identity)(5)\n\n  expect(result).toEqual([ 0, 1, 2, 3, 4 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {times, identity} from 'rambda'\n\ndescribe('R.times', () =\u003e {\n  it('happy', () =\u003e {\n    const result = times(identity, 5)\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#times)\n\n### toLower\n\n```typescript\n\ntoLower\u003cS extends string\u003e(str: S): Lowercase\u003cS\u003e\n```\n\n```javascript\nR.toLower('FOO')\n// =\u003e 'foo'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntoLower\u003cS extends string\u003e(str: S): Lowercase\u003cS\u003e;\ntoLower(str: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.toLower\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function toLower(str){\n  return str.toLowerCase()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { toLower } from './toLower.js'\n\ntest('toLower', () =\u003e {\n  expect(toLower('FOO|BAR|BAZ')).toBe('foo|bar|baz')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#toLower)\n\n### toPairs\n\n```typescript\n\ntoPairs\u003cO extends object, K extends Extract\u003ckeyof O, string | number\u003e\u003e(obj: O): Array\u003c{ [key in K]: [`${key}`, O[key]] }[K]\u003e\n```\n\nIt transforms an object to a list.\n\n```javascript\nconst list = {\n  a : 1,\n  b : 2,\n  c : [ 3, 4 ],\n}\nconst expected = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]\n\nconst result = R.toPairs(list)\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntoPairs\u003cO extends object, K extends Extract\u003ckeyof O, string | number\u003e\u003e(obj: O): Array\u003c{ [key in K]: [`${key}`, O[key]] }[K]\u003e;\ntoPairs\u003cS\u003e(obj: Record\u003cstring | number, S\u003e): Array\u003c[string, S]\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.toPairs\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function toPairs(obj){\n  return Object.entries(obj)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { toPairs } from './toPairs.js'\n\nconst obj = {\n  a : 1,\n  b : 2,\n  c : [ 3, 4 ],\n}\nconst expected = [\n  [ 'a', 1 ],\n  [ 'b', 2 ],\n  [ 'c', [ 3, 4 ] ],\n]\n\ntest('happy', () =\u003e {\n  expect(toPairs(obj)).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#toPairs)\n\n### toString\n\n```typescript\n\ntoString(x: unknown): string\n```\n\n```javascript\nR.toString([1, 2]) \n// =\u003e '1,2'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntoString(x: unknown): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.toString\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function toString(x){\n  return x.toString()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { toString } from './toString.js'\n\ntest('happy', () =\u003e {\n  expect(toString([ 1, 2, 3 ])).toBe('1,2,3')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#toString)\n\n### toUpper\n\n```typescript\n\ntoUpper\u003cS extends string\u003e(str: S): Uppercase\u003cS\u003e\n```\n\n```javascript\nR.toUpper('foo')\n// =\u003e 'FOO'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntoUpper\u003cS extends string\u003e(str: S): Uppercase\u003cS\u003e;\ntoUpper(str: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.toUpper\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function toUpper(str){\n  return str.toUpperCase()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { toUpper } from './toUpper.js'\n\ntest('toUpper', () =\u003e {\n  expect(toUpper('foo|bar|baz')).toBe('FOO|BAR|BAZ')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#toUpper)\n\n### transpose\n\n```typescript\n\ntranspose\u003cT\u003e(list: (T[])[]): (T[])[]\n```\n\n```javascript\nconst list = [[10, 11], [20], [], [30, 31, 32]]\nconst expected = [[10, 20, 30], [11, 31], [32]]\n\nconst result = R.transpose(list)\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntranspose\u003cT\u003e(list: (T[])[]): (T[])[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.transpose\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\n\nexport function transpose(array){\n  return array.reduce((acc, el) =\u003e {\n    el.forEach((nestedEl, i) =\u003e\n      isArray(acc[ i ]) ? acc[ i ].push(nestedEl) : acc.push([ nestedEl ]))\n\n    return acc\n  }, [])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { transpose } from './transpose.js'\n\ntest('happy', () =\u003e {\n  const input = [\n    [ 'a', 1 ],\n    [ 'b', 2 ],\n    [ 'c', 3 ],\n  ]\n\n  expect(transpose(input)).toEqual([\n    [ 'a', 'b', 'c' ],\n    [ 1, 2, 3 ],\n  ])\n})\n\ntest('when rows are shorter', () =\u003e {\n  const actual = transpose([ [ 10, 11 ], [ 20 ], [], [ 30, 31, 32 ] ])\n  const expected = [ [ 10, 20, 30 ], [ 11, 31 ], [ 32 ] ]\n  expect(actual).toEqual(expected)\n})\n\ntest('with empty array', () =\u003e {\n  expect(transpose([])).toEqual([])\n})\n\ntest('array with falsy values', () =\u003e {\n  const actual = transpose([\n    [ true, false, undefined, null ],\n    [ null, undefined, false, true ],\n  ])\n  const expected = [\n    [ true, null ],\n    [ false, undefined ],\n    [ undefined, false ],\n    [ null, true ],\n  ]\n  expect(actual).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {transpose} from 'rambda'\n\nconst input = [\n  ['a', 1],\n  ['b', 2],\n  ['c', 3],\n]\n\ndescribe('R.transpose', () =\u003e {\n  it('happy', () =\u003e {\n    const result = transpose(input)\n\n    result // $ExpectType (string | number)[][]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#transpose)\n\n### trim\n\n```typescript\n\ntrim(str: string): string\n```\n\n```javascript\nR.trim('  foo  ') \n// =\u003e 'foo'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntrim(str: string): string;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.trim\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function trim(str){\n  return str.trim()\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { trim } from './trim.js'\n\ntest('trim', () =\u003e {\n  expect(trim(' foo ')).toBe('foo')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#trim)\n\n### tryCatch\n\n```typescript\n\ntryCatch\u003cT, U\u003e(\n  fn: (input: T) =\u003e U,\n  fallback: U\n): (input: T) =\u003e U\n```\n\nIt returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result. Note that `fn` can be value or asynchronous/synchronous function(unlike `Ramda` where fallback can only be a synchronous function).\n\n\u003e :boom: Please check the tests of `R.tryCatch` to fully understand how this method works.\n\n```javascript\nconst fn = x =\u003e x.foo\n\nconst result = [\n  R.tryCatch(fn, false)(null),\n  R.tryCatch(fn, false)({foo: 'bar'})\n]\n// =\u003e [false, 'bar']\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntryCatch\u003cT, U\u003e(\n  fn: (input: T) =\u003e U,\n  fallback: U\n): (input: T) =\u003e U;\ntryCatch\u003cT, U\u003e(\n  fn: (input: T) =\u003e U,\n  fallback: (input: T) =\u003e U\n): (input: T) =\u003e U;\ntryCatch\u003cT\u003e(\n  fn: (input: any) =\u003e Promise\u003cany\u003e,\n  fallback: T\n): (input: any) =\u003e Promise\u003cT\u003e;\ntryCatch\u003cT\u003e(\n  fn: (input: any) =\u003e Promise\u003cany\u003e,\n  fallback: (input: any) =\u003e Promise\u003cany\u003e,\n): (input: any) =\u003e Promise\u003cT\u003e;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.tryCatch\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { type } from './type.js'\n\nconst isFunction = x =\u003e [ 'Promise', 'Function' ].includes(type(x))\n\nexport function tryCatch(fn, fallback){\n  if (!isFunction(fn)){\n    throw new Error(`R.tryCatch | fn '${ fn }'`)\n  }\n  const passFallback = isFunction(fallback)\n\n  return (...inputs) =\u003e {\n    try {\n      return fn(...inputs)\n    } catch (e){\n      return passFallback ? fallback(e, ...inputs) : fallback\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { tryCatch as tryCatchRamda } from 'ramda'\n\nimport { compareCombinations } from './_internals/testUtils.js'\nimport { prop } from './prop.js'\nimport { tryCatch } from './tryCatch.js'\n\ntest('happy', () =\u003e {\n  const fn = () =\u003e {\n    throw new Error('foo')\n  }\n  const result = tryCatch(fn, () =\u003e true)()\n  expect(result).toBeTrue()\n})\n\ntest('when fallback is used', () =\u003e {\n  const fn = x =\u003e x.x\n\n  expect(tryCatch(fn, false)(null)).toBeFalse()\n})\n\ntest('with json parse', () =\u003e {\n  const good = () =\u003e JSON.parse(JSON.stringify({ a : 1 }))\n  const bad = () =\u003e JSON.parse('a{a')\n\n  expect(tryCatch(good, 1)()).toEqual({ a : 1 })\n  expect(tryCatch(bad, 1)()).toBe(1)\n})\n\ntest('when fallback is function', () =\u003e {\n  const fn = x =\u003e x.x\n\n  expect(tryCatch(fn, () =\u003e 1)(null)).toBe(1)\n})\n\ntest('when fn is used', () =\u003e {\n  const fn = prop('x')\n\n  expect(tryCatch(fn, false)({})).toBeUndefined()\n  expect(tryCatch(fn, false)({ x : 1 })).toBe(1)\n})\n\ntest('fallback receives error object and all initial inputs', () =\u003e {\n  function thrower(\n    a, b, c\n  ){\n    void c\n    throw new Error('throwerError')\n  }\n\n  function catchFn(\n    e, a, b, c\n  ){\n    return [ e.message, a, b, c ].join('|')\n  }\n\n  const willThrow = tryCatch(thrower, catchFn)\n  const result = willThrow(\n    'A', 'B', 'C'\n  )\n  expect(result).toBe('throwerError|A|B|C')\n})\n\ntest('fallback receives error object', () =\u003e {\n  function throwFn(){\n    throw new Error(10)\n  }\n\n  function eCatcher(\n    e, a, b\n  ){\n    return e.message\n  }\n\n  const willThrow = tryCatch(throwFn, eCatcher)\n  expect(willThrow([])).toBe('10')\n  expect(willThrow([ {}, {}, {} ])).toBe('10')\n})\n\nconst possibleFns = [\n  null,\n  () =\u003e 1,\n  () =\u003e 0,\n  () =\u003e JSON.parse('{a:1'),\n  () =\u003e {\n    const x = {}\n\n    return x.x\n  },\n  x =\u003e x.foo,\n  () =\u003e {\n    throw new Error('foo')\n  },\n]\n\nconst possibleCatchers = [\n  null,\n  e =\u003e e.message.length,\n  (e, ...inputs) =\u003e `${ e.message.length } ${ inputs.length }`,\n  () =\u003e {\n    throw new Error('bar')\n  },\n]\n\nconst possibleInputs = [ null, {}, { foo : 1 } ]\n\ndescribe('brute force', () =\u003e {\n  compareCombinations({\n    returnsFunctionFlag : true,\n    firstInput          : possibleFns,\n    callback            : errorsCounters =\u003e {\n      expect(errorsCounters).toMatchInlineSnapshot(`\n        {\n          \"ERRORS_MESSAGE_MISMATCH\": 0,\n          \"ERRORS_TYPE_MISMATCH\": 12,\n          \"RESULTS_MISMATCH\": 0,\n          \"SHOULD_NOT_THROW\": 0,\n          \"SHOULD_THROW\": 7,\n          \"TOTAL_TESTS\": 84,\n        }\n      `)\n    },\n    secondInput : possibleCatchers,\n    thirdInput  : possibleInputs,\n    fn          : tryCatch,\n    fnRamda     : tryCatchRamda,\n  })\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {tryCatch, delay} from 'rambda'\n\ndescribe('R.tryCatch', () =\u003e {\n  it('synchronous', () =\u003e {\n    const fn = (x: any) =\u003e x.x === 1\n\n    const result = tryCatch(fn, false)(null)\n    result // $ExpectType boolean\n  })\n  it('synchronous + fallback is function', () =\u003e {\n    const fn = (x: any) =\u003e typeof x.x\n    const fallback = (x: any) =\u003e typeof x\n    const result = tryCatch\u003cany, string\u003e(fn, fallback)(null)\n    result // $ExpectType string\n  })\n\n  it('asynchronous', async() =\u003e {\n    const fn = async(input: any) =\u003e {\n      return typeof JSON.parse('{a:')\n    }\n    const result = await tryCatch\u003cstring\u003e(fn, 'fallback')(100)\n    result // $ExpectType string\n  })\n\n  it('asynchronous + fallback is asynchronous', async() =\u003e {\n    const fn = async(input: any) =\u003e {\n      await delay(100)\n      return JSON.parse(`{a:${input}`)\n    }\n    const fallback = async(input: any) =\u003e {\n      await delay(100)\n      return 'foo'\n    }\n    const result = await tryCatch\u003cstring\u003e(fn, fallback)(100)\n    result // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#tryCatch)\n\n### type\n\n```typescript\n\ntype(x: any): RambdaTypes\n```\n\nIt accepts any input and it returns its type.\n\n\u003e :boom: `NaN`, `Promise` and `Async` are types specific for **Rambda**.\n\n```javascript\nconst result = R.type(() =\u003e {}) // =\u003e 'Function'\nR.type(async () =\u003e {}) // =\u003e 'Async'\nR.type([]) // =\u003e 'Array'\nR.type({}) // =\u003e 'Object'\nR.type('foo') // =\u003e 'String'\nR.type(1) // =\u003e 'Number'\nR.type(true) // =\u003e 'Boolean'\nR.type(null) // =\u003e 'Null'\nR.type(/[A-z]/) // =\u003e 'RegExp'\nR.type('foo'*1) // =\u003e 'NaN'\n\nconst delay = ms =\u003e new Promise(resolve =\u003e {\n  setTimeout(function () {\n    resolve()\n  }, ms)\n})\nR.type(delay) // =\u003e 'Promise'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\ntype(x: any): RambdaTypes;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.type\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function type(input){\n  if (input === null){\n    return 'Null'\n  } else if (input === undefined){\n    return 'Undefined'\n  } else if (Number.isNaN(input)){\n    return 'NaN'\n  }\n  const typeResult = Object.prototype.toString.call(input).slice(8, -1)\n\n  return typeResult === 'AsyncFunction' ? 'Promise' : typeResult\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { type as typeRamda } from 'ramda'\n\nimport { type } from './type.js'\n\ntest('with buffer', () =\u003e {\n  expect(type(new Buffer.from('foo'))).toBe('Uint8Array')\n})\n\ntest('with array buffer', () =\u003e {\n  expect(type(new ArrayBuffer(8))).toBe('ArrayBuffer')\n})\n\ntest('with big int', () =\u003e {\n  expect(type(BigInt(9007199254740991))).toBe('BigInt')\n})\n\ntest('with generators', () =\u003e {\n  function* generator(){\n    yield 1\n    yield 2\n    yield 3\n  }\n\n  const gen = generator()\n  expect(type(generator)).toBe('GeneratorFunction')\n  expect(type(gen)).toBe('Generator')\n})\n\ntest('with Date', () =\u003e {\n  const date = new Date('December 17, 1995 03:24:00')\n  expect(type(date)).toBe('Date')\n})\n\ntest('with infinity', () =\u003e {\n  expect(type(Infinity)).toBe('Number')\n})\n\ntest('with weak map', () =\u003e {\n  expect(type(new WeakMap())).toBe('WeakMap')\n})\n\ntest('with map', () =\u003e {\n  expect(type(new Map())).toBe('Map')\n})\n\ntest('with symbol', () =\u003e {\n  expect(type(Symbol())).toBe('Symbol')\n})\n\ntest('with simple promise', () =\u003e {\n  expect(type(Promise.resolve(1))).toBe('Promise')\n})\n\ntest('with new Boolean', () =\u003e {\n  expect(type(new Boolean(true))).toBe('Boolean')\n})\n\ntest('with new String', () =\u003e {\n  expect(type(new String('I am a String object'))).toBe('String')\n})\n\ntest('with new Number', () =\u003e {\n  expect(type(new Number(1))).toBe('Number')\n})\n\ntest('with error', () =\u003e {\n  expect(type(Error('foo'))).toBe('Error')\n  expect(typeRamda(Error('foo'))).toBe('Error')\n})\n\ntest('with error - wrong @types/ramda test', () =\u003e {\n  // @types/ramda expect the result to be 'Error' but it is not\n  class ExtendedError extends Error{}\n  expect(type(ExtendedError)).toBe('Function')\n  expect(typeRamda(ExtendedError)).toBe('Function')\n})\n\ntest('with new promise', () =\u003e {\n  const delay = ms =\u003e\n    new Promise(resolve =\u003e {\n      setTimeout(() =\u003e {\n        resolve(ms + 110)\n      }, ms)\n    })\n\n  expect(type(delay(10))).toBe('Promise')\n})\n\ntest('async function', () =\u003e {\n  expect(type(async () =\u003e {})).toBe('Promise')\n})\n\ntest('async arrow', () =\u003e {\n  const asyncArrow = async () =\u003e {}\n  expect(type(asyncArrow)).toBe('Promise')\n})\n\ntest('function', () =\u003e {\n  const fn1 = () =\u003e {}\n  const fn2 = function (){}\n\n  function fn3(){}\n\n  ;[ () =\u003e {}, fn1, fn2, fn3 ].map(val =\u003e {\n    expect(type(val)).toBe('Function')\n  })\n})\n\ntest('object', () =\u003e {\n  expect(type({})).toBe('Object')\n})\n\ntest('number', () =\u003e {\n  expect(type(1)).toBe('Number')\n})\n\ntest('boolean', () =\u003e {\n  expect(type(false)).toBe('Boolean')\n})\n\ntest('string', () =\u003e {\n  expect(type('foo')).toBe('String')\n})\n\ntest('null', () =\u003e {\n  expect(type(null)).toBe('Null')\n})\n\ntest('array', () =\u003e {\n  expect(type([])).toBe('Array')\n  expect(type([ 1, 2, 3 ])).toBe('Array')\n})\n\ntest('regex', () =\u003e {\n  expect(type(/\\s/g)).toBe('RegExp')\n})\n\ntest('undefined', () =\u003e {\n  expect(type(undefined)).toBe('Undefined')\n})\n\ntest('not a number', () =\u003e {\n  expect(type(Number('s'))).toBe('NaN')\n})\n\ntest('set', () =\u003e {\n  const exampleSet = new Set([ 1, 2, 3 ])\n  expect(type(exampleSet)).toBe('Set')\n  expect(typeRamda(exampleSet)).toBe('Set')\n})\n\ntest('function inside object 1', () =\u003e {\n  const obj = {\n    f(){\n      return 4\n    },\n  }\n\n  expect(type(obj.f)).toBe('Function')\n  expect(typeRamda(obj.f)).toBe('Function')\n})\n\ntest('function inside object 2', () =\u003e {\n  const name = 'f'\n  const obj = {\n    [ name ](){\n      return 4\n    },\n  }\n  expect(type(obj.f)).toBe('Function')\n  expect(typeRamda(obj.f)).toBe('Function')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {type} from 'rambda'\n\ndescribe('R.type', () =\u003e {\n  it('happy', () =\u003e {\n    const result = type(4)\n\n    result // $ExpectType RambdaTypes\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#type)\n\n### unapply\n\n```typescript\n\nunapply\u003cT = any\u003e(fn: (args: any[]) =\u003e T): (...args: any[]) =\u003e T\n```\n\nIt calls a function `fn` with the list of values of the returned function. \n\n`R.unapply` is the opposite of `R.apply` method.\n\n```javascript\nR.unapply(JSON.stringify)(1, 2, 3)\n//=\u003e '[1,2,3]'\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nunapply\u003cT = any\u003e(fn: (args: any[]) =\u003e T): (...args: any[]) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.unapply\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function unapply(fn){\n  return function (...args){\n    return fn.call(this, args)\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { apply } from './apply.js'\nimport { converge } from './converge.js'\nimport { identity } from './identity.js'\nimport { prop } from './prop.js'\nimport { sum } from './sum.js'\nimport { unapply } from './unapply.js'\n\ntest('happy', () =\u003e {\n  const fn = unapply(identity)\n  expect(fn(\n    1, 2, 3\n  )).toEqual([ 1, 2, 3 ])\n  expect(fn()).toEqual([])\n})\n\ntest('returns a function which is always passed one argument', () =\u003e {\n  const fn = unapply(function (){\n    return arguments.length\n  })\n  expect(fn('x')).toBe(1)\n  expect(fn('x', 'y')).toBe(1)\n  expect(fn(\n    'x', 'y', 'z'\n  )).toBe(1)\n})\n\ntest('forwards arguments to decorated function as an array', () =\u003e {\n  const fn = unapply(xs =\u003e '[' + xs + ']')\n  expect(fn(2)).toBe('[2]')\n  expect(fn(2, 4)).toBe('[2,4]')\n  expect(fn(\n    2, 4, 6\n  )).toBe('[2,4,6]')\n})\n\ntest('returns a function with length 0', () =\u003e {\n  const fn = unapply(identity)\n  expect(fn).toHaveLength(0)\n})\n\ntest('is the inverse of R.apply', () =\u003e {\n  let a, b, c, d, e, f, g, n\n  const rand = function (){\n    return Math.floor(200 * Math.random()) - 100\n  }\n\n  f = Math.max\n  g = unapply(apply(f))\n  n = 1\n  while (n \u003c= 100){\n    a = rand()\n    b = rand()\n    c = rand()\n    d = rand()\n    e = rand()\n    expect(f(\n      a, b, c, d, e\n    )).toEqual(g(\n      a, b, c, d, e\n    ))\n    n += 1\n  }\n\n  f = function (xs){\n    return '[' + xs + ']'\n  }\n  g = apply(unapply(f))\n  n = 1\n  while (n \u003c= 100){\n    a = rand()\n    b = rand()\n    c = rand()\n    d = rand()\n    e = rand()\n    expect(f([ a, b, c, d, e ])).toEqual(g([ a, b, c, d, e ]))\n    n += 1\n  }\n})\n\ntest('it works with converge', () =\u003e {\n  const fn = unapply(sum)\n  const convergeFn = converge(fn, [ prop('a'), prop('b'), prop('c') ])\n  const obj = {\n    a : 1337,\n    b : 42,\n    c : 1,\n  }\n  const expected = 1337 + 42 + 1\n  expect(convergeFn(obj)).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {join, unapply, sum} from 'rambda'\n\ndescribe('R.unapply', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = unapply(sum)\n\n    fn(1, 2, 3) // $ExpectType number\n  })\n\n  it('joins a string', () =\u003e {\n    const fn = unapply(join(''))\n\n    fn('s', 't', 'r', 'i', 'n', 'g') // $ExpectType string\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#unapply)\n\n### union\n\n```typescript\n\nunion\u003cT\u003e(x: T[], y: T[]): T[]\n```\n\nIt takes two lists and return a new list containing a merger of both list with removed duplicates. \n\n`R.equals` is used to compare for duplication.\n\n```javascript\nconst result = R.union([1,2,3], [3,4,5]);\n// =\u003e [1, 2, 3, 4, 5]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nunion\u003cT\u003e(x: T[], y: T[]): T[];\nunion\u003cT\u003e(x: T[]): (y: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.union\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { includes } from './includes.js'\n\nexport function union(x, y){\n  if (arguments.length === 1) return _y =\u003e union(x, _y)\n\n  const toReturn = cloneList(x)\n\n  y.forEach(yInstance =\u003e {\n    if (!includes(yInstance, x)) toReturn.push(yInstance)\n  })\n\n  return toReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { union } from './union.js'\n\ntest('happy', () =\u003e {\n  expect(union([ 1, 2 ], [ 2, 3 ])).toEqual([ 1, 2, 3 ])\n})\n\ntest('with list of objects', () =\u003e {\n  const list1 = [ { a : 1 }, { a : 2 } ]\n  const list2 = [ { a : 2 }, { a : 3 } ]\n  const result = union(list1)(list2)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {union} from 'rambda'\n\ndescribe('R.union', () =\u003e {\n  it('happy', () =\u003e {\n    const result = union([1, 2], [2, 3])\n\n    result // $ExpectType number[]\n  })\n  it('with array of objects - case 1', () =\u003e {\n    const list1 = [{a: 1}, {a: 2}]\n    const list2 = [{a: 2}, {a: 3}]\n    const result = union(list1, list2)\n    result // $ExpectType { a: number; }[]\n  })\n  it('with array of objects - case 2', () =\u003e {\n    const list1 = [{a: 1, b: 1}, {a: 2}]\n    const list2 = [{a: 2}, {a: 3, b: 3}]\n    const result = union(list1, list2)\n    result[0].a // $ExpectType number\n    result[0].b // $ExpectType number | undefined\n  })\n})\n\ndescribe('R.union - curried', () =\u003e {\n  it('happy', () =\u003e {\n    const result = union([1, 2])([2, 3])\n\n    result // $ExpectType number[]\n  })\n  it('with array of objects - case 1', () =\u003e {\n    const list1 = [{a: 1}, {a: 2}]\n    const list2 = [{a: 2}, {a: 3}]\n    const result = union(list1)(list2)\n    result // $ExpectType { a: number; }[]\n  })\n  it('with array of objects - case 2', () =\u003e {\n    const list1 = [{a: 1, b: 1}, {a: 2}]\n    const list2 = [{a: 2}, {a: 3, b: 3}]\n    const result = union(list1)(list2)\n    result[0].a // $ExpectType number\n    result[0].b // $ExpectType number | undefined\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#union)\n\n### uniq\n\n```typescript\n\nuniq\u003cT\u003e(list: T[]): T[]\n```\n\nIt returns a new array containing only one copy of each element of `list`.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst list = [1, 1, {a: 1}, {a: 2}, {a:1}]\n\nR.uniq(list)\n// =\u003e [1, {a: 1}, {a: 2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nuniq\u003cT\u003e(list: T[]): T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.uniq\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _Set } from './_internals/set.js'\n\nexport function uniq(list){\n  const set = new _Set()\n  const willReturn = []\n  list.forEach(item =\u003e {\n    if (set.checkUniqueness(item)){\n      willReturn.push(item)\n    }\n  })\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { uniq } from './uniq.js'\n\ntest('happy', () =\u003e {\n  const list = [ 1, 2, 3, 3, 3, 1, 2, 0 ]\n  expect(uniq(list)).toEqual([ 1, 2, 3, 0 ])\n})\n\ntest('with object', () =\u003e {\n  const list = [ { a : 1 }, { a : 2 }, { a : 1 }, { a : 2 } ]\n  expect(uniq(list)).toEqual([ { a : 1 }, { a : 2 } ])\n})\n\ntest('with nested array', () =\u003e {\n  expect(uniq([ [ 42 ], [ 42 ] ])).toEqual([ [ 42 ] ])\n})\n\ntest('with booleans', () =\u003e {\n  expect(uniq([ [ false ], [ false ], [ true ] ])).toEqual([ [ false ], [ true ] ])\n})\n\ntest('with falsy values', () =\u003e {\n  expect(uniq([ undefined, null ])).toEqual([ undefined, null ])\n})\n\ntest('can distinct between string and number', () =\u003e {\n  expect(uniq([ 1, '1' ])).toEqual([ 1, '1' ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {uniq} from 'rambda'\n\ndescribe('R.uniq', () =\u003e {\n  it('happy', () =\u003e {\n    const result = uniq([1, 2, 3, 3, 3, 1, 2, 0])\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#uniq)\n\n### uniqBy\n\n```typescript\n\nuniqBy\u003cT, U\u003e(fn: (a: T) =\u003e U, list: T[]): T[]\n```\n\nIt applies uniqueness to input list based on function that defines what to be used for comparison between elements.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst list = [{a:1}, {a:2}, {a:1}]\nconst result = R.uniqBy(x =\u003e x, list)\n\n// =\u003e [{a:1}, {a:2}]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nuniqBy\u003cT, U\u003e(fn: (a: T) =\u003e U, list: T[]): T[];\nuniqBy\u003cT, U\u003e(fn: (a: T) =\u003e U): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.uniqBy\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _Set } from '../src/_internals/set.js'\n\nexport function uniqBy(fn, list){\n  if (arguments.length === 1){\n    return _list =\u003e uniqBy(fn, _list)\n  }\n  const set = new _Set()\n\n  return list.filter(item =\u003e set.checkUniqueness(fn(item)))\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { uniqBy as uniqByRamda } from 'ramda'\n\nimport { uniqBy } from './uniqBy.js'\n\ntest('happy', () =\u003e {\n  expect(uniqBy(Math.abs, [ -2, -1, 0, 1, 2 ])).toEqual([ -2, -1, 0 ])\n})\n\ntest('keeps elements from the left', () =\u003e {\n  expect(uniqBy(Math.abs, [ -1, 2, 4, 3, 1, 3 ])).toEqual([ -1, 2, 4, 3 ])\n})\n\ntest('returns an empty array for an empty array', () =\u003e {\n  expect(uniqBy(Math.abs, [])).toEqual([])\n})\n\ntest('uses R.uniq', () =\u003e {\n  const list = [ { a : 1 }, { a : 2 }, { a : 1 } ]\n  const expected = [ { a : 1 }, { a : 2 } ]\n  expect(uniqBy(x =\u003e x, list)).toEqual(expected)\n  expect(uniqByRamda(x =\u003e x, list)).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {uniqBy} from 'rambda'\n\ndescribe('R.uniqBy', () =\u003e {\n  it('happy', () =\u003e {\n    const result = uniqBy(Math.abs, [-2, -1, 0])\n\n    result // $ExpectType number[]\n  })\n  it('curried', () =\u003e {\n    const result = uniqBy(Math.abs)([-2, -1, 0])\n\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#uniqBy)\n\n### uniqWith\n\n```typescript\n\nuniqWith\u003cT, U\u003e(predicate: (x: T, y: T) =\u003e boolean, list: T[]): T[]\n```\n\nIt returns a new array containing only one copy of each element in `list` according to `predicate` function.\n\nThis predicate should return true, if two elements are equal.\n\n```javascript\nconst list = [\n  {id: 0, title:'foo'},\n  {id: 1, title:'bar'},\n  {id: 2, title:'baz'},\n  {id: 3, title:'foo'},\n  {id: 4, title:'bar'},\n]\n\nconst expected = [\n  {id: 0, title:'foo'},\n  {id: 1, title:'bar'},\n  {id: 2, title:'baz'},\n]\n\nconst predicate = (x,y) =\u003e x.title === y.title\n\nconst result = R.uniqWith(predicate, list)\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nuniqWith\u003cT, U\u003e(predicate: (x: T, y: T) =\u003e boolean, list: T[]): T[];\nuniqWith\u003cT, U\u003e(predicate: (x: T, y: T) =\u003e boolean): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.uniqWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nfunction includesWith(\n  predicate, target, list\n){\n  let willReturn = false\n  let index = -1\n\n  while (++index \u003c list.length \u0026\u0026 !willReturn){\n    const value = list[ index ]\n\n    if (predicate(target, value)){\n      willReturn = true\n    }\n  }\n\n  return willReturn\n}\n\nexport function uniqWith(predicate, list){\n  if (arguments.length === 1) return _list =\u003e uniqWith(predicate, _list)\n\n  let index = -1\n  const willReturn = []\n\n  while (++index \u003c list.length){\n    const value = list[ index ]\n\n    if (!includesWith(\n      predicate, value, willReturn\n    )){\n      willReturn.push(value)\n    }\n  }\n\n  return willReturn\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { uniqWith as uniqWithRamda } from 'ramda'\n\nimport { uniqWith } from './uniqWith.js'\n\nconst list = [ { a : 1 }, { a : 1 } ]\n\ntest('happy', () =\u003e {\n  const fn = (x, y) =\u003e x.a === y.a\n\n  const result = uniqWith(fn, list)\n  expect(result).toEqual([ { a : 1 } ])\n})\n\ntest('with list of strings', () =\u003e {\n  const fn = (x, y) =\u003e x.length === y.length\n  const list = [ '0', '11', '222', '33', '4', '55' ]\n  const result = uniqWith(fn)(list)\n  const resultRamda = uniqWithRamda(fn, list)\n  expect(result).toEqual([ '0', '11', '222' ])\n  expect(resultRamda).toEqual([ '0', '11', '222' ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {uniqWith} from 'rambda'\n\ndescribe('R.uniqWith', () =\u003e {\n  it('happy', () =\u003e {\n    const list = [{a: 1}, {a: 1}]\n\n    const fn = (x: any, y: any) =\u003e x.a === y.a\n\n    const result = uniqWith(fn, list)\n    result // $ExpectType { a: number; }[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#uniqWith)\n\n### unless\n\n```typescript\n\nunless\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenFalseFn: (x: T) =\u003e U, x: T): T | U\n```\n\nThe method returns function that will be called with argument `input`.\n\nIf `predicate(input)` returns `false`, then the end result will be the outcome of `whenFalse(input)`.\n\nIn the other case, the final output will be the `input` itself.\n\n```javascript\nconst fn = R.unless(\n  x =\u003e x \u003e 2,\n  x =\u003e x + 10\n)\n\nconst result = [\n  fn(1),\n  fn(5)\n]\n// =\u003e [11, 5]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nunless\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenFalseFn: (x: T) =\u003e U, x: T): T | U;\nunless\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenFalseFn: (x: T) =\u003e U): (x: T) =\u003e T | U;\nunless\u003cT\u003e(predicate: (x: T) =\u003e boolean, whenFalseFn: (x: T) =\u003e T, x: T): T;\nunless\u003cT\u003e(predicate: (x: T) =\u003e boolean, whenFalseFn: (x: T) =\u003e T): (x: T) =\u003e T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.unless\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction unlessFn(\n  predicate, whenFalseFn, input\n){\n  if (predicate(input)) return input\n\n  return whenFalseFn(input)\n}\n\nexport const unless = curry(unlessFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { inc } from './inc.js'\nimport { isNil } from './isNil.js'\nimport { unless } from './unless.js'\n\ntest('happy', () =\u003e {\n  const safeInc = unless(isNil, inc)\n  expect(safeInc(null)).toBeNull()\n  expect(safeInc(1)).toBe(2)\n})\n\ntest('curried', () =\u003e {\n  const safeIncCurried = unless(isNil)(inc)\n  expect(safeIncCurried(null)).toBeNull()\n})\n\ntest('with 3 inputs', () =\u003e {\n  let result = unless(x =\u003e x.startsWith('/'), x=\u003e x.concat('/'), '/api')\n  expect(result).toBe('/api')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {unless, inc} from 'rambda'\n\ndescribe('R.unless', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = unless(x =\u003e x \u003e 5, inc)\n    const result = fn(1)\n    result // $ExpectType number\n  })\n  it('with one explicit type', () =\u003e {\n    const result = unless(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 5\n      },\n      x =\u003e {\n        x // $ExpectType number\n        return x + 1\n      },\n      1\n    )\n    result // $ExpectType number\n  })\n  it('with two different explicit types', () =\u003e {\n    const result = unless(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 5\n      },\n      x =\u003e {\n        x // $ExpectType number\n        return `${x}-foo`\n      },\n      1\n    )\n    result // $ExpectType string | number\n  })\n})\n\ndescribe('R.unless - curried', () =\u003e {\n  it('happy', () =\u003e {\n    const fn = unless(x =\u003e x \u003e 5, inc)\n    const result = fn(1)\n    result // $ExpectType number\n  })\n  it('with one explicit type', () =\u003e {\n    const fn = unless\u003cnumber\u003e(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 5\n      },\n      x =\u003e {\n        x // $ExpectType number\n        return x + 1\n      }\n    )\n    const result = fn(1)\n    result // $ExpectType number\n  })\n  it('with two different explicit types', () =\u003e {\n    const fn = unless\u003cnumber, string\u003e(\n      x =\u003e {\n        x // $ExpectType number\n        return x \u003e 5\n      },\n      x =\u003e {\n        x // $ExpectType number\n        return `${x}-foo`\n      }\n    )\n    const result = fn(1)\n    result // $ExpectType string | number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#unless)\n\n### unnest\n\n```typescript\n\nunnest(list: unknown[]): unknown[]\n```\n\n```javascript\nconst result = R.unnest([1, [2], [[3]]])\n// =\u003e [1, 2, [3]]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nunnest(list: unknown[]): unknown[];\nunnest\u003cT\u003e(list: unknown[]): T;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.unnest\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function unnest(list){\n  return list.reduce((acc, item) =\u003e {\n    if (Array.isArray(item)){\n      return [ ...acc, ...item ]\n    }\n\n    return [ ...acc, item ]\n  }, [])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { unnest } from './unnest.js'\n\ntest('happy', () =\u003e {\n  const result = unnest([ 1, [ 2 ], [ [ 3 ] ] ])\n  expect(result).toEqual([ 1, 2, [ 3 ] ])\n})\n\ntest('has no effect on simple list', () =\u003e {\n  const list = [ 1, 2 ]\n  const result = unnest(list)\n  expect(result).toEqual([ 1, 2 ])\n})\n\ntest('flattens an array of empty arrays', () =\u003e {\n  const list = [ [], [], [] ]\n  const result = unnest(list)\n  expect(result).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {unnest} from 'rambda'\n\nconst list = [1, [2], [[3]]]\n\ndescribe('R.unnest', () =\u003e {\n  it('without passing type', () =\u003e {\n    const result = unnest(list)\n\n    result // $ExpectType unknown[]\n  })\n  it('with passing type', () =\u003e {\n    const result = unnest\u003c[number, number, number[]]\u003e([1, [2], [[3]]])\n\n    result // $ExpectType [number, number, number[]]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#unnest)\n\n### unwind\n\n```typescript\n\nunwind\u003cT, U\u003e(prop: keyof T, obj: T): U[]\n```\n\n```javascript\nconst obj = {\n  a: 1,\n  b: [2, 3],\n}\nconst result = R.unwind('b', obj)\nconst expected = [{a:1, b:2}, {a:1, b:3}]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nunwind\u003cT, U\u003e(prop: keyof T, obj: T): U[];\nunwind\u003cT, U\u003e(prop: keyof T): (obj: T) =\u003e U[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.unwind\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { isArray } from './_internals/isArray.js'\nimport { mapArray } from './map.js'\n\nexport function unwind(property, obj){\n  if (arguments.length === 1){\n    return _obj =\u003e unwind(property, _obj)\n  }\n\n  if (!isArray(obj[ property ])) return [ obj ]\n\n  return mapArray(x =\u003e ({\n    ...obj,\n    [ property ] : x,\n  }),\n  obj[ property ])\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { unwind } from './unwind.js'\n\ntest('happy', () =\u003e {\n  const obj = {\n    a : 1,\n    b : [ 2, 3 ],\n    c : [ 3, 4 ],\n  }\n  const expected = [\n    {\n      a : 1,\n      b : 2,\n      c : [ 3, 4 ],\n    },\n    {\n      a : 1,\n      b : 3,\n      c : [ 3, 4 ],\n    },\n  ]\n  const result = unwind('b', obj)\n  expect(result).toEqual(expected)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {unwind} from 'rambda'\n\ninterface Input {\n  a: number,\n  b: number[],\n}\ninterface Output {\n  a: number,\n  b: number,\n}\n\ndescribe('R.unwind', () =\u003e {\n  it('happy', () =\u003e {\n    const obj = {\n      a: 1,\n      b: [2, 3],\n    }\n    const result = unwind\u003cInput, Output\u003e('b', obj)\n\n    result // $ExpectType Output[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#unwind)\n\n### update\n\n```typescript\n\nupdate\u003cT\u003e(index: number, newValue: T, list: T[]): T[]\n```\n\nIt returns a copy of `list` with updated element at `index` with `newValue`.\n\n```javascript\nconst index = 2\nconst newValue = 88\nconst list = [1, 2, 3, 4, 5]\n\nconst result = R.update(index, newValue, list)\n// =\u003e [1, 2, 88, 4, 5]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nupdate\u003cT\u003e(index: number, newValue: T, list: T[]): T[];\nupdate\u003cT\u003e(index: number, newValue: T): (list: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.update\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { cloneList } from './_internals/cloneList.js'\nimport { curry } from './curry.js'\n\nexport function updateFn(\n  index, newValue, list\n){\n  const clone = cloneList(list)\n  if (index === -1) return clone.fill(newValue, index)\n\n  return clone.fill(\n    newValue, index, index + 1\n  )\n}\n\nexport const update = curry(updateFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { update } from './update.js'\n\nconst list = [ 1, 2, 3 ]\n\ntest('happy', () =\u003e {\n  const newValue = 8\n  const index = 1\n  const result = update(\n    index, newValue, list\n  )\n  const curriedResult = update(index, newValue)(list)\n  const tripleCurriedResult = update(index)(newValue)(list)\n\n  const expected = [ 1, 8, 3 ]\n  expect(result).toEqual(expected)\n  expect(curriedResult).toEqual(expected)\n  expect(tripleCurriedResult).toEqual(expected)\n})\n\ntest('list has no such index', () =\u003e {\n  const newValue = 8\n  const index = 10\n  const result = update(\n    index, newValue, list\n  )\n\n  expect(result).toEqual(list)\n})\n\ntest('with negative index', () =\u003e {\n  expect(update(\n    -1, 10, [ 1 ]\n  )).toEqual([ 10 ])\n  expect(update(\n    -1, 10, []\n  )).toEqual([])\n  expect(update(\n    -1, 10, list\n  )).toEqual([ 1, 2, 10 ])\n  expect(update(\n    -2, 10, list\n  )).toEqual([ 1, 10, 3 ])\n  expect(update(\n    -3, 10, list\n  )).toEqual([ 10, 2, 3 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {update} from 'rambda'\n\ndescribe('R.update', () =\u003e {\n  it('happy', () =\u003e {\n    const result = update(1, 0, [1, 2, 3])\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#update)\n\n### values\n\n```typescript\n\nvalues\u003cT extends object, K extends keyof T\u003e(obj: T): T[K][]\n```\n\nWith correct input, this is nothing more than `Object.values(Record\u003cstring, unknown\u003e)`. If `obj` is not an object, then it returns an empty array.\n\n```javascript\nconst obj = {a:1, b:2}\n\nR.values(Record\u003cstring, unknown\u003e)\n// =\u003e [1, 2]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nvalues\u003cT extends object, K extends keyof T\u003e(obj: T): T[K][];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.values\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { type } from './type.js'\n\nexport function values(obj){\n  if (type(obj) !== 'Object') return []\n  return Object.values(obj)\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { values } from './values.js'\n\ntest('happy', () =\u003e {\n  expect(values({\n    a : 1,\n    b : 2,\n    c : 3,\n  })).toEqual([ 1, 2, 3 ])\n})\n\ntest('with bad input', () =\u003e {\n  expect(values(null)).toEqual([])\n  expect(values(undefined)).toEqual([])\n  expect(values(55)).toEqual([])\n  expect(values('foo')).toEqual([])\n  expect(values(true)).toEqual([])\n  expect(values(false)).toEqual([])\n  expect(values(NaN)).toEqual([])\n  expect(values(Infinity)).toEqual([])\n  expect(values([])).toEqual([])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {values} from 'rambda'\n\ndescribe('R.values', () =\u003e {\n  it('happy', () =\u003e {\n    const result = values({\n      a: 1,\n      b: 2,\n      c: 3,\n    })\n    result // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#values)\n\n### view\n\n```typescript\n\nview\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): (obj: S) =\u003e A\n```\n\nIt returns the value of `lens` focus over `target` object.\n\n```javascript\nconst lens = R.lensProp('x')\n\nR.view(lens, {x: 1, y: 2}) // =\u003e 1\nR.view(lens, {x: 4, y: 2}) // =\u003e 4\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nview\u003cS, A\u003e(lens: Lens\u003cS, A\u003e): (obj: S) =\u003e A;\nview\u003cS, A\u003e(lens: Lens\u003cS, A\u003e, obj: S): A;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.view\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nconst Const = x =\u003e ({\n  x,\n  map : fn =\u003e Const(x),\n})\n\nexport function view(lens, target){\n  if (arguments.length === 1) return _target =\u003e view(lens, _target)\n\n  return lens(Const)(target).x\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { assoc } from './assoc.js'\nimport { lens } from './lens.js'\nimport { prop } from './prop.js'\nimport { view } from './view.js'\n\nconst testObject = { foo : 'Led Zeppelin' }\nconst assocLens = lens(prop('foo'), assoc('foo'))\n\ntest('happy', () =\u003e {\n  expect(view(assocLens, testObject)).toBe('Led Zeppelin')\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#view)\n\n### when\n\n```typescript\n\nwhen\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenTrueFn: (a: T) =\u003e U, input: T): T | U\n```\n\nIt pass `input` to `predicate` function and if the result is `true`, it will return the result of `whenTrueFn(input)`. \nIf the `predicate` returns `false`, then it will simply return `input`.\n\n```javascript\nconst predicate = x =\u003e typeof x === 'number'\nconst whenTrueFn = R.add(11)\n\nconst fn = when(predicate, whenTrueResult)\n\nconst positiveInput = 88\nconst negativeInput = 'foo'\n\nconst result = [\n  fn(positiveInput),\n  fn(positiveInput),\n]\n\nconst expected = [\n  99,\n  'foo',\n]\n// =\u003e `result` is equal to `expected`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nwhen\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenTrueFn: (a: T) =\u003e U, input: T): T | U;\nwhen\u003cT, U\u003e(predicate: (x: T) =\u003e boolean, whenTrueFn: (a: T) =\u003e U): (input: T) =\u003e T | U;\nwhen\u003cT, U\u003e(predicate: (x: T) =\u003e boolean): ((whenTrueFn: (a: T) =\u003e U) =\u003e (input: T) =\u003e T | U);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.when\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\n\nfunction whenFn(\n  predicate, whenTrueFn, input\n){\n  if (!predicate(input)) return input\n\n  return whenTrueFn(input)\n}\n\nexport const when = curry(whenFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add } from './add.js'\nimport { when } from './when.js'\n\nconst predicate = x =\u003e typeof x === 'number'\n\ntest('happy', () =\u003e {\n  const fn = when(predicate, add(11))\n  expect(fn(11)).toBe(22)\n  expect(fn('foo')).toBe('foo')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {when} from 'rambda'\n\nconst predicate = (x: number) =\u003e x \u003e 2\nconst whenTrueFn = (x: number) =\u003e String(x)\n\ndescribe('R.when', () =\u003e {\n  it('happy', () =\u003e {\n    const result = when(predicate, whenTrueFn, 1)\n    result // $ExpectType string | 1\n  })\n\n  it('curry 1', () =\u003e {\n    const fn = when(predicate, whenTrueFn)\n    const result = fn(1)\n    result // $ExpectType string | number\n  })\n\n  it('curry 2 require explicit types', () =\u003e {\n    const fn = when\u003cnumber, string\u003e(predicate)(whenTrueFn)\n    const result = fn(1)\n    result // $ExpectType string | number\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#when)\n\n### where\n\n```typescript\n\nwhere\u003cT, U\u003e(conditions: T, input: U): boolean\n```\n\nIt returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.\n\n```javascript\nconst condition = R.where({\n  a : x =\u003e typeof x === \"string\",\n  b : x =\u003e x === 4\n})\nconst input = {\n  a : \"foo\",\n  b : 4,\n  c : 11,\n}\n\nconst result = condition(input) \n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nwhere\u003cT, U\u003e(conditions: T, input: U): boolean;\nwhere\u003cT\u003e(conditions: T): \u003cU\u003e(input: U) =\u003e boolean;\nwhere\u003cObjFunc2, U\u003e(conditions: ObjFunc2, input: U): boolean;\nwhere\u003cObjFunc2\u003e(conditions: ObjFunc2): \u003cU\u003e(input: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.where\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function where(conditions, input){\n  if (input === undefined){\n    return _input =\u003e where(conditions, _input)\n  }\n  let flag = true\n  for (const prop in conditions){\n    if (!flag) continue\n    const result = conditions[ prop ](input[ prop ])\n    if (flag \u0026\u0026 result === false){\n      flag = false\n    }\n  }\n\n  return flag\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { where } from './where.js'\n\ntest('when true', () =\u003e {\n  const result = where({\n    a : equals('foo'),\n    b : equals('bar'),\n  },\n  {\n    a : 'foo',\n    b : 'bar',\n    x : 11,\n    y : 19,\n  })\n\n  expect(result).toBeTrue()\n})\n\ntest('when false | early exit', () =\u003e {\n  let counter = 0\n  const equalsFn = expected =\u003e input =\u003e {\n    console.log(expected, 'expected')\n    counter++\n\n    return input === expected\n  }\n  const predicate = where({\n    a : equalsFn('foo'),\n    b : equalsFn('baz'),\n  })\n  expect(predicate({\n    a : 'notfoo',\n    b : 'notbar',\n  })).toBeFalse()\n  expect(counter).toBe(1)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {where, equals} from 'rambda'\n\ndescribe('R.where', () =\u003e {\n  it('happy', () =\u003e {\n    const input = {\n      a: 'foo',\n      b: 'bar',\n      x: 11,\n      y: 19,\n    }\n    const conditions = {\n      a: equals('foo'),\n      b: equals('bar'),\n    }\n    const result = where(conditions, input)\n    const curriedResult = where(conditions)(input)\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#where)\n\n### whereAny\n\n```typescript\n\nwhereAny\u003cT, U\u003e(conditions: T, input: U): boolean\n```\n\nSame as `R.where`, but it will return `true` if at least one condition check returns `true`.\n\n```javascript\nconst conditions = {\n  a: a =\u003e a \u003e 1,\n  b: b =\u003e b \u003e 2,\n}\nconst result = [\n  R.whereAny(conditions, {b:3}),\n  R.whereAny(conditions, {c:4})\n]\n// =\u003e [true, false]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nwhereAny\u003cT, U\u003e(conditions: T, input: U): boolean;\nwhereAny\u003cT\u003e(conditions: T): \u003cU\u003e(input: U) =\u003e boolean;\nwhereAny\u003cObjFunc2, U\u003e(conditions: ObjFunc2, input: U): boolean;\nwhereAny\u003cObjFunc2\u003e(conditions: ObjFunc2): \u003cU\u003e(input: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.whereAny\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function whereAny(conditions, input){\n  if (input === undefined){\n    return _input =\u003e whereAny(conditions, _input)\n  }\n  for (const prop in conditions){\n    if (conditions[ prop ](input[ prop ])){\n      return true\n    }\n  }\n\n  return false\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { whereAny } from './whereAny.js'\n\nconst conditions = {\n  a : equals('foo'),\n  b : equals('bar'),\n}\n\ntest('happy', () =\u003e {\n  expect(whereAny(conditions, {\n    a : 1,\n    b : 'bar',\n  })).toBeTrue()\n})\n\ntest('curried', () =\u003e {\n  expect(whereAny(conditions)({ a : 1 })).toBeFalse()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {whereAny} from 'rambda'\n\ndescribe('R.whereAny', () =\u003e {\n  it('happy', () =\u003e {\n    const conditions = {\n      a: (a: number) =\u003e a \u003e 1,\n      b: (b: number) =\u003e b \u003e 2,\n    }\n    const result = whereAny(conditions, {b: 3})\n    result // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#whereAny)\n\n### whereEq\n\n```typescript\n\nwhereEq\u003cT, U\u003e(condition: T, input: U): boolean\n```\n\nIt will return `true` if all of `input` object fully or partially include `rule` object.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst condition = { a : { b : 1 } }\nconst input = {\n  a : { b : 1 },\n  c : 2\n}\n\nconst result = whereEq(condition, input)\n// =\u003e true\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nwhereEq\u003cT, U\u003e(condition: T, input: U): boolean;\nwhereEq\u003cT\u003e(condition: T): \u003cU\u003e(input: U) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.whereEq\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { filter } from './filter.js'\n\nexport function whereEq(condition, input){\n  if (arguments.length === 1){\n    return _input =\u003e whereEq(condition, _input)\n  }\n\n  const result = filter((conditionValue, conditionProp) =\u003e\n    equals(conditionValue, input[ conditionProp ]),\n  condition)\n\n  return Object.keys(result).length === Object.keys(condition).length\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { whereEq } from './whereEq.js'\n\ntest('when true', () =\u003e {\n  const condition = { a : 1 }\n  const input = {\n    a : 1,\n    b : 2,\n  }\n\n  const result = whereEq(condition, input)\n  const expectedResult = true\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('when false', () =\u003e {\n  const condition = { a : 1 }\n  const input = { b : 2 }\n\n  const result = whereEq(condition, input)\n  const expectedResult = false\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('with nested object', () =\u003e {\n  const condition = { a : { b : 1 } }\n  const input = {\n    a : { b : 1 },\n    c : 2,\n  }\n\n  const result = whereEq(condition)(input)\n  const expectedResult = true\n\n  expect(result).toEqual(expectedResult)\n})\n\ntest('with wrong input', () =\u003e {\n  const condition = { a : { b : 1 } }\n\n  expect(() =\u003e whereEq(condition, null)).toThrowErrorMatchingInlineSnapshot('\"Cannot read properties of null (reading \\'a\\')\"')\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {whereEq} from 'rambda'\n\ndescribe('R.whereEq', () =\u003e {\n  it('happy', () =\u003e {\n    const result = whereEq({a: {b: 2}}, {b: 2})\n    const curriedResult = whereEq({a: {b: 2}})({b: 2})\n    result // $ExpectType boolean\n    curriedResult // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#whereEq)\n\n### without\n\n```typescript\n\nwithout\u003cT\u003e(matchAgainst: T[], source: T[]): T[]\n```\n\nIt will return a new array, based on all members of `source` list that are not part of `matchAgainst` list.\n\n`R.equals` is used to determine equality.\n\n```javascript\nconst source = [1, 2, 3, 4]\nconst matchAgainst = [2, 3]\n\nconst result = R.without(matchAgainst, source)\n// =\u003e [1, 4]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nwithout\u003cT\u003e(matchAgainst: T[], source: T[]): T[];\nwithout\u003cT\u003e(matchAgainst: T[]): (source: T[]) =\u003e T[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.without\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { _indexOf } from './equals.js'\nimport { reduce } from './reduce.js'\n\nexport function without(matchAgainst, source){\n  if (source === undefined){\n    return _source =\u003e without(matchAgainst, _source)\n  }\n\n  return reduce(\n    (prev, current) =\u003e\n      _indexOf(current, matchAgainst) \u003e -1 ? prev : prev.concat(current),\n    [],\n    source\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { without as withoutRamda } from 'ramda'\n\nimport { without } from './without.js'\n\ntest('should return a new list without values in the first argument', () =\u003e {\n  const itemsToOmit = [ 'A', 'B', 'C' ]\n  const collection = [ 'A', 'B', 'C', 'D', 'E', 'F' ]\n\n  expect(without(itemsToOmit, collection)).toEqual([ 'D', 'E', 'F' ])\n  expect(without(itemsToOmit)(collection)).toEqual([ 'D', 'E', 'F' ])\n})\n\ntest('with list of objects', () =\u003e {\n  const itemsToOmit = [ { a : 1 }, { c : 3 } ]\n  const collection = [ { a : 1 }, { b : 2 }, { c : 3 }, { d : 4 } ]\n  const expected = [ { b : 2 }, { d : 4 } ]\n\n  expect(without(itemsToOmit, collection)).toEqual(expected)\n  expect(withoutRamda(itemsToOmit, collection)).toEqual(expected)\n})\n\ntest('ramda accepts string as target input while rambda throws', () =\u003e {\n  expect(withoutRamda('0:1', [ '0', '0:1' ])).toEqual([ '0:1' ])\n  expect(() =\u003e\n    without('0:1', [ '0', '0:1' ])).toThrowErrorMatchingInlineSnapshot('\"Cannot read property \\'indexOf\\' of 0:1\"')\n  expect(without([ '0:1' ], [ '0', '0:1' ])).toEqual([ '0' ])\n})\n\ntest('ramda test', () =\u003e {\n  expect(without([ 1, 2 ])([ 1, 2, 1, 3, 4 ])).toEqual([ 3, 4 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {without} from 'rambda'\n\nconst itemsToOmit = ['A', 'B', 'C']\nconst collection = ['A', 'B', 'C', 'D', 'E', 'F']\n\ndescribe('R.without', () =\u003e {\n  it('happy', () =\u003e {\n    const result = without(itemsToOmit, collection)\n\n    result // $ExpectType string[]\n  })\n  it('curried', () =\u003e {\n    const result = without(itemsToOmit)(collection)\n\n    result // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#without)\n\n### xor\n\n```typescript\n\nxor(x: boolean, y: boolean): boolean\n```\n\nLogical XOR\n\n```javascript\nconst result = [\n  xor(true, true),\n  xor(false, false),\n  xor(false, true),\n]\n// =\u003e [false, false, true]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nxor(x: boolean, y: boolean): boolean;\nxor(y: boolean): (y: boolean) =\u003e boolean;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.xor\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function xor(a, b){\n  if (arguments.length === 1) return _b =\u003e xor(a, _b)\n\n  return Boolean(a) \u0026\u0026 !b || Boolean(b) \u0026\u0026 !a\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { xor } from './xor.js'\n\ntest('compares two values with exclusive or', () =\u003e {\n  expect(xor(true, true)).toBeFalse()\n  expect(xor(true, false)).toBeTrue()\n  expect(xor(false, true)).toBeTrue()\n  expect(xor(false, false)).toBeFalse()\n})\n\ntest('when both values are truthy, it should return false', () =\u003e {\n  expect(xor(true, 'foo')).toBeFalse()\n  expect(xor(42, true)).toBeFalse()\n  expect(xor('foo', 42)).toBeFalse()\n  expect(xor({}, true)).toBeFalse()\n  expect(xor(true, [])).toBeFalse()\n  expect(xor([], {})).toBeFalse()\n  expect(xor(new Date(), true)).toBeFalse()\n  expect(xor(true, Infinity)).toBeFalse()\n  expect(xor(Infinity, new Date())).toBeFalse()\n})\n\ntest('when both values are falsy, it should return false', () =\u003e {\n  expect(xor(null, false)).toBeFalse()\n  expect(xor(false, undefined)).toBeFalse()\n  expect(xor(undefined, null)).toBeFalse()\n  expect(xor(0, false)).toBeFalse()\n  expect(xor(false, NaN)).toBeFalse()\n  expect(xor(NaN, 0)).toBeFalse()\n  expect(xor('', false)).toBeFalse()\n})\n\ntest('when one argument is truthy and the other is falsy, it should return true', () =\u003e {\n  expect(xor('foo', null)).toBeTrue()\n  expect(xor(null, 'foo')).toBeTrue()\n  expect(xor(undefined, 42)).toBeTrue()\n  expect(xor(42, undefined)).toBeTrue()\n  expect(xor(Infinity, NaN)).toBeTrue()\n  expect(xor(NaN, Infinity)).toBeTrue()\n  expect(xor({}, '')).toBeTrue()\n  expect(xor('', {})).toBeTrue()\n  expect(xor(new Date(), 0)).toBeTrue()\n  expect(xor(0, new Date())).toBeTrue()\n  expect(xor([], null)).toBeTrue()\n  expect(xor(undefined, [])).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {xor} from 'rambda'\n\ndescribe('R.xor', () =\u003e {\n  it('happy', () =\u003e {\n    xor(true, false) // $ExpectType boolean\n  })\n  it('curry', () =\u003e {\n    xor(true)(false) // $ExpectType boolean\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#xor)\n\n### zip\n\n```typescript\n\nzip\u003cK, V\u003e(x: K[], y: V[]): KeyValuePair\u003cK, V\u003e[]\n```\n\nIt will return a new array containing tuples of equally positions items from both `x` and `y` lists. \n\nThe returned list will be truncated to match the length of the shortest supplied list.\n\n```javascript\nconst x = [1, 2]\nconst y = ['A', 'B']\nR.zip(x, y)\n// =\u003e [[1, 'A'], [2, 'B']]\n\n// truncates to shortest list\nR.zip([...x, 3], ['A', 'B'])\n// =\u003e [[1, 'A'], [2, 'B']]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nzip\u003cK, V\u003e(x: K[], y: V[]): KeyValuePair\u003cK, V\u003e[];\nzip\u003cK\u003e(x: K[]): \u003cV\u003e(y: V[]) =\u003e KeyValuePair\u003cK, V\u003e[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.zip\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nexport function zip(left, right){\n  if (arguments.length === 1) return _right =\u003e zip(left, _right)\n\n  const result = []\n  const length = Math.min(left.length, right.length)\n\n  for (let i = 0; i \u003c length; i++){\n    result[ i ] = [ left[ i ], right[ i ] ]\n  }\n\n  return result\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { zip } from './zip.js'\n\nconst array1 = [ 1, 2, 3 ]\nconst array2 = [ 'A', 'B', 'C' ]\n\ntest('should return an array', () =\u003e {\n  const actual = zip(array1)(array2)\n  expect(actual).toBeInstanceOf(Array)\n})\n\ntest('should return and array or tuples', () =\u003e {\n  const expected = [\n    [ 1, 'A' ],\n    [ 2, 'B' ],\n    [ 3, 'C' ],\n  ]\n  const actual = zip(array1, array2)\n  expect(actual).toEqual(expected)\n})\n\ntest('should truncate result to length of shorted input list', () =\u003e {\n  const expectedA = [\n    [ 1, 'A' ],\n    [ 2, 'B' ],\n  ]\n  const actualA = zip([ 1, 2 ], array2)\n  expect(actualA).toEqual(expectedA)\n\n  const expectedB = [\n    [ 1, 'A' ],\n    [ 2, 'B' ],\n  ]\n  const actualB = zip(array1, [ 'A', 'B' ])\n  expect(actualB).toEqual(expectedB)\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {zip} from 'rambda'\n\ndescribe('R.zip', () =\u003e {\n  it('happy', () =\u003e {\n    const array1 = [1, 2, 3]\n    const array2 = ['A', 'B', 'C']\n\n    const result = zip(array1)(array2)\n    result // $ExpectType KeyValuePair\u003cnumber, string\u003e[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#zip)\n\n### zipObj\n\n```typescript\n\nzipObj\u003cT, K extends string\u003e(keys: K[], values: T[]): { [P in K]: T }\n```\n\nIt will return a new object with keys of `keys` array and values of `values` array.\n\n```javascript\nconst keys = ['a', 'b', 'c']\n\nR.zipObj(keys, [1, 2, 3])\n// =\u003e {a: 1, b: 2, c: 3}\n\n// truncates to shortest list\nR.zipObj(keys, [1, 2])\n// =\u003e {a: 1, b: 2}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nzipObj\u003cT, K extends string\u003e(keys: K[], values: T[]): { [P in K]: T };\nzipObj\u003cK extends string\u003e(keys: K[]): \u003cT\u003e(values: T[]) =\u003e { [P in K]: T };\nzipObj\u003cT, K extends number\u003e(keys: K[], values: T[]): { [P in K]: T };\nzipObj\u003cK extends number\u003e(keys: K[]): \u003cT\u003e(values: T[]) =\u003e { [P in K]: T };\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.zipObj\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { take } from './take.js'\n\nexport function zipObj(keys, values){\n  if (arguments.length === 1) return yHolder =\u003e zipObj(keys, yHolder)\n\n  return take(values.length, keys).reduce((\n    prev, xInstance, i\n  ) =\u003e {\n    prev[ xInstance ] = values[ i ]\n\n    return prev\n  }, {})\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { equals } from './equals.js'\nimport { zipObj } from './zipObj.js'\n\ntest('zipObj', () =\u003e {\n  expect(zipObj([ 'a', 'b', 'c' ], [ 1, 2, 3 ])).toEqual({\n    a : 1,\n    b : 2,\n    c : 3,\n  })\n})\n\ntest('0', () =\u003e {\n  expect(zipObj([ 'a', 'b' ])([ 1, 2, 3 ])).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('1', () =\u003e {\n  expect(zipObj([ 'a', 'b', 'c' ])([ 1, 2 ])).toEqual({\n    a : 1,\n    b : 2,\n  })\n})\n\ntest('ignore extra keys', () =\u003e {\n  const result = zipObj([ 'a', 'b', 'c', 'd', 'e', 'f' ], [ 1, 2, 3 ])\n  const expected = {\n    a : 1,\n    b : 2,\n    c : 3,\n  }\n\n  expect(equals(result, expected)).toBeTrue()\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {zipObj} from 'rambda'\n\ndescribe('R.zipObj', () =\u003e {\n  it('happy', () =\u003e {\n    // this is wrong since 24.10.2020 `@types/ramda` changes\n    const result = zipObj(['a', 'b', 'c', 'd'], [1, 2, 3])\n    ;[result.a, result.b, result.c, result.d] // $ExpectType number[]\n  })\n  it('imported from @types/ramda', () =\u003e {\n    const result = zipObj(['a', 'b', 'c'], [1, 2, 3])\n    const curriedResult = zipObj(['a', 'b', 'c'])([1, 2, 3])\n    ;[result.a, result.b, result.c] // $ExpectType number[]\n    ;[curriedResult.a, curriedResult.b, curriedResult.c] // $ExpectType number[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#zipObj)\n\n### zipWith\n\n```typescript\n\nzipWith\u003cT, U, TResult\u003e(fn: (x: T, y: U) =\u003e TResult, list1: T[], list2: U[]): TResult[]\n```\n\n```javascript\nconst list1 = [ 10, 20, 30, 40 ]\nconst list2 = [ 100, 200 ]\n\nconst result = R.zipWith(\n  R.add, list1, list2\n)\n// =\u003e [110, 220]\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAll TypeScript definitions\u003c/summary\u003e\n\n```typescript\nzipWith\u003cT, U, TResult\u003e(fn: (x: T, y: U) =\u003e TResult, list1: T[], list2: U[]): TResult[];\nzipWith\u003cT, U, TResult\u003e(fn: (x: T, y: U) =\u003e TResult, list1: T[]): (list2: U[]) =\u003e TResult[];\nzipWith\u003cT, U, TResult\u003e(fn: (x: T, y: U) =\u003e TResult): (list1: T[], list2: U[]) =\u003e TResult[];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eR.zipWith\u003c/strong\u003e source\u003c/summary\u003e\n\n```javascript\nimport { curry } from './curry.js'\nimport { take } from './take.js'\n\nfunction zipWithFn(\n  fn, x, y\n){\n  return take(x.length \u003e y.length ? y.length : x.length, x).map((xInstance, i) =\u003e fn(xInstance, y[ i ]))\n}\n\nexport const zipWith = curry(zipWithFn)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTests\u003c/strong\u003e\u003c/summary\u003e\n\n```javascript\nimport { add } from './add.js'\nimport { zipWith } from './zipWith.js'\n\nconst list1 = [ 1, 2, 3 ]\nconst list2 = [ 10, 20, 30, 40 ]\nconst list3 = [ 100, 200 ]\n\ntest('when second list is shorter', () =\u003e {\n  const result = zipWith(\n    add, list1, list3\n  )\n  expect(result).toEqual([ 101, 202 ])\n})\n\ntest('when second list is longer', () =\u003e {\n  const result = zipWith(\n    add, list1, list2\n  )\n  expect(result).toEqual([ 11, 22, 33 ])\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e test\u003c/summary\u003e\n\n```typescript\nimport {zipWith} from 'rambda'\n\nconst list1 = [1, 2]\nconst list2 = [10, 20, 30]\n\ndescribe('R.zipWith', () =\u003e {\n  it('happy', () =\u003e {\n    const result = zipWith(\n      (x, y) =\u003e {\n        x // $ExpectType number\n        y // $ExpectType number\n        return `${x}-${y}`\n      },\n      list1,\n      list2\n    )\n\n    result // $ExpectType string[]\n  })\n  it('curried', () =\u003e {\n    const result = zipWith((x, y) =\u003e {\n      x // $ExpectType unknown\n      y // $ExpectType unknown\n      return `${x}-${y}`\n    })(list1, list2)\n\n    result // $ExpectType string[]\n  })\n})\n```\n\n\u003c/details\u003e\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#zipWith)\n\n## ❯ CHANGELOG\n\n9.4.2 \n\n- Fix TS issue when `R.take` is used as part of `R.pipe`.\n\nMoving away from `Ramda` types which are problematic in this case:\n\n```typescript\nconst data = ['foo', 'bar', 'baz', 'qux']\nconst result = piped(\n\tdata,\n\tfilter(\n\t\tx =\u003e x.length \u003e= 2\n\t),\n\ttakeLast(2),\n)\n```\n\n9.4.1\n\n- Fix bug with `R.differenceWith` when two arrays has same length - [Issue #750](https://github.com/selfrefactor/rambda/issues/757)\n\n- Allow path input to not be transformed when string numbers are there - [Issue #750](https://github.com/selfrefactor/rambda/issues/750)\n\n9.4.0\n\n- Fix `deno` release\n\n- Fix too strict `true` condition in `R.ifElse` - [Issue #750](https://github.com/selfrefactor/rambda/issues/750)\n\n- Change `R.groupBy` typings to match `@types/ramda` typings\n\n9.3.0\n\n- Breaking change in relation to TS typings of `R.assoc`, `R.dissoc` and `R.modify` - https://github.com/ramda/types/pull/37\n\n- Add `R.isNotEmpty` as it is new method in `Ramda`\n\n- Fix `R.head`/`R.last` TS definition - It returns `undefined` if array has length of 0. Before \n\n9.2.1\n\n- Broken `Deno` build - [Issue #731](https://github.com/selfrefactor/rambda/issues/731)\n\n9.2.0\n\n- `R.once` TS type definition miss to context argument and its type - [Issue #728](https://github.com/selfrefactor/rambda/issues/728)\n\n- Fix implementation of `R.unless` function - https://github.com/selfrefactor/rambda/pull/726 \n\n9.1.1\n\n- Faster R.equals with Object.is short circuit - https://github.com/selfrefactor/rambda/pull/725\n\n- Fix R.cond transform is unary - https://github.com/selfrefactor/rambda/issues/720\n\n9.1.0\n\nAdd these methods\n\n- insert\n- insertAll\n- lt\n- lte\n- isNotNil\n- pickBy\n- pathSatisfies\n- swap\n- mergeDeepLeft\n\n9.0.1\n\n- Fix bad TS typings, due to missing declaration - [Issue #716](https://github.com/selfrefactor/rambda/issues/716)\n\n9.0.0\n\nBreaking change in TS definitions of `lenses` as now they are synced to `Ramda` types.\n\n- Add `R.sortWith` - [Issue #707](https://github.com/selfrefactor/rambda/issues/707)\n\n- Add `R.innerJoin`, `R.gt`, `R.gte`, `R.reduceBy`, `R.hasIn`\n\n8.6.0\n\n- Wrong typing for `R.dissocPath` - [Issue #709](https://github.com/selfrefactor/rambda/issues/709)\n\n- Update build dependencies\n\n8.5.0\n\n- Revert changes in `R.anyPass` introduced in `8.4.0` release. The reason is that the change was breaking the library older than `5.2.0` TypeScript.\n\n- Wrong `R.partial` TS definition  - [Issue #705](https://github.com/selfrefactor/rambda/issues/705)\n\n- Add `R.dropRepeatsBy`\n\n- Add `R.empty`\n\n- Add `R.eqBy`\n\n- Add `R.forEachObjIndexed`\n\n8.4.0\n\n- Add `R.dissocPath`\n\n- Fix TS definitions of `R.head/R.last` and add missing handle of empty string\n\n- Add `R.removeIndex` - method was before only in `Rambdax`, but now since `R.dissocPath` is using it, it is added to main library.\n\n- Allow `R.omit` to pass numbers as part of properties to omit, i.e. `R.omit(['a', 1], {a: {1: 1, 2: 2}})`\n\n- R.keys always returns strings - [MR #700](https://github.com/selfrefactor/rambda/pull/700)\n\n- Improve `R.prepend/R.append` type interference - [MR #699](https://github.com/selfrefactor/rambda/pull/699)\n\n- Change `R.reduce` TS definitions so index is always received - [MR #696](https://github.com/selfrefactor/rambda/pull/696)\n\n- Functions as a type guard in `R.anyPass` TS definitions - [MR #695](https://github.com/selfrefactor/rambda/pull/695)\n\n- Fix R.append's curried type - [MR #694](https://github.com/selfrefactor/rambda/pull/694)\n\n- Fix cannot compare errors in `Deno` with `R.equals` - [Issue #704](https://github.com/selfrefactor/rambda/issues/704).\n\n- Fix cannot compare `BigInt` with `R.equals` \n\n8.3.0\n\nAdd the following methods:\n\n- binary\n- call\n- collectBy\n- comparator\n- composeWith\n\n8.2.0\n\nAdd the following methods:\n\n- addIndex\n- addIndexRight\n- ap\n- aperture\n- applyTo\n- ascend\n- descend\n\n8.1.0\n\n- Fix input order of TS definitions for `R.propEq` method  - [Issue #688](https://github.com/selfrefactor/rambda/issues/688). The issue was due to 8.0.0 was shipped with TS definitions of `7.5.0` release.\n\n- Add `R.differenceWith` method  - [Issue #91](https://github.com/selfrefactor/rambdax/issues/91)\n\n8.0.0\n\n- handle falsy values in merge methods - https://github.com/ramda/ramda/pull/3222\n\n- `R.head`/`R.last` don't return `undefined` for non-empty arrays\n\n- `R.type` supports dates in TS definition - `Rambda` already did support dates in JS.\n\n- Improve typings of `R.endsWith/startsWith` with regard to `string` input. - [PR #622](https://github.com/selfrefactor/rambda/pull/622)\n\n- Handle list as falsy value in `R.reduce` - [Ramda MR](https://github.com/ramda/ramda/pull/2997/files)\n\n- `R.nop` is removed - it will be moved to `Rambdax` as `R.noop`\n\n- `R.includes` is no longer using string literal in TypeScript definitions\n\n\u003e Reason for breaking change - synchronize with Ramda `0.29.0` release:\n\n- change order of `R.propEq` - [Ramda MR](https://github.com/ramda/ramda/pull/2938/files)\n\n7.5.0\n\n- IMPORTANT: Remove `export` property in `package.json` in order to allow `Rambda`  support for projects with `\"type\": \"module\"` in `package.json` - [Issue #667](https://github.com/selfrefactor/rambda/issues/657)\n\n- Add `R.unnest` - [Rambdax issue 89](https://github.com/selfrefactor/rambdax/issues/89)\n\n- `R.uniq` is not using `R.equals` as Ramda does - [Issue #88](https://github.com/selfrefactor/rambdax/issues/88)\n\n- Fix `R.path(['non','existing','path'], obj)` TS definition as 7.4.0 release caused TS errors - [Issue #668](https://github.com/selfrefactor/rambda/issues/668)\n\n7.4.0\n\n- Synchronize with `@types/ramda` - `R.prop`, `R.path`, `R.pickAll`\n\n- Remove `esm` Rollup output due to tree-shaking issues.\n\n- Upgrade all dev dependencies.\n\n7.3.0\n\n- Important - changing import declaration in `package.json` in order to fix tree-shaking issue - [Issue #647](https://github.com/selfrefactor/rambda/issues/647)\n\n- Add `R.modify`\n\n- Allow multiple inputs in TypeScript versions of `R.anyPass` and `R.allPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/604)\n\n- Using wrong clone of object in `R.mergeDeepRight` - [Issue #650](https://github.com/selfrefactor/rambda/issues/650)\n\n- Missing early return in `R.where` - [Issue #648](https://github.com/selfrefactor/rambda/issues/648)\n\n- `R.allPass` doesn't accept more than 1 parameters for function predicates- [Issue #604](https://github.com/selfrefactor/rambda/issues/604)\n\n7.2.1\n\n- Remove bad typings of `R.propIs` which caused the library to cannot be build with TypeScript. \n\n- Drop support for `Wallaby` as per [https://github.com/wallabyjs/public/issues/3037](https://github.com/wallabyjs/public/issues/3037)\n\n7.2.0\n\n- Wrong `R.update` if index is `-1` - [PR #593](https://github.com/selfrefactor/rambda/pull/593)\n\n- Wrong curried typings in `R.anyPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/642)\n\n- `R.modifyPath` not exported - [Issue #640](https://github.com/selfrefactor/rambda/issues/640)\n\n- Add new method `R.uniqBy`. Implementation is coming from [Ramda MR#2641](https://github.com/ramda/ramda/pull/2641)\n\n- Apply the following changes from `@types/rambda`:\n\n-- [https://github.com/DefinitelyTyped/DefinitelyTyped/commit/bab47272d52fc7bb81e85da36dbe9c905a04d067](add `AnyFunction` and `AnyConstructor`)\n\n-- Improve `R.ifElse` typings - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59291\n\n-- Make `R.propEq` safe for `null/undefined` arguments - https://github.com/ramda/ramda/pull/2594/files\n\n7.1.4\n\n- `R.mergeRight` not found on `Deno` import - [Issue #633](https://github.com/selfrefactor/rambda/issues/633)\n\n7.1.0\n\n- Add `R.mergeRight` - introduced by Ramda's latest release. While Ramda renames `R.merge`, Rambda will keep `R.merge`.\n\n- Rambda's `pipe/compose` doesn't return proper length of composed function which leads to issue with `R.applySpec`. It was fixed by using Ramda's `pipe/compose` logic - [Issue #627](https://github.com/selfrefactor/rambda/issues/627)\n\n- Replace `Async` with `Promise` as return type of `R.type`.\n\n- Add new types as TypeScript output for `R.type` - \"Map\", \"WeakMap\", \"Generator\", \"GeneratorFunction\", \"BigInt\", \"ArrayBuffer\"\n\n- Add `R.juxt` method\n\n- Add `R.propSatisfies` method\n\n- Add new methods after `Ramda` version upgrade to `0.28.0`:\n\n-- R.count\n-- R.modifyPath\n-- R.on\n-- R.whereAny\n-- R.partialObject\n\n7.0.3\n\nRambda.none has wrong logic introduced in version `7.0.0` - [Issue #625](https://github.com/selfrefactor/rambda/issues/625)\n\n7.0.2\n\nRambda doesn't work with `pnpm` due to wrong export configuration - [Issue #619](https://github.com/selfrefactor/rambda/issues/619)\n\n7.0.1\n\n- Wrong ESM export configuration in `package.json` - [Issue #614](https://github.com/selfrefactor/rambda/issues/614)\n\n7.0.0\n\n- Breaking change - sync `R.compose`/`R.pipe` with `@types/ramda`. That is significant change so as safeguard, it will lead a major bump. Important - this lead to raising required TypeScript version to `4.2.2`. In other words, to use `Rambda` you'll need TypeScript version `4.2.2` or newer.\n\nRelated commit in `@types/ramda` - https://github.com/DefinitelyTyped/DefinitelyTyped/commit/286eff4f76d41eb8f091e7437eabd8a60d97fc1f#diff-4f74803fa83a81e47cb17a7d8a4e46a7e451f4d9e5ce2f1bd7a70a72d91f4bc1\n\nThere are several other changes in `@types/ramda` as stated in [this comment](https://github.com/ramda/ramda/issues/2976#issuecomment-990408945). This leads to change of typings for the following methods in **Rambda**:\n\n-- R.unless\n\n-- R.toString\n\n-- R.ifElse\n\n-- R.always\n\n-- R.complement\n\n-- R.cond\n\n-- R.is\n\n-- R.sortBy\n\n-- R.dissoc\n\n-- R.toPairs\n\n-- R.assoc\n\n-- R.toLower\n\n-- R.toUpper\n\n- One more reason for the breaking change is changing of export declarations in `package.json` based on [this blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#packagejson-exports-imports-and-self-referencing) and [this merged Ramda's PR](https://github.com/ramda/ramda/pull/2999). This also led to renaming of `babel.config.js` to `babel.config.cjs`. \n\n- Add `R.apply`, `R.bind` and `R.unapply`\n\n- `R.startsWith/R.endsWith` now support lists as inputs. This way, it matches current Ramda behavior. \n\n- Remove unused typing for `R.chain`.\n\n- `R.map`/`R.filter` no longer accept bad inputs as iterable. This way, Rambda behaves more like Ramda, which also throws.\n\n- Make `R.lastIndexOf` follow the logic of `R.indexOf`.\n\n- Change `R.type` logic to Ramda logic. This way, `R.type` can return `Error` and `Set` as results.\n\n- Add missing logic in `R.equals` to compare sets - [Issue #599](https://github.com/selfrefactor/rambda/issues/599)\n\n- Improve list cloning - [Issue #595](https://github.com/selfrefactor/rambda/issues/595)\n\n- Handle multiple inputs with `R.allPass` and `R.anyPass` - [Issue #604](https://github.com/selfrefactor/rambda/issues/604)\n\n- Fix `R.length` wrong logic with inputs as `{length: 123}` - [Issue #606](https://github.com/selfrefactor/rambda/issues/606).\n\n- Improve non-curry typings of `R.merge` by using types from [mobily/ts-belt](https://github.com/mobily/ts-belt).\n\n- Improve performance of `R.uniqWith`.\n\n- Wrong `R.update` if index is `-1` - [PR #593](https://github.com/selfrefactor/rambda/pull/593)\n\n- Make `R.eqProps` safe for falsy inputs - based on [this opened Ramda PR](https://github.com/ramda/ramda/pull/2943).\n\n- Incorrect benchmarks for `R.pipe/R.compose` - [Issue #608](https://github.com/selfrefactor/rambda/issues/608)\n\n- Fix `R.last/R.head` typings - [Issue #609](https://github.com/selfrefactor/rambda/issues/609) \n\n6.9.0\n\n- Fix slow `R.uniq` methods - [Issue #581](https://github.com/selfrefactor/rambda/issues/581)\n\nFixing `R.uniq` was done by improving `R.indexOf` which has performance implication to all methods importing `R.indexOf`:\n\n- R.includes\n- R.intersection\n- R.difference\n- R.excludes\n- R.symmetricDifference\n- R.union\n\n- R.without no longer support the following case - `without('0:1', ['0', '0:1']) // =\u003e ['0']`. Now it throws as the first argument should be a list, not a string. Ramda, on the other hand, returns an empty list - https://github.com/ramda/ramda/issues/3086. \n\n6.8.3\n\n- Fix TypeScript build process with `rambda/immutable` - [Issue #572](https://github.com/selfrefactor/rambda/issues/572)\n\n- Add `R.objOf` method\n\n- Add `R.mapObjIndexed` method\n\n- Publish shorter README.md version to NPM\n\n6.8.0\n\n- `R.has` use `Object.prototype.hasOwnProperty`- [Issue #572](https://github.com/selfrefactor/rambda/issues/572)\n\n- Expose `immutable.ts` typings which are Rambda typings with `readonly` statements - [Issue #565](https://github.com/selfrefactor/rambda/issues/565)\n\n- Fix `R.intersection` wrong order compared to Ramda.\n\n- `R.path` wrong return of `null` instead of `undefined` when path value is `null` - [PR #577](https://github.com/selfrefactor/rambda/pull/577)\n\n6.7.0\n\n- Remove `ts-toolbelt` types from TypeScript definitions. Most affected are the following methods, which lose one of its curried definitions:\n\n1. R.maxBy\n2. R.minBy\n3. R.pathEq\n4. R.viewOr\n5. R.when\n6. R.merge\n7. R.mergeDeepRight\n8. R.mergeLeft\n\n6.6.0\n\n- Change `R.piped` typings to mimic that of `R.pipe`. Main difference is that `R.pipe` is focused on unary functions.\n\n- Fix wrong logic when `R.without` use `R.includes` while it should use array version of `R.includes`.\n\n- Use uglify plugin for UMD bundle.\n\n- Remove `dist` folder from `.gitignore` in order to fix `Deno` broken package. [Issue #570](https://github.com/selfrefactor/rambda/issues/570)\n\n- Improve `R.fromPairs` typings - [Issue #567](https://github.com/selfrefactor/rambda/issues/567)\n\n6.5.3\n\n- Wrong logic where `R.without` use `R.includes` while it should use the array version of `R.includes`\n\nThis is Ramda bug, that Rambda also has before this release - https://github.com/ramda/ramda/issues/3086\n\n6.5.2\n\n- Wrong `R.defaultTo` typings - changes introduced in v6.5.0 are missing their TS equivalent.\n\n- Update dependencies\n\n6.5.1\n\nFix wrong versions in changelog\n\n6.5.0\n\n- `R.defaultTo` no longer accepts infinite inputs, thus it follows Ramda implementation.\n\n- `R.equals` supports equality of functions.\n\n- `R.pipe` doesn't use `R.compose`.\n\n- Close [Issue #561](https://github.com/selfrefactor/rambda/issues/561) - export several internal TS interfaces and types\n\n- Close [Issue #559](https://github.com/selfrefactor/rambda/issues/559) - improve `R.propOr` typings\n\n- Add `CHANGELOG.md` file in release files list\n\n\u003e This is only part of the changelog. You can read the full text in [CHANGELOG.md](CHANGELOG.md) file.\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-changelog)\n\n## ❯ Additional info\n\n\u003e Most influential contributors(in alphabetical order)\n\n- ![farwayer avatar](https://avatars.githubusercontent.com/farwayer) [@farwayer](https://github.com/farwayer) - improving performance in R.find, R.filter; give the idea how to make benchmarks more reliable;\n\n- ![thejohnfreeman avatar](https://avatars.githubusercontent.com/thejohnfreeman) [@thejohnfreeman](https://github.com/thejohnfreeman) - add R.assoc, R.chain;\n\n- ![peeja avatar](https://avatars.githubusercontent.com/peeja) [@peeja](https://github.com/peeja) - add several methods and fix mutiple issues; provides great MR documentation\n\n- ![helmuthdu avatar](https://avatars.githubusercontent.com/helmuthdu) [@helmuthdu](https://github.com/helmuthdu) - add R.clone; help improve code style;\n\n- ![jpgorman avatar](https://avatars.githubusercontent.com/jpgorman) [@jpgorman](https://github.com/jpgorman) - add R.zip, R.reject, R.without, R.addIndex;\n\n- ![ku8ar avatar](https://avatars.githubusercontent.com/ku8ar) [@ku8ar](https://github.com/ku8ar) - add R.slice, R.propOr, R.identical, R.propIs and several math related methods; introduce the idea to display missing Ramda methods;\n\n- ![romgrk avatar](https://avatars.githubusercontent.com/romgrk) [@romgrk](https://github.com/romgrk) - add R.groupBy, R.indexBy, R.findLast, R.findLastIndex;\n\n- ![squidfunk avatar](https://avatars.githubusercontent.com/squidfunk) [@squidfunk](https://github.com/squidfunk) - add R.assocPath, R.symmetricDifference, R.difference, R.intersperse;\n\n- ![synthet1c avatar](https://avatars.githubusercontent.com/synthet1c) [@synthet1c](https://github.com/synthet1c) - add all lenses methods; add R.applySpec, R.converge;\n\n- ![vlad-zhukov avatar](https://avatars.githubusercontent.com/vlad-zhukov) [@vlad-zhukov](https://github.com/vlad-zhukov) - help with configuring Rollup, Babel; change export file to use ES module exports;\n\n\u003e Rambda references\n\n- [Interview with Dejan Totef at SurviveJS blog](https://survivejs.com/blog/rambda-interview/)\n\n- [Awesome functional Javascript programming libraries](https://github.com/stoeffel/awesome-fp-js#libraries)\n\n- [Overview of Rambda pros/cons](https://mobily.github.io/ts-belt/docs/#rambda-%EF%B8%8F)\n\n\u003e Links to Rambda\n\n- [awesome-fp-js](https://github.com/stoeffel/awesome-fp-js)\n\n- [Web Tools Weekly #280](https://mailchi.mp/webtoolsweekly/web-tools-280)\n\n- [awesome-docsify](https://github.com/docsifyjs/awesome-docsify)\n\n\u003e Deprecated from `Used by` section\n\n- [SAP's Cloud SDK](https://github.com/SAP/cloud-sdk) - This repo doesn't uses `Rambda` since *October/2020* [commit that removes Rambda](https://github.com/SAP/cloud-sdk/commit/b29b4f915c4e4e9c2441e7b6b67cf83dac1fdac3)\n\n[![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-additional-info)\n\n## My other libraries\n\n\u003ctable\u003e\n    \u003ctbody\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd width=\"20%\" align=\"center\"\u003e\n                \u003ch4\u003eNiketa theme\u003c/h4\u003e\n                \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=selfrefactor.Niketa-theme\"\u003eCollection of 9 light VSCode themes\u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd width=\"20%\" align=\"center\"\u003e\n                \u003ch4\u003eNiketa dark theme\u003c/h4\u003e\n                \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=selfrefactor.niketa-dark-theme\"\u003eCollection of 9 dark VSCode themes\u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd width=\"20%\" align=\"center\"\u003e\n                \u003ch4\u003eString-fn\u003c/h4\u003e\n                \u003ca href=\"https://github.com/selfrefactor/services/tree/master/packages/string-fn\"\u003eString utility library\u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd width=\"20%\" align=\"center\"\u003e\n                \u003ch4\u003eUseful Javascript libraries\u003c/h4\u003e\n                \u003ca href=\"https://github.com/selfrefactor/useful-javascript-libraries\"\u003eLarge collection of JavaScript,TypeScript and Angular related repos links\u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd width=\"20%\" align=\"center\"\u003e\n                \u003ch4\u003eRun-fn\u003c/h4\u003e\n                \u003ca href=\"https://github.com/selfrefactor/services/tree/master/packages/run-fn\"\u003eCLI commands for lint JS/TS files, commit git changes and upgrade of dependencies\u003c/a\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/selfrefactor/rambda.svg)](https://starchart.cc/selfrefactor/rambda)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfrefactor%2Frambda-v9","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfrefactor%2Frambda-v9","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfrefactor%2Frambda-v9/lists"}