{"_id":"@crlfe.ca/typed-regexp","_rev":"4-b4b35c4b88b1bcb865749889a714a00b","name":"@crlfe.ca/typed-regexp","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@crlfe.ca/typed-regexp","version":"0.1.0","keywords":["typescript","regexp"],"author":{"url":"https://crlfe.ca/","name":"Chris Wolfe"},"license":"Apache-2.0","_id":"@crlfe.ca/typed-regexp@0.1.0","maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"homepage":"https://github.com/crlfe/typed-regexp","dist":{"shasum":"542132e85d050c7003e3ffeb3dba12e6617e97c6","tarball":"https://registry.npmjs.org/@crlfe.ca/typed-regexp/-/typed-regexp-0.1.0.tgz","fileCount":14,"integrity":"sha512-ExR4pYNf5C1Ac5GmBZtKhgJDXPimpS5lz9PmlpwLxWldvwiXnkEP8kO2wu1aZgiMCpdiEzcZ5EjSdD+cBdNwDQ==","signatures":[{"sig":"MEUCIGSuy8oQafxIPYnuMbzKeVzP91cXNXfprGi3qvMNPA0XAiEA6ghqBAdryvp4uTGP98tC5f5x7mtyvgkrutPN0ttkpeA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32767},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"73f29605e35103109d2399c31b5eca6fdb16061f","scripts":{"lint":"eslint && prettier --check .","test":"vitest","test-types":"vitest --typecheck"},"_npmUser":{"name":"crlfe.ca","email":"me@crlfe.ca"},"_npmVersion":"10.7.0","description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"packageManager":"npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a","devDependencies":{"eslint":"^9.15.0","vitest":"^2.1.5","prettier":"^3.3.3","@eslint/js":"^9.15.0","typescript":"^5.7.2","@types/node":"^22.9.3","typescript-eslint":"^8.15.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-regexp_0.1.0_1732629063287_0.41392448597861353","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@crlfe.ca/typed-regexp","version":"0.1.1","keywords":["typescript","regexp"],"author":{"url":"https://crlfe.ca/","name":"Chris Wolfe"},"license":"Apache-2.0","_id":"@crlfe.ca/typed-regexp@0.1.1","maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"homepage":"https://github.com/crlfe/typed-regexp","dist":{"shasum":"0a13156ab8218f58420ab09ddf95f3dac8c05746","tarball":"https://registry.npmjs.org/@crlfe.ca/typed-regexp/-/typed-regexp-0.1.1.tgz","fileCount":14,"integrity":"sha512-iE7uXoeBazeg67PDYfnWIFXs8D2ZAnMSu4upTHO3NryV46AgbD+kmZvHeqDOyJgzZdpVHCGcbBbOF8tXg7Oqyg==","signatures":[{"sig":"MEUCIQD9/7nr0rJtuGzutBiDfpfXPaX4bHVQNvr3Yeun4SpfJgIgQnMUX8ibW1iMzEXo4yIEIyduQm4krRBax7yBkJoApB8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32722},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"c1a6e23ddf79b36f314d65c1126dcf246d32ce21","scripts":{"lint":"eslint && prettier --check .","test":"vitest","test-types":"vitest --typecheck"},"_npmUser":{"name":"crlfe.ca","email":"me@crlfe.ca"},"_npmVersion":"10.7.0","description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"packageManager":"npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a","devDependencies":{"eslint":"^9.15.0","vitest":"^2.1.5","prettier":"^3.3.3","@eslint/js":"^9.15.0","typescript":"^5.7.2","@types/node":"^22.9.3","typescript-eslint":"^8.15.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-regexp_0.1.1_1732629729233_0.24322390029851326","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@crlfe.ca/typed-regexp","version":"0.1.2","keywords":["typescript","regexp"],"author":{"url":"https://crlfe.ca/","name":"Chris Wolfe"},"license":"Apache-2.0","_id":"@crlfe.ca/typed-regexp@0.1.2","maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"homepage":"https://github.com/crlfe/typed-regexp","dist":{"shasum":"86cd18eef353e87125dc8f187cba4155f9321eef","tarball":"https://registry.npmjs.org/@crlfe.ca/typed-regexp/-/typed-regexp-0.1.2.tgz","fileCount":19,"integrity":"sha512-fMpAQ3yDoOulAshN8+UWX6t+pd8g7feoJI9tFhyJaYT7EWuQxuq1E9rXRI8j7pCSwnCF9I7B8QKjIvHanmz6CQ==","signatures":[{"sig":"MEUCIQCWM1zpvwYOF4NijPwD/SfrMLimYYrdPZ+lNArb64ol1wIgD4lWeNiPh4AfVl+mxojZcbv41I6ODoWAUprpiA8YYb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35090},"main":"./dist/cjs/index.js","types":"./index.d.ts","module":"./dist/esm/index.mjs","gitHead":"9ed02aec8e69cc3419aa25d918fe3aba7dba1299","scripts":{"lint":"eslint && prettier --check .","test":"vitest","build":"npm run build:cjs && npm run build:esm","gen:dts":"tsc --noEmit false --declaration true --declarationMap true --emitDeclarationOnly true --outDir .","build:cjs":"tsc --noEmit false --outDir ./dist/cjs --module commonjs","build:esm":"tsc --noEmit false --outDir ./dist/esm","test-types":"vitest --typecheck","postgen:dts":"prettier --write index.d.ts","postbuild:esm":"node ./rename-esm.mjs"},"_npmUser":{"name":"crlfe.ca","email":"me@crlfe.ca"},"_npmVersion":"10.7.0","description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"packageManager":"npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a","devDependencies":{"eslint":"^9.15.0","vitest":"^2.1.5","prettier":"^3.3.3","@eslint/js":"^9.15.0","typescript":"^5.7.2","@types/node":"^22.9.3","typescript-eslint":"^8.15.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-regexp_0.1.2_1733326726210_0.7573514802994135","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@crlfe.ca/typed-regexp","version":"0.2.0","keywords":["typescript","regexp"],"author":{"url":"https://crlfe.ca/","name":"Chris Wolfe"},"license":"MIT","_id":"@crlfe.ca/typed-regexp@0.2.0","maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"homepage":"https://github.com/crlfe/typed-regexp","dist":{"shasum":"33f47fdd82c477f0d30d1ae79f558190d12e30b2","tarball":"https://registry.npmjs.org/@crlfe.ca/typed-regexp/-/typed-regexp-0.2.0.tgz","fileCount":18,"integrity":"sha512-l/QJBjMymcQMjdSKl3kxinIyI3sZn/2wfSfPh9DoYCrRW4ApjFzDPEIKHo4Vyq99NamlUfpq+lcSLkSnOrlcWQ==","signatures":[{"sig":"MEQCIBheIOdxQVFl1CIEhtgH5GeBNcE28HxOUpMlc19NiCAIAiAJiFJKJ79TsPhkydB5YUjlCGp2kIvNY/6qJtVvMLNeEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25235},"main":"./dist/cjs/index.js","types":"./index.d.ts","module":"./dist/esm/index.mjs","gitHead":"99616f7c3969c87c538c604153f57b909cceffc8","scripts":{"lint":"eslint && prettier --check .","test":"vitest","build":"npm run build:cjs && npm run build:esm && npm run build:dts","build:cjs":"tsc --noEmit false --outDir ./dist/cjs --module commonjs","build:dts":"tsc --noEmit false --declaration true --declarationMap true --emitDeclarationOnly true --outDir .","build:esm":"tsc --noEmit false --outDir ./dist/esm","test-types":"vitest --typecheck","postbuild:dts":"prettier --write index.d.ts","postbuild:esm":"node ./rename-esm.mjs"},"_npmUser":{"name":"crlfe.ca","email":"me@crlfe.ca"},"_npmVersion":"10.7.0","description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"packageManager":"npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a","devDependencies":{"eslint":"^9.15.0","vitest":"^2.1.5","prettier":"^3.3.3","@eslint/js":"^9.15.0","typescript":"^5.7.2","@types/node":"^22.9.3","typescript-eslint":"^8.15.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-regexp_0.2.0_1734458493191_0.11799466450748297","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@crlfe.ca/typed-regexp","version":"0.2.1","description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","keywords":["typescript","regexp"],"homepage":"https://github.com/crlfe/typed-regexp","license":"MIT","author":{"name":"Chris Wolfe","url":"https://crlfe.ca/"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","scripts":{"lint":"eslint && prettier --check .","test":"vitest","test-types":"vitest --typecheck"},"devDependencies":{"@eslint/js":"^9.15.0","@types/node":"^22.9.3","eslint":"^9.15.0","prettier":"^3.3.3","typescript-eslint":"^8.15.0","vite-tsconfig-paths":"^5.1.4","vitest":"^3.0.5"},"packageManager":"npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a","_id":"@crlfe.ca/typed-regexp@0.2.1","gitHead":"4315800fcbc633ea9c4c1e4113b3b9ba67bfab28","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Ct/zcvfoAcn2HVWgtwRu5hQI1Vapw6yoeLB6AxepKiVE7HMnes1O5YLs/ba0XKtMfrc/GR2yuwJTnqweY3irGg==","shasum":"a0abbd0e3a8c85e80c40c2e02ea842b2a572699d","tarball":"https://registry.npmjs.org/@crlfe.ca/typed-regexp/-/typed-regexp-0.2.1.tgz","fileCount":17,"unpackedSize":40889,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDKqLhwFZsAJXoABbat2Mx7Lt9TxkDtowgjJpZOqrub9AIhALbA9DO7+QKu44LzUdE/6L7wib8S6Ggf94uZyAmBWxBK"}]},"_npmUser":{"name":"crlfe.ca","email":"me@crlfe.ca"},"directories":{},"maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typed-regexp_0.2.1_1738701940723_0.899698844477113"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-26T13:51:03.189Z","modified":"2025-02-04T20:45:41.055Z","0.1.0":"2024-11-26T13:51:03.455Z","0.1.1":"2024-11-26T14:02:09.444Z","0.1.2":"2024-12-04T15:38:46.375Z","0.2.0":"2024-12-17T18:01:33.366Z","0.2.1":"2025-02-04T20:45:40.889Z"},"author":{"name":"Chris Wolfe","url":"https://crlfe.ca/"},"license":"MIT","homepage":"https://github.com/crlfe/typed-regexp","keywords":["typescript","regexp"],"description":"Better tooltips and stricter types for regular expressions, by parsing them in Typescript type declarations","maintainers":[{"name":"crlfe.ca","email":"me@crlfe.ca"}],"readme":"# Typed RegExp\n\nThis library adds better tooltips and stricter types for regular expressions,\nbased on compile-time parsing in Typescript type declarations.\n\n```Shell\nnpm i '@crlfe.ca/typed-regexp'\n```\n\nTo use the bleeding-edge development version instead, you can install\ndirectly from this git repository:\n\n```Shell\nnpm i 'github:crlfe/typed-regexp'\n```\n\nUnfortunately, Typescript does not let us access tagged template literals or\nregexp literals at compile-time, so you need to provide the input pattern as\na string literal:\n\n```TypeScript\nimport { TypedRegExp } from \"@crlfe.ca/typed-regexp\";\n\n// Double slash is needed before \"s\" to match whitespace.\nconst good = new TypedRegExp(\"(hello)\\\\s+(?<place>world)\");\nconst goodMatch = good.exec(\"hello world\");\nif (goodMatch) {\n  // Your IDE type hints and suggestions should work!\n  console.log(goodMatch.groups.place);\n}\n\n// Only strings known at compile-time can be parsed.\nconst bad = new TypedRegExp(\"(hello)\\\\s+\" + \"(?<place>world)\");\nconst badMatch = bad.exec(\"hello world\");\nif (badMatch) {\n  // Your IDE can not help here, but the value is the same.\n  console.log(badMatch.groups.place);\n}\n```\n\nBecause regular expressions can be large and complex, we provide wrappers\nfor some common string manipulation functions so that their values are\nvisible to the type system, and therefore to TypedRegExp:\n\n```TypeScript\nimport { concat, join, TypedRegExp } from \"@crlfe.ca/typed-regexp\";\n\nconst what = new TypedRegExp(\n  concat(\n    \"hello\",\n    \"\\\\s+\",\n    \"(?<place>world)\"\n  )\n);\n\nconst whatMatch = what.exec(\"hello world\");\nif (whatMatch) {\n  // Your IDE type hints and suggestions should work!\n  console.log(whatMatch.groups.place);\n}\n\nconst fancy = new TypedRegExp(\n  join(\"|\",\n    \"(?<fizz>fizz)\",\n    \"(?<buzz>buzz)\"\n  )\n);\n\nconst fancyMatch = fancy.exec(\"buzz\");\nif (fancyMatch) {\n  // Your IDE type hints and suggestions should work!\n  console.log(fancyMatch.groups);\n}\n```\n","readmeFilename":"README.md"}