{
  "manifest": {
    "name": "regexpu-core",
    "version": "5.3.2",
    "description": "regexpu’s core functionality (i.e. `rewritePattern(pattern, flag)`), capable of translating ES6 Unicode regular expressions to ES5.",
    "homepage": "https://mths.be/regexpu",
    "main": "rewrite-pattern.js",
    "engines": {
      "node": ">=4"
    },
    "keywords": [
      "codegen",
      "desugaring",
      "ecmascript",
      "es5",
      "es6",
      "harmony",
      "javascript",
      "refactoring",
      "regex",
      "regexp",
      "regular expressions",
      "rewriting",
      "syntax",
      "transformation",
      "transpile",
      "transpiler",
      "unicode"
    ],
    "license": "MIT",
    "author": {
      "name": "Mathias Bynens",
      "url": "https://mathiasbynens.be/"
    },
    "repository": {
      "type": "git",
      "url": "https://github.com/mathiasbynens/regexpu-core.git"
    },
    "bugs": {
      "url": "https://github.com/mathiasbynens/regexpu-core/issues"
    },
    "files": [
      "LICENSE-MIT.txt",
      "rewrite-pattern.js",
      "data/character-class-escape-sets.js",
      "data/iu-mappings.js"
    ],
    "scripts": {
      "build": "node scripts/iu-mappings.js && node scripts/character-class-escape-sets.js",
      "test": "mocha tests",
      "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec"
    },
    "dependencies": {
      "regenerate": "^1.4.2",
      "regenerate-unicode-properties": "^10.1.0",
      "@babel/regjsgen": "^0.8.0",
      "regjsparser": "^0.9.1",
      "unicode-match-property-ecmascript": "^2.0.0",
      "unicode-match-property-value-ecmascript": "^2.1.0"
    },
    "devDependencies": {
      "codecov": "^3.8.3",
      "istanbul": "^0.4.5",
      "jsesc": "^3.0.2",
      "lodash": "^4.17.21",
      "mocha": "^10.1.0",
      "regexpu-fixtures": "^2.1.6",
      "@unicode/unicode-15.0.0": "^1.3.1"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-regexpu-core-5.3.2-11a2b06884f3527aec3e93dbbf4a3b958a95546b-integrity/node_modules/regexpu-core/package.json",
    "readmeFilename": "README.md",
    "readme": "# regexpu-core [![Build status](https://github.com/mathiasbynens/regexpu-core/workflows/run-checks/badge.svg)](https://github.com/mathiasbynens/regexpu-core/actions?query=workflow%3Arun-checks) [![regexpu-core on npm](https://img.shields.io/npm/v/regexpu-core)](https://www.npmjs.com/package/regexpu-core)\n\n_regexpu_ is a source code transpiler that enables the use of ES2015 Unicode regular expressions in JavaScript-of-today (ES5).\n\n_regexpu-core_ contains _regexpu_’s core functionality, i.e. `rewritePattern(pattern, flag)`, which enables rewriting regular expressions that make use of [the ES2015 `u` flag](https://mathiasbynens.be/notes/es6-unicode-regex) into equivalent ES5-compatible regular expression patterns.\n\n## Installation\n\nTo use _regexpu-core_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/):\n\n```bash\nnpm install regexpu-core --save\n```\n\nThen, `require` it:\n\n```js\nconst rewritePattern = require('regexpu-core');\n```\n\n## API\n\nThis module exports a single function named `rewritePattern`.\n\n### `rewritePattern(pattern, flags, options)`\n\nThis function takes a string that represents a regular expression pattern as well as a string representing its flags, and returns an ES5-compatible version of the pattern.\n\n```js\nrewritePattern('foo.bar', 'u');\n// → 'foo(?:[\\\\0-\\\\t\\\\x0B\\\\f\\\\x0E-\\\\u2027\\\\u202A-\\\\uD7FF\\\\uDC00-\\\\uFFFF]|[\\\\uD800-\\\\uDBFF][\\\\uDC00-\\\\uDFFF]|[\\\\uD800-\\\\uDBFF])bar'\n\nrewritePattern('[\\\\u{1D306}-\\\\u{1D308}a-z]', 'u');\n// → '(?:[a-z]|\\\\uD834[\\\\uDF06-\\\\uDF08])'\n\nrewritePattern('[\\\\u{1D306}-\\\\u{1D308}a-z]', 'ui');\n// → '(?:[a-z\\\\u017F\\\\u212A]|\\\\uD834[\\\\uDF06-\\\\uDF08])'\n```\n\n_regexpu-core_ can rewrite non-ES6 regular expressions too, which is useful to demonstrate how their behavior changes once the `u` and `i` flags are added:\n\n```js\n// In ES5, the dot operator only matches BMP symbols:\nrewritePattern('foo.bar');\n// → 'foo(?:[\\\\0-\\\\t\\\\x0B\\\\f\\\\x0E-\\\\u2027\\\\u202A-\\\\uFFFF])bar'\n\n// But with the ES2015 `u` flag, it matches astral symbols too:\nrewritePattern('foo.bar', 'u');\n// → 'foo(?:[\\\\0-\\\\t\\\\x0B\\\\f\\\\x0E-\\\\u2027\\\\u202A-\\\\uD7FF\\\\uDC00-\\\\uFFFF]|[\\\\uD800-\\\\uDBFF][\\\\uDC00-\\\\uDFFF]|[\\\\uD800-\\\\uDBFF])bar'\n```\n\nThe optional `options` argument recognizes the following properties:\n\n#### Stable regular expression features\n\nThese options can be set to `false` or `'transform'`. When using `'transform'`, the corresponding features are compiled to older syntax that can run in older browsers. When using `false` (the default), they are not compiled and they can be relied upon to compile more modern features.\n\n- `unicodeFlag` - The `u` flag, enabling support for Unicode code point escapes in the form `\\u{...}`.\n\n  ```js\n  rewritePattern('\\\\u{ab}', '', {\n    unicodeFlag: 'transform'\n  });\n  // → '\\\\u{ab}'\n\n  rewritePattern('\\\\u{ab}', 'u', {\n    unicodeFlag: 'transform'\n  });\n  // → '\\\\xAB'\n  ```\n\n- `dotAllFlag` - The [`s` (`dotAll`) flag](https://github.com/mathiasbynens/es-regexp-dotall-flag).\n\n  ```js\n  rewritePattern('.', '', {\n    dotAllFlag: 'transform'\n  });\n  // → '[\\\\0-\\\\t\\\\x0B\\\\f\\\\x0E-\\\\u2027\\\\u202A-\\\\uFFFF]'\n\n  rewritePattern('.', 's', {\n    dotAllFlag: 'transform'\n  });\n  // → '[\\\\0-\\\\uFFFF]'\n\n  rewritePattern('.', 'su', {\n    dotAllFlag: 'transform'\n  });\n  // → '(?:[\\\\0-\\\\uD7FF\\\\uE000-\\\\uFFFF]|[\\\\uD800-\\\\uDBFF][\\\\uDC00-\\\\uDFFF]|[\\\\uD800-\\\\uDBFF](?![\\\\uDC00-\\\\uDFFF])|(?:[^\\\\uD800-\\\\uDBFF]|^)[\\\\uDC00-\\\\uDFFF])'\n  ```\n\n- `unicodePropertyEscapes` - [Unicode property escapes](property-escapes.md).\n\n  By default they are compiled to Unicode code point escapes of the form `\\u{...}`. If the `unicodeFlag` option is set to `'transform'` they often result in larger output, although there are cases (such as `\\p{Lu}`) where it actually _decreases_ the output size.\n\n  ```js\n  rewritePattern('\\\\p{Script_Extensions=Anatolian_Hieroglyphs}', 'u', {\n    unicodePropertyEscapes: 'transform'\n  });\n  // → '[\\\\u{14400}-\\\\u{14646}]'\n\n  rewritePattern('\\\\p{Script_Extensions=Anatolian_Hieroglyphs}', 'u', {\n    unicodeFlag: 'transform',\n    unicodePropertyEscapes: 'transform'\n  });\n  // → '(?:\\\\uD811[\\\\uDC00-\\\\uDE46])'\n  ```\n\n- `namedGroups` - [Named capture groups](https://github.com/tc39/proposal-regexp-named-groups).\n\n  ```js\n  rewritePattern('(?<name>.)\\\\k<name>', '', {\n    namedGroups: 'transform'\n  });\n  // → '(.)\\1'\n  ```\n\n#### Experimental regular expression features\n\nThese options can be set to `false`, `'parse'` and `'transform'`. When using `'transform'`, the corresponding features are compiled to older syntax that can run in older browsers. When using `'parse'`, they are parsed and left as-is in the output pattern. When using `false` (the default), they result in a syntax error if used.\n\nOnce these features become stable (when the proposals are accepted as part of ECMAScript), they will be parsed by default and thus `'parse'` will behave like `false`.\n\n- `unicodeSetsFlag` - [The `v` (`unicodeSets`) flag](https://github.com/tc39/proposal-regexp-set-notation)\n\n  ```js\n  rewritePattern('[\\\\p{Emoji}&&\\\\p{ASCII}]', 'u', {\n    unicodeSetsFlag: 'transform'\n  });\n  // → '[#\\*0-9]'\n  ```\n\n  By default, patterns with the `v` flag are transformed to patterns with the `u` flag. If you want to downlevel them more you can set the `unicodeFlag: 'transform'` option.\n\n  ```js\n  rewritePattern('[^[a-h]&&[f-z]]', 'v', {\n    unicodeSetsFlag: 'transform'\n  });\n  // → '[^f-h]' (to be used with /u)\n  ```\n\n  ```js\n  rewritePattern('[^[a-h]&&[f-z]]', 'v', {\n    unicodeSetsFlag: 'transform',\n    unicodeFlag: 'transform'\n  });\n  // → '(?:(?![f-h])[\\s\\S])' (to be used without /u)\n  ```\n\n- `modifiers` - [Inline `m`/`s`/`i` modifiers](https://github.com/tc39/proposal-regexp-modifiers)\n\n  ```js\n  rewritePattern('(?i:[a-z])[a-z]', '', {\n    modifiers: 'transform'\n  });\n  // → '(?:[a-zA-Z])([a-z])'\n  ```\n\n#### Miscellaneous options\n\n- `onNamedGroup`\n\n  This option is a function that gets called when a named capture group is found. It receives two parameters:\n  the name of the group, and its index.\n\n  ```js\n  rewritePattern('(?<name>.)\\\\k<name>', '', {\n    onNamedGroup(name, index) {\n      console.log(name, index);\n      // → 'name', 1\n    }\n  });\n  ```\n\n- `onNewFlags`\n\n  This option is a function that gets called to pass the flags that the resulting pattern must be interpreted with.\n\n  ```js\n  rewritePattern('abc', 'um', '', {\n    unicodeFlag: 'transform',\n    onNewFlags(flags) {\n      console.log(flags);\n      // → 'm'\n    }\n  })\n  ```\n\n### Caveats\n\n- [Lookbehind assertions](https://github.com/tc39/proposal-regexp-lookbehind) cannot be transformed to older syntax.\n- When using `namedGroups: 'transform'`, _regexpu-core_ only takes care of the _syntax_: you will still need a runtime wrapper around the regular expression to populate the `.groups` property of `RegExp.prototype.match()`'s result. If you are using _regexpu-core_ via Babel, it's handled automatically.\n\n## For maintainers\n\n### How to publish a new release\n\n1. On the `main` branch, bump the version number in `package.json`:\n\n    ```sh\n    npm version patch -m 'Release v%s'\n    ```\n\n    Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).\n\n    Note that this produces a Git commit + tag.\n\n1. Push the release commit and tag:\n\n    ```sh\n    git push --follow-tags\n    ```\n\n    Our CI then automatically publishes the new release to npm.\n\n1. Once the release has been published to npm, update [`regexpu`](https://github.com/mathiasbynens/regexpu) to make use of it, and [cut a new release of `regexpu` as well](https://github.com/mathiasbynens/regexpu#how-to-publish-a-new-release).\n\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## License\n\n_regexpu-core_ is available under the [MIT](https://mths.be/mit) license.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz",
    "hash": "11a2b06884f3527aec3e93dbbf4a3b958a95546b",
    "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==",
    "registry": "npm",
    "packageName": "regexpu-core",
    "cacheIntegrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== sha1-EaKwaITzUnrsPpPbv0o7lYqVVGs="
  },
  "registry": "npm",
  "hash": "11a2b06884f3527aec3e93dbbf4a3b958a95546b"
}