{
  "manifest": {
    "name": "@jridgewell/gen-mapping",
    "version": "0.3.5",
    "description": "Generate source maps",
    "keywords": [
      "source",
      "map"
    ],
    "author": {
      "name": "Justin Ridgewell",
      "email": "justin@ridgewell.name"
    },
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/jridgewell/gen-mapping"
    },
    "main": "dist/gen-mapping.umd.js",
    "module": "dist/gen-mapping.mjs",
    "types": "dist/types/gen-mapping.d.ts",
    "exports": {
      ".": [
        {
          "types": "./dist/types/gen-mapping.d.ts",
          "browser": "./dist/gen-mapping.umd.js",
          "require": "./dist/gen-mapping.umd.js",
          "import": "./dist/gen-mapping.mjs"
        },
        "./dist/gen-mapping.umd.js"
      ],
      "./package.json": "./package.json"
    },
    "files": [
      "dist"
    ],
    "engines": {
      "node": ">=6.0.0"
    },
    "scripts": {
      "benchmark": "run-s build:rollup benchmark:*",
      "benchmark:install": "cd benchmark && npm install",
      "benchmark:only": "node benchmark/index.mjs",
      "prebuild": "rm -rf dist",
      "build": "run-s -n build:*",
      "build:rollup": "rollup -c rollup.config.js",
      "build:ts": "tsc --project tsconfig.build.json",
      "lint": "run-s -n lint:*",
      "lint:prettier": "npm run test:lint:prettier -- --write",
      "lint:ts": "npm run test:lint:ts -- --fix",
      "test": "run-s -n test:lint test:only",
      "test:debug": "mocha --inspect-brk",
      "test:lint": "run-s -n test:lint:*",
      "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
      "test:lint:ts": "eslint '{src,test}/**/*.ts'",
      "test:only": "c8 mocha",
      "test:watch": "mocha --watch",
      "prepublishOnly": "npm run preversion",
      "preversion": "run-s test build"
    },
    "devDependencies": {
      "@rollup/plugin-typescript": "8.3.2",
      "@types/mocha": "9.1.1",
      "@types/node": "17.0.29",
      "@typescript-eslint/eslint-plugin": "5.21.0",
      "@typescript-eslint/parser": "5.21.0",
      "benchmark": "2.1.4",
      "c8": "7.11.2",
      "eslint": "8.14.0",
      "eslint-config-prettier": "8.5.0",
      "mocha": "9.2.2",
      "npm-run-all": "4.1.5",
      "prettier": "2.6.2",
      "rollup": "2.70.2",
      "tsx": "4.7.1",
      "typescript": "4.6.3"
    },
    "dependencies": {
      "@jridgewell/set-array": "^1.2.1",
      "@jridgewell/sourcemap-codec": "^1.4.10",
      "@jridgewell/trace-mapping": "^0.3.24"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-@jridgewell-gen-mapping-0.3.5-dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36-integrity/node_modules/@jridgewell/gen-mapping/package.json",
    "readmeFilename": "README.md",
    "readme": "# @jridgewell/gen-mapping\n\n> Generate source maps\n\n`gen-mapping` allows you to generate a source map during transpilation or minification.\nWith a source map, you're able to trace the original location in the source file, either in Chrome's\nDevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping].\n\nYou may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This\nprovides the same `addMapping` and `setSourceContent` API.\n\n## Installation\n\n```sh\nnpm install @jridgewell/gen-mapping\n```\n\n## Usage\n\n```typescript\nimport { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping';\n\nconst map = new GenMapping({\n  file: 'output.js',\n  sourceRoot: 'https://example.com/',\n});\n\nsetSourceContent(map, 'input.js', `function foo() {}`);\n\naddMapping(map, {\n  // Lines start at line 1, columns at column 0.\n  generated: { line: 1, column: 0 },\n  source: 'input.js',\n  original: { line: 1, column: 0 },\n});\n\naddMapping(map, {\n  generated: { line: 1, column: 9 },\n  source: 'input.js',\n  original: { line: 1, column: 9 },\n  name: 'foo',\n});\n\nassert.deepEqual(toDecodedMap(map), {\n  version: 3,\n  file: 'output.js',\n  names: ['foo'],\n  sourceRoot: 'https://example.com/',\n  sources: ['input.js'],\n  sourcesContent: ['function foo() {}'],\n  mappings: [\n    [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ]\n  ],\n});\n\nassert.deepEqual(toEncodedMap(map), {\n  version: 3,\n  file: 'output.js',\n  names: ['foo'],\n  sourceRoot: 'https://example.com/',\n  sources: ['input.js'],\n  sourcesContent: ['function foo() {}'],\n  mappings: 'AAAA,SAASA',\n});\n```\n\n### Smaller Sourcemaps\n\nNot everything needs to be added to a sourcemap, and needless markings can cause signficantly\nlarger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will\nintelligently determine if this marking adds useful information. If not, the marking will be\nskipped.\n\n```typescript\nimport { maybeAddMapping } from '@jridgewell/gen-mapping';\n\nconst map = new GenMapping();\n\n// Adding a sourceless marking at the beginning of a line isn't useful.\nmaybeAddMapping(map, {\n  generated: { line: 1, column: 0 },\n});\n\n// Adding a new source marking is useful.\nmaybeAddMapping(map, {\n  generated: { line: 1, column: 0 },\n  source: 'input.js',\n  original: { line: 1, column: 0 },\n});\n\n// But adding another marking pointing to the exact same original location isn't, even if the\n// generated column changed.\nmaybeAddMapping(map, {\n  generated: { line: 1, column: 9 },\n  source: 'input.js',\n  original: { line: 1, column: 0 },\n});\n\nassert.deepEqual(toEncodedMap(map), {\n  version: 3,\n  names: [],\n  sources: ['input.js'],\n  sourcesContent: [null],\n  mappings: 'AAAA',\n});\n```\n\n## Benchmarks\n\n```\nnode v18.0.0\n\namp.js.map\nMemory Usage:\ngen-mapping: addSegment      5852872 bytes\ngen-mapping: addMapping      7716042 bytes\nsource-map-js                6143250 bytes\nsource-map-0.6.1             6124102 bytes\nsource-map-0.8.0             6121173 bytes\nSmallest memory usage is gen-mapping: addSegment\n\nAdding speed:\ngen-mapping:      addSegment x 441 ops/sec ±2.07% (90 runs sampled)\ngen-mapping:      addMapping x 350 ops/sec ±2.40% (86 runs sampled)\nsource-map-js:    addMapping x 169 ops/sec ±2.42% (80 runs sampled)\nsource-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled)\nsource-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled)\nFastest is gen-mapping:      addSegment\n\nGenerate speed:\ngen-mapping:      decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled)\ngen-mapping:      encoded output x 663 ops/sec ±0.22% (98 runs sampled)\nsource-map-js:    encoded output x 197 ops/sec ±0.45% (84 runs sampled)\nsource-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled)\nsource-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled)\nFastest is gen-mapping:      decoded output\n\n\n***\n\n\nbabel.min.js.map\nMemory Usage:\ngen-mapping: addSegment     37578063 bytes\ngen-mapping: addMapping     37212897 bytes\nsource-map-js               47638527 bytes\nsource-map-0.6.1            47690503 bytes\nsource-map-0.8.0            47470188 bytes\nSmallest memory usage is gen-mapping: addMapping\n\nAdding speed:\ngen-mapping:      addSegment x 31.05 ops/sec ±8.31% (43 runs sampled)\ngen-mapping:      addMapping x 29.83 ops/sec ±7.36% (51 runs sampled)\nsource-map-js:    addMapping x 20.73 ops/sec ±6.22% (38 runs sampled)\nsource-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled)\nsource-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled)\nFastest is gen-mapping:      addSegment\n\nGenerate speed:\ngen-mapping:      decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled)\ngen-mapping:      encoded output x 95.15 ops/sec ±2.98% (72 runs sampled)\nsource-map-js:    encoded output x 15.20 ops/sec ±7.41% (33 runs sampled)\nsource-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled)\nsource-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled)\nFastest is gen-mapping:      decoded output\n\n\n***\n\n\npreact.js.map\nMemory Usage:\ngen-mapping: addSegment       416247 bytes\ngen-mapping: addMapping       419824 bytes\nsource-map-js                1024619 bytes\nsource-map-0.6.1             1146004 bytes\nsource-map-0.8.0             1113250 bytes\nSmallest memory usage is gen-mapping: addSegment\n\nAdding speed:\ngen-mapping:      addSegment x 13,755 ops/sec ±0.15% (98 runs sampled)\ngen-mapping:      addMapping x 13,013 ops/sec ±0.11% (101 runs sampled)\nsource-map-js:    addMapping x 4,564 ops/sec ±0.21% (98 runs sampled)\nsource-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled)\nsource-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled)\nFastest is gen-mapping:      addSegment\n\nGenerate speed:\ngen-mapping:      decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled)\ngen-mapping:      encoded output x 14,368 ops/sec ±4.07% (82 runs sampled)\nsource-map-js:    encoded output x 5,261 ops/sec ±0.21% (99 runs sampled)\nsource-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled)\nsource-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled)\nFastest is gen-mapping:      decoded output\n\n\n***\n\n\nreact.js.map\nMemory Usage:\ngen-mapping: addSegment       975096 bytes\ngen-mapping: addMapping      1102981 bytes\nsource-map-js                2918836 bytes\nsource-map-0.6.1             2885435 bytes\nsource-map-0.8.0             2874336 bytes\nSmallest memory usage is gen-mapping: addSegment\n\nAdding speed:\ngen-mapping:      addSegment x 4,772 ops/sec ±0.15% (100 runs sampled)\ngen-mapping:      addMapping x 4,456 ops/sec ±0.13% (97 runs sampled)\nsource-map-js:    addMapping x 1,618 ops/sec ±0.24% (97 runs sampled)\nsource-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled)\nsource-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled)\nFastest is gen-mapping:      addSegment\n\nGenerate speed:\ngen-mapping:      decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled)\ngen-mapping:      encoded output x 5,421 ops/sec ±1.60% (89 runs sampled)\nsource-map-js:    encoded output x 2,113 ops/sec ±1.81% (98 runs sampled)\nsource-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled)\nsource-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled)\nFastest is gen-mapping:      decoded output\n```\n\n[source-map]: https://www.npmjs.com/package/source-map\n[trace-mapping]: https://github.com/jridgewell/trace-mapping\n",
    "licenseText": "Copyright 2022 Justin Ridgewell <jridgewell@google.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
    "hash": "dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36",
    "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
    "registry": "npm",
    "packageName": "@jridgewell/gen-mapping",
    "cacheIntegrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== sha1-3M5q/3S99trRqVgCtpsEovyx+zY="
  },
  "registry": "npm",
  "hash": "dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36"
}