{"name":"regexp-clone","version":"1.2.0","description":"Zero dependency RegExp cloning with flag and lastIndex preservation.","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"types":"index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git://github.com/aheckmann/regexp-clone.git"},"bugs":{"url":"https://github.com/aheckmann/regexp-clone/issues"},"keywords":["RegExp","clone"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","devDependencies":{"@eslint/js":"^9.33.0","@eslint/markdown":"^7.1.0","eslint":"^9.33.0","globals":"^16.3.0","jiti":"^2.5.1","prettier":"3.6.2","typescript":"^5.9.2"},"scripts":{"test":"node test/index.js","build":"tsc","fix":"pnpm run '/^(format|lint)$/'","check":"pnpm run '/.*:check$/'","format":"prettier --write --cache --cache-location .prettiercache .","format:check":"prettier --check --cache --cache-location .prettiercache .","lint":"eslint --fix --cache --cache-location .eslintcache .","lint:check":"eslint --cache --cache-location .eslintcache ."},"_id":"regexp-clone@1.2.0","homepage":"https://github.com/aheckmann/regexp-clone#readme","_integrity":"sha512-d/LEfc+joiXe4uRyuXMJcOMoqTFKS3pSZUM8WWEqoQ51tZgCdgvu/HLMWaOslhR6igkCdeuc5DULADOK16glMA==","_resolved":"/private/var/folders/m2/1dk_cvb52g9ckkkvqks61h8w0000gn/T/738f3ef652f882e9094d2421aa45f323/regexp-clone-1.2.0.tgz","_from":"file:regexp-clone-1.2.0.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-d/LEfc+joiXe4uRyuXMJcOMoqTFKS3pSZUM8WWEqoQ51tZgCdgvu/HLMWaOslhR6igkCdeuc5DULADOK16glMA==","shasum":"f8d0745833f0d5ae19c0854ed99936555e34fcfc","tarball":"http://registry-npm.ywwl.com/regexp-clone/download/regexp-clone-1.2.0.tgz","fileCount":5,"unpackedSize":6228,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDS02256gihSPh6F7+QeR4x66gPJZ5CewlTXV1wFNf0BAIhAMoQ6j8fqJHb062NHalMfR78udF2EzGloJ6Gv4SxvIs7"}],"size":2540,"noattachment":false,"key":"/regexp-clone/-/regexp-clone-1.2.0.tgz"},"_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"directories":{},"maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regexp-clone_1.2.0_1755120468881_0.06163376346369276"},"_hasShrinkwrap":false,"readme":"# regexp-clone <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nZero dependency JavaScript/TypeScript `RegExp` cloner with flag and `lastIndex` preservation.\n\n## Usage\n\n```js\nconst clone = require('regexp-clone');\n\nconst a = /somethin/dgimsuy;\nconsole.log(a.global); // true\nconsole.log(a.ignoreCase); // true\nconsole.log(a.multiline); // true\nconsole.log(a.dotAll); // true\nconsole.log(a.unicode); // true\nconsole.log(a.sticky); // true\nconsole.log(a.hasIndices); // true\n\nconst b = clone(a);\nconsole.log(b.global); // true\nconsole.log(b.ignoreCase); // true\nconsole.log(b.multiline); // true\nconsole.log(b.dotAll); // true\nconsole.log(b.unicode); // true\nconsole.log(b.sticky); // true\nconsole.log(b.hasIndices); // true\n\nconst c = /hi/g;\nc.test('this string hi there');\nassert.strictEqual(c.lastIndex, 3);\n\nconst d = clone(c);\nassert.strictEqual(d.lastIndex, 3);\nd.test('this string hi there');\nassert.strictEqual(d.lastIndex, 14);\nassert.strictEqual(c.lastIndex, 3);\n```\n\n## Installation\n\n```bash\npnpm add regexp-clone\n```\n\n## Testing\n\n```bash\npnpm test\n```\n\n## License\n\n[MIT][license-url]\n\n[package-url]: https://npmjs.org/package/regexp-clone\n[npm-version-svg]: https://versionbadg.es/aheckmann/regexp-clone.svg\n[npm-badge-png]: https://nodei.co/npm/regexp-clone.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/regexp-clone.svg\n[license-url]: https://github.com/aheckmann/regexp-clone/blob/main/LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/regexp-clone.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=regexp-clone\n","publish_time":1755120469152,"_cnpm_publish_time":1755120469152,"dist-tags":{"latest":"1.2.0"}}