{"id":26915069,"url":"https://github.com/andjsrk/create-curried","last_synced_at":"2026-05-02T03:32:49.253Z","repository":{"id":65821930,"uuid":"600679509","full_name":"andjsrk/create-curried","owner":"andjsrk","description":"A utility to create curried functions that its parameters are reordered by user-defined order","archived":false,"fork":false,"pushed_at":"2025-09-19T21:29:40.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T23:11:53.082Z","etag":null,"topics":["builder","currying","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/create-curried","language":"TypeScript","has_issues":true,"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/andjsrk.png","metadata":{"files":{"readme":"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":"2023-02-12T08:40:31.000Z","updated_at":"2025-09-21T17:13:56.000Z","dependencies_parsed_at":"2024-08-23T00:00:36.865Z","dependency_job_id":null,"html_url":"https://github.com/andjsrk/create-curried","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"5c12428e703597bc2d37acd613d1114e32baa396"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andjsrk/create-curried","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjsrk%2Fcreate-curried","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjsrk%2Fcreate-curried/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjsrk%2Fcreate-curried/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjsrk%2Fcreate-curried/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andjsrk","download_url":"https://codeload.github.com/andjsrk/create-curried/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjsrk%2Fcreate-curried/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32522245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["builder","currying","typescript"],"created_at":"2025-04-01T17:51:17.608Z","updated_at":"2026-05-02T03:32:49.241Z","avatar_url":"https://github.com/andjsrk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# create-curried\r\n\u003e :information_source: The package is ESM-only.\r\n\r\nA utility to create curried functions that its parameters are reordered by user-defined order.\r\n\r\n# Installation\r\n```sh\r\nnpm install create-curried\r\n```\r\n\r\n# Quick Example (TypeScript)\r\n```ts\r\nimport { curried } from 'create-curried'\r\n\r\nconst toBinaryString = curried(Number.prototype.toString, 1)\r\n\t.withBound(0, 2)\r\n\t.takesThis\u003cnumber\u003e() // no explicit `this` parameter in the signature, so manually specify it is a `number`\r\n\t.build()\r\n\r\ntoBinaryString(10) // =\u003e '1010'\r\n\r\nconst map = curried(Array.prototype.map, 2)\r\n\t.takes(0)\r\n\t.takesThis()\r\n\t.build\u003c\r\n\t\t\u003cT, U\u003e(callbackfn: (value: T, index: number, array: Array\u003cT\u003e) =\u003e U) =\u003e\r\n\t\t\t(array: Array\u003cT\u003e) =\u003e\r\n\t\t\t\tArray\u003cU\u003e\r\n\t\u003e()\r\n\r\nconst plusOne = (x: number) =\u003e x + 1\r\nconst plusOneEach = map(plusOne)\r\n\r\nplusOneEach([1, 2, 3]) // =\u003e [2, 3, 4]\r\n```\r\n\r\n# Guide\r\nStart by calling `curried` on the function: `curried(f)`.\r\nIf your function contains an optional parameter, you need to specify\r\nnumber of its parameter to determine where non-rest parameter ends.\r\n\r\nThen, call method `takes`/`takesThis`/`takesRest` to specify\r\nwhat the curried function takes (order matters!).\r\nIf some parameter of your function needs to be bound, you are allowed to call method `withBound`/`withBoundThis`.\r\n\r\nNow, call method `build` to build curried function.\r\nIf your function contains type parameters (a.k.a. generics),\r\nyou need to specify signature of the curried function, to\r\nmake the function to have a correct signature.\r\n\r\n# Note\r\n- your curried function takes rest parameter as single argument(`args: Array\u003cT\u003e`),\r\n  not multiple arguments(`...args: Array\u003cT\u003e`).\r\n- parameters that are not specified to take, get filled with `undefined`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandjsrk%2Fcreate-curried","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandjsrk%2Fcreate-curried","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandjsrk%2Fcreate-curried/lists"}