{"id":51166376,"url":"https://github.com/shahradelahi/ts-braces","last_synced_at":"2026-06-26T19:02:32.415Z","repository":{"id":365906496,"uuid":"1273192352","full_name":"shahradelahi/ts-braces","owner":"shahradelahi","description":"⚡ High-performance, V8-safe numeric \u0026 alphabetical range expander and regex compiler.","archived":false,"fork":false,"pushed_at":"2026-06-19T11:17:59.000Z","size":85,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-19T13:09:01.077Z","etag":null,"topics":["alphabetical-range","braces","numeric-range","range-expansion","regex-compiler","typescript","v8-safe"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@se-oss/braces","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/shahradelahi.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-18T09:38:47.000Z","updated_at":"2026-06-19T11:18:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/shahradelahi/ts-braces","commit_stats":null,"previous_names":["shahradelahi/ts-braces"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shahradelahi/ts-braces","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fts-braces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fts-braces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fts-braces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fts-braces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahradelahi","download_url":"https://codeload.github.com/shahradelahi/ts-braces/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fts-braces/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34829415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"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":["alphabetical-range","braces","numeric-range","range-expansion","regex-compiler","typescript","v8-safe"],"created_at":"2026-06-26T19:02:30.657Z","updated_at":"2026-06-26T19:02:32.408Z","avatar_url":"https://github.com/shahradelahi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003csup\u003e@se-oss/braces\u003c/sup\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/shahradelahi/ts-braces/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/shahradelahi/ts-braces/actions/workflows/ci.yml/badge.svg?branch=main\u0026event=push\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@se-oss/braces\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@se-oss/braces.svg\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\" alt=\"MIT License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/package/@se-oss/braces\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@se-oss/braces\" alt=\"npm bundle size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagephobia.com/result?p=@se-oss/braces\"\u003e\u003cimg src=\"https://packagephobia.com/badge?p=@se-oss/braces\" alt=\"Install Size\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n_@se-oss/braces_ is a high-performance, V8-safe numeric and alphabetical range expander and regular expression compiler.\n\n---\n\n- [Installation](#-installation)\n- [Usage](#-usage)\n- [Documentation](#-documentation)\n- [Contributing](#-contributing)\n- [License](#license)\n\n## 📦 Installation\n\n```bash\npnpm add @se-oss/braces\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall using your favorite package manager\u003c/summary\u003e\n\n**npm**\n\n```bash\nnpm install @se-oss/braces\n```\n\n**yarn**\n\n```bash\nyarn add @se-oss/braces\n```\n\n\u003c/details\u003e\n\n## 📖 Usage\n\n### Range Expansion\n\nExpand numeric or alphabetical range patterns with optional stepping.\n\n```ts\nimport { expandRange } from '@se-oss/braces';\n\n// Numeric ranges\nexpandRange('1..3'); // ['1', '2', '3']\n\n// Alphabetical ranges\nexpandRange('a..c'); // ['a', 'b', 'c']\n```\n\n### Step Parameters\n\nSpecify a custom step interval for the range.\n\n```ts\nimport { expandRange } from '@se-oss/braces';\n\nexpandRange('1..5..2'); // ['1', '3', '5']\n```\n\n### Zero-Padding Preservation\n\nAutomatically preserves leading zeros in numeric ranges.\n\n```ts\nimport { expandRange } from '@se-oss/braces';\n\nexpandRange('01..03'); // ['01', '02', '03']\n```\n\n### Expansion Limit \u0026 Errors\n\nEnforce safety limits on large range expansions to prevent resource exhaustion.\n\n```ts\nimport { BraceLimitError, expandRange } from '@se-oss/braces';\n\ntry {\n  // Try to expand a huge range with a low threshold limit\n  expandRange('1..10000', 10);\n} catch (error) {\n  if (error instanceof BraceLimitError) {\n    console.error('Expansion limit exceeded!');\n  }\n}\n```\n\n### V8-Safe Regular Expression Compiler\n\nCompile numeric ranges into highly optimized and V8-safe regular expression patterns.\n\n```ts\nimport { compileNumericRange } from '@se-oss/braces';\n\nconst pattern = compileNumericRange(1, 250);\n// returns: \"[1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|250\"\n\nconst regex = new RegExp(`^(?:${pattern})$`);\nregex.test('99'); // true\nregex.test('250'); // true\nregex.test('251'); // false\n```\n\n## 📚 Documentation\n\nFor more information, please see the JSDoc comments or check the source code.\n\n## 🤝 Contributing\n\nWant to contribute? Awesome! To show your support is to star the project, or to raise issues on [GitHub](https://github.com/shahradelahi/ts-braces).\n\nThanks again for your support, it is much appreciated! 🙏\n\n## License\n\n[MIT](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi) and [contributors](https://github.com/shahradelahi/ts-braces/graphs/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fts-braces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahradelahi%2Fts-braces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fts-braces/lists"}