{"id":22161367,"url":"https://github.com/appsweet-co/ts-utils","last_synced_at":"2026-04-15T08:39:03.720Z","repository":{"id":40723897,"uuid":"295775550","full_name":"Appsweet-co/ts-utils","owner":"Appsweet-co","description":"Utility functions for TypeScript","archived":false,"fork":false,"pushed_at":"2024-02-21T17:32:21.000Z","size":1801,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-05T10:45:57.039Z","etag":null,"topics":["deno","fp","functional","functional-programing","functional-programming","immutable","javascript","monad","nodejs","typescript","utilities","utility"],"latest_commit_sha":null,"homepage":"https://appsweet-co.github.io/ts-utils/","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/Appsweet-co.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":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T15:46:45.000Z","updated_at":"2024-08-20T18:18:52.042Z","dependencies_parsed_at":"2024-08-20T18:18:44.958Z","dependency_job_id":"aa486617-bc65-4b6f-8bab-665960a0f94f","html_url":"https://github.com/Appsweet-co/ts-utils","commit_stats":null,"previous_names":["appsweet-co/utils"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fts-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fts-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fts-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fts-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Appsweet-co","download_url":"https://codeload.github.com/Appsweet-co/ts-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245295984,"owners_count":20592134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["deno","fp","functional","functional-programing","functional-programming","immutable","javascript","monad","nodejs","typescript","utilities","utility"],"created_at":"2024-12-02T04:14:42.614Z","updated_at":"2026-04-15T08:38:58.688Z","avatar_url":"https://github.com/Appsweet-co.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Logo\" width=\"250\" height=\"auto\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e@appsweet-co/ts-utils\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  A strongly-typed utility library for TypeScript\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n## Quick Start\n\n### Node\n\nInstall the [package](https://www.npmjs.com/package/@appsweet-co/ts-utils) using npm.\n\n```zsh\nnpm i @appsweet-co/ts-utils\n```\n\nImport utilities directly into your files as needed.\n\n```ts\nimport { clamp, map, sub } from '@appsweet-co/ts-utils';\n```\n\n### Deno\n\n:memo: ***NOTE: Support for Deno is a work in progress.***\n\nExport the package from your [`deps.ts`](https://deno.land/manual@v1.11.3/examples/manage_dependencies) file directly from GitHub.\n\n```ts\nexport * from \"https://raw.githubusercontent.com/Appsweet-co/ts-utils/index.ts\";\n```\nImport utilities in your files as needed.\n\n```ts\nimport { clamp, map, sub } from \"../deps.ts\";\n```\n\n## API Docs\n\nWe use [TypeDoc](http://typedoc.org/) to generate API docs. Visit the [docs website](https://appsweet-co.github.io/ts-utils/) for details. \n\n## Design Goals\n\n### Immutable Data\n\nMutated data is hard to work with. Use [immutable data](https://en.wikipedia.org/wiki/Immutable_object) instead.\n\n### Pure Functions\n\n[Pure Functions](https://en.wikipedia.org/wiki/Pure_function) are easy to test and work well with immutable data. They're also [referentially transparent](https://www.yld.io/blog/the-not-so-scary-guide-to-functional-programming/) and easy for JavaScript engines to [optimize](https://v8.dev/blog/turbofan-jit).\n\n### Single Input\n\nWe write functions that take exactly [one argument](https://en.wikipedia.org/wiki/Unary_function). We [curry](https://en.wikipedia.org/wiki/Currying) all functions as needed.\n\n### Graceful Fallbacks\n\nReturn fallbacks instead of undefined or throwing errors.\n\n### Fallback First, Data Last\n\nPassing data as the [last argument](https://dev.to/richytong/practical-functional-programming-in-javascript-data-last-1gjo) of a function is great for piping and currying, but TypeScript's typing system works best when we pass in data as the [first argument](https://basarat.gitbook.io/typescript/type-system/type-inference).\n\nWe pass [fallback values](#graceful-fallbacks) as the first argument and actual data as the last. This helps TypeScript understand the code while still allowing for piping and currying.\n\n## Code Examples\n\nPlease see the [API docs](#api-docs) for example code.\n\n## More Info\n\n- [LICENSE](./LICENSE)\n- [ROADMAP.md](./ROADMAP.md)\n- [THANKS.md](./THANKS.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsweet-co%2Fts-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappsweet-co%2Fts-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsweet-co%2Fts-utils/lists"}