{"id":41055049,"url":"https://github.com/typescript-package/affix","last_synced_at":"2026-01-22T11:35:46.297Z","repository":{"id":274854173,"uuid":"924304840","full_name":"typescript-package/affix","owner":"typescript-package","description":"A lightweight TypeScript library for different kind of affixes.","archived":false,"fork":false,"pushed_at":"2025-06-10T17:59:35.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T06:54:12.672Z","etag":null,"topics":["affix","circumfix","infix","prefix","suffix"],"latest_commit_sha":null,"homepage":"","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/typescript-package.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["angular-package"],"patreon":"angularpackage","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29","https://donate.stripe.com/dR614hfDZcJE3wAcMM"]}},"created_at":"2025-01-29T19:10:29.000Z","updated_at":"2025-06-10T17:58:10.000Z","dependencies_parsed_at":"2025-06-01T04:06:39.477Z","dependency_job_id":"baca7b42-2f96-464a-b821-1ee422064974","html_url":"https://github.com/typescript-package/affix","commit_stats":null,"previous_names":["typescript-package/affix"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/typescript-package/affix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typescript-package%2Faffix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typescript-package%2Faffix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typescript-package%2Faffix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typescript-package%2Faffix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typescript-package","download_url":"https://codeload.github.com/typescript-package/affix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typescript-package%2Faffix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28662166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["affix","circumfix","infix","prefix","suffix"],"created_at":"2026-01-22T11:35:45.549Z","updated_at":"2026-01-22T11:35:46.281Z","avatar_url":"https://github.com/typescript-package.png","language":"TypeScript","funding_links":["https://github.com/sponsors/angular-package","https://patreon.com/angularpackage","https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29","https://donate.stripe.com/dR614hfDZcJE3wAcMM","https://github.com/sponsors/angular-package/sponsorships?sponsor=sciborrudnicki\u0026tier_id=83618","https://www.patreon.com/checkout/angularpackage?rid=0\u0026fan_landing=true\u0026view_as=public"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.typescriptlang.org/\"\u003e\n  \u003cimg\n    src=\"https://avatars.githubusercontent.com/u/189666396?s=150\u0026u=9d55b1eb4ce258974ead76bf07ccf49ef0eb0ea7\u0026v=4\"\n    title=\"@typescript-package - The typescript package enhances the development of typescript-based applications by providing well-structured, reusable, easy-to-use packages.\"\n  /\u003e\n\u003c/a\u003e\n\n## typescript-package/affix\n\n\u003c!-- npm badge --\u003e\n[![npm version][typescript-package-npm-badge-svg]][typescript-package-npm-badge]\n[![GitHub issues][typescript-package-badge-issues]][typescript-package-issues]\n[![GitHub license][typescript-package-badge-license]][typescript-package-license]\n\n**version**: v4.0.0\n\nA **lightweight** TypeScript library for different kind of affixes.\n\n\u003cbr\u003e\n\n## Table of contents\n\n- [Installation](#installation)\n- [Api](#api)\n  - [`AffixCore`](#affixcore)\n  - [`Affix`](#affix)\n  - [`Circumfix`](#circumfix)\n  - [`Infix`](#infix)\n  - [`Prefix`](#prefix)\n  - [`Suffix`](#suffix)\n- [Contributing](#contributing)\n- [Support](#support)\n- [Code of Conduct](#code-of-conduct)\n- [Git](#git)\n  - [Commit](#commit)\n  - [Versioning](#versioning)\n- [License](#license)\n\n## Installation\n\n### 1. Install peer dependencies\n\n```bash\nnpm install @typedly/affix --save-peer\n```\n\n### 2. Install the package\n\n```bash\nnpm install @typescript-package/affix --save-peer\n```\n\n## Api\n\n```typescript\nimport {\n  // Abstract.\n  AffixCore,\n  // Class.\n  Affix,\n  Circumfix,\n  Infix,\n  Prefix,\n  Suffix,\n} from '@typescript-package/affix';\n```\n\n### `AffixCore`\n\nA core `abstract` class to manage affixes with the value and kind that can be applied to strings.\n\n```typescript\nimport { AffixCore } from '@typescript-package/affix';\n\nclass Prefix extends AffixCore\u003cstring, 'prefix'\u003e {\n  constructor(value: string) {\n    super(value, 'prefix');\n  }\n}\n```\n\n### `Affix`\n\nA concrete class to manage affixes that can be applied to strings with additional sanitization.\n\n```typescript\nimport { Affix } from '@typescript-package/affix';\n\nexport const prefix = new Affix(\"testAffixValue\",  {\n  kind: 'prefix' as BasicAffixKind,\n  pattern: /[^a-zA-Z0-9$_]/g,\n});\n```\n\n### `Circumfix`\n\nA class to manage circumfixes that can be applied to strings.\n\n```typescript\nimport { Circumfix } from '@typescript-package/affix';\n\nconst circumfix = new Circumfix(\n  'pre', // Start\n  'post', // End\n  /[^a-zA-Z0-9$_]/g // Pattern\n);\n\ncircumfix.insertTo(\n  'light' // Stem\n); // 'prelightpost'\n```\n\n### `Infix`\n\nA class to manage infixes that can be applied to strings.\n\n```typescript\nimport { Infix } from '@typescript-package/affix';\n\nconst infix = new Infix('en');\n\ninfix.insertTo(\n  'light', // stem\n  5 // position\n); // 'lighten'\ninfix.insertTo(\n  'light', // stem\n  0 // position\n); // 'enlight'\ninfix.insertTo(\n  'light', // stem\n  1, // position\n  '-' // delimiter\n); // 'l-en-ight'\n```\n\n### `Prefix`\n\nA class to manage prefixes that can be applied to strings.\n\n```typescript\nimport { Prefix } from '@typescript-package/affix';\n\nconst prefix = new Prefix(\n  'pre', // Value\n  /[^a-zA-Z0-9$_]/g // Pattern\n);\n\nprefix.prependTo(\n  'stem', // stem\n  '-' // delimiter\n); // 'pre-stem'\n\nconsole.debug(`default =\u003e `, Prefix.default); // ''\nconsole.debug(`pattern =\u003e `, Prefix.pattern); // RegExp /[^a-zA-Z0-9$_]/g\nconsole.debug(`tagName =\u003e `, Prefix.tagName); // 'Prefix'\n\nconsole.debug(`kind =\u003e `, prefix.kind); // 'prefix'\nconsole.debug(`pattern =\u003e `, prefix.pattern); // RegExp /[^a-zA-Z0-9$_]/g\nconsole.debug(`prefix =\u003e `, prefix.prefix); // 'pre'\nconsole.debug(`toStringTag =\u003e `, prefix[Symbol.toStringTag]); // 'Prefix'\nconsole.debug(`value =\u003e `, prefix.value); // 'pre'\n\nconsole.debug(`prefix.get()`, prefix.get()); // 'pre'\nconsole.debug(`prefix.set({value: 'newPrefix'}) =\u003e `, prefix.set({value: 'newPrefix' as any}).value); // 'newPrefix'\n\nconsole.debug(`prefix.setKind('newKind') =\u003e `, prefix.setKind('newKind' as any).kind); // 'newKind'\nconsole.debug(`prefix.setPattern(/newPattern/g) =\u003e `, prefix.setPattern(/newPattern/g).pattern); // /newPattern/g\nconsole.debug(`prefix.setValue('newValue') =\u003e `, prefix.setValue('newValue' as any).value); // 'newValue'\n\n```\n\n### `Suffix`\n\nA class to manage suffixes that can be applied to strings.\n\n```typescript\nimport { Suffix } from '@typescript-package/affix';\n\nexport const suffix = new Suffix(\n  'post', // Value\n  /[^a-zA-Z0-9$_]/g // Pattern\n);\n\nSuffix.append(\n  'stem',\n  'post',\n  '-'\n); // \n\n```\n\n## Contributing\n\nYour contributions are valued! If you'd like to contribute, please feel free to submit a pull request. Help is always appreciated.\n\n## Support\n\nIf you find this package useful and would like to support its and general development, you can contribute through one of the following payment methods. Your support helps maintain the packages and continue adding new.\n\nSupport via:\n\n- [Stripe](https://donate.stripe.com/dR614hfDZcJE3wAcMM)\n- [Revolut](https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29)\n- [GitHub](https://github.com/sponsors/angular-package/sponsorships?sponsor=sciborrudnicki\u0026tier_id=83618)\n- [DonorBox](https://donorbox.org/become-a-sponsor-to-the-angular-package?default_interval=o)\n- [Patreon](https://www.patreon.com/checkout/angularpackage?rid=0\u0026fan_landing=true\u0026view_as=public)\n\nor via Trust Wallet\n\n- [XLM](https://link.trustwallet.com/send?coin=148\u0026address=GAFFFB7H3LG42O6JA63FJDRK4PP4JCNEOPHLGLLFH625X2KFYQ4UYVM4)\n- [USDT (BEP20)](https://link.trustwallet.com/send?coin=20000714\u0026address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94\u0026token_id=0x55d398326f99059fF775485246999027B3197955)\n- [ETH](https://link.trustwallet.com/send?coin=60\u0026address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94)\n- [BTC](https://link.trustwallet.com/send?coin=0\u0026address=bc1qnf709336tfl57ta5mfkf4t9fndhx7agxvv9svn)\n- [BNB](https://link.trustwallet.com/send?coin=20000714\u0026address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94)\n\nThanks for your support!\n\n## Code of Conduct\n\nBy participating in this project, you agree to follow **[Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)**.\n\n## GIT\n\n### Commit\n\n- [AngularJS Git Commit Message Conventions][git-commit-angular]\n- [Karma Git Commit Msg][git-commit-karma]\n- [Conventional Commits][git-commit-conventional]\n\n### Versioning\n\n[Semantic Versioning 2.0.0][git-semver]\n\n**Given a version number MAJOR.MINOR.PATCH, increment the:**\n\n- MAJOR version when you make incompatible API changes,\n- MINOR version when you add functionality in a backwards-compatible manner, and\n- PATCH version when you make backwards-compatible bug fixes.\n\nAdditional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.\n\n**FAQ**\nHow should I deal with revisions in the 0.y.z initial development phase?\n\n\u003e The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.\n\nHow do I know when to release 1.0.0?\n\n\u003e If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.\n\n## License\n\nMIT © angular-package ([license][typescript-package-license])\n\n\u003c!-- This package: typescript-package  --\u003e\n  \u003c!-- GitHub: badges --\u003e\n  [typescript-package-badge-issues]: https://img.shields.io/github/issues/typescript-package/affix\n  [typescript-package-badge-forks]: https://img.shields.io/github/forks/typescript-package/affix\n  [typescript-package-badge-stars]: https://img.shields.io/github/stars/typescript-package/affix\n  [typescript-package-badge-license]: https://img.shields.io/github/license/typescript-package/affix\n  \u003c!-- GitHub: badges links --\u003e\n  [typescript-package-issues]: https://github.com/typescript-package/affix/issues\n  [typescript-package-forks]: https://github.com/typescript-package/affix/network\n  [typescript-package-license]: https://github.com/typescript-package/affix/blob/master/LICENSE\n  [typescript-package-stars]: https://github.com/typescript-package/affix/stargazers\n\u003c!-- This package --\u003e\n\n\u003c!-- Package: typescript-package --\u003e\n  \u003c!-- npm --\u003e\n  [typescript-package-npm-badge-svg]: https://badge.fury.io/js/%40typescript-package%2Faffix.svg\n  [typescript-package-npm-badge]: https://badge.fury.io/js/%40typescript-package%2Faffix\n\n\u003c!-- GIT --\u003e\n[git-semver]: http://semver.org/\n\n\u003c!-- GIT: commit --\u003e\n[git-commit-angular]: https://gist.github.com/stephenparish/9941e89d80e2bc58a153\n[git-commit-karma]: http://karma-runner.github.io/0.10/dev/git-commit-msg.html\n[git-commit-conventional]: https://www.conventionalcommits.org/en/v1.0.0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypescript-package%2Faffix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypescript-package%2Faffix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypescript-package%2Faffix/lists"}