{
  "manifest": {
    "name": "@jridgewell/trace-mapping",
    "version": "0.3.25",
    "description": "Trace the original position through a source map",
    "keywords": [
      "source",
      "map"
    ],
    "main": "dist/trace-mapping.umd.js",
    "module": "dist/trace-mapping.mjs",
    "types": "dist/types/trace-mapping.d.ts",
    "files": [
      "dist"
    ],
    "exports": {
      ".": [
        {
          "types": "./dist/types/trace-mapping.d.ts",
          "browser": "./dist/trace-mapping.umd.js",
          "require": "./dist/trace-mapping.umd.js",
          "import": "./dist/trace-mapping.mjs"
        },
        "./dist/trace-mapping.umd.js"
      ],
      "./package.json": "./package.json"
    },
    "author": {
      "name": "Justin Ridgewell",
      "email": "justin@ridgewell.name"
    },
    "repository": {
      "type": "git",
      "url": "git+https://github.com/jridgewell/trace-mapping.git"
    },
    "license": "MIT",
    "scripts": {
      "benchmark": "run-s build:rollup benchmark:*",
      "benchmark:install": "cd benchmark && npm install",
      "benchmark:only": "node --expose-gc benchmark/index.mjs",
      "build": "run-s -n build:*",
      "build:rollup": "rollup -c rollup.config.mjs",
      "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",
      "prebuild": "rm -rf dist",
      "prepublishOnly": "npm run preversion",
      "preversion": "run-s test build",
      "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' '**/*.md'",
      "test:lint:ts": "eslint '{src,test}/**/*.ts'",
      "test:only": "c8 mocha",
      "test:watch": "mocha --watch"
    },
    "devDependencies": {
      "@rollup/plugin-typescript": "11.1.6",
      "@types/mocha": "10.0.6",
      "@types/node": "20.11.20",
      "@typescript-eslint/eslint-plugin": "6.18.1",
      "@typescript-eslint/parser": "6.18.1",
      "benchmark": "2.1.4",
      "c8": "9.0.0",
      "esbuild": "0.19.11",
      "eslint": "8.56.0",
      "eslint-config-prettier": "9.1.0",
      "eslint-plugin-no-only-tests": "3.1.0",
      "mocha": "10.3.0",
      "npm-run-all": "4.1.5",
      "prettier": "3.1.1",
      "rollup": "4.9.4",
      "tsx": "4.7.0",
      "typescript": "5.3.3"
    },
    "dependencies": {
      "@jridgewell/resolve-uri": "^3.1.0",
      "@jridgewell/sourcemap-codec": "^1.4.14"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-@jridgewell-trace-mapping-0.3.25-15f190e98895f3fc23276ee14bc76b675c2e50f0-integrity/node_modules/@jridgewell/trace-mapping/package.json",
    "readmeFilename": "README.md",
    "readme": "# @jridgewell/trace-mapping\n\n> Trace the original position through a source map\n\n`trace-mapping` allows you to take the line and column of an output file and trace it to the\noriginal location in the source file through a source map.\n\nYou may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This\nprovides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM.\n\n## Installation\n\n```sh\nnpm install @jridgewell/trace-mapping\n```\n\n## Usage\n\n```typescript\nimport {\n  TraceMap,\n  originalPositionFor,\n  generatedPositionFor,\n  sourceContentFor,\n  isIgnored,\n} from '@jridgewell/trace-mapping';\n\nconst tracer = new TraceMap({\n  version: 3,\n  sources: ['input.js'],\n  sourcesContent: ['content of input.js'],\n  names: ['foo'],\n  mappings: 'KAyCIA',\n  ignoreList: [],\n});\n\n// Lines start at line 1, columns at column 0.\nconst traced = originalPositionFor(tracer, { line: 1, column: 5 });\nassert.deepEqual(traced, {\n  source: 'input.js',\n  line: 42,\n  column: 4,\n  name: 'foo',\n});\n\nconst content = sourceContentFor(tracer, traced.source);\nassert.strictEqual(content, 'content for input.js');\n\nconst generated = generatedPositionFor(tracer, {\n  source: 'input.js',\n  line: 42,\n  column: 4,\n});\nassert.deepEqual(generated, {\n  line: 1,\n  column: 5,\n});\n\nconst ignored = isIgnored(tracer, 'input.js');\nassert.equal(ignored, false);\n```\n\nWe also provide a lower level API to get the actual segment that matches our line and column. Unlike\n`originalPositionFor`, `traceSegment` uses a 0-base for `line`:\n\n```typescript\nimport { traceSegment } from '@jridgewell/trace-mapping';\n\n// line is 0-base.\nconst traced = traceSegment(tracer, /* line */ 0, /* column */ 5);\n\n// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n// Again, line is 0-base and so is sourceLine\nassert.deepEqual(traced, [5, 0, 41, 4, 0]);\n```\n\n### SectionedSourceMaps\n\nThe sourcemap spec defines a special `sections` field that's designed to handle concatenation of\noutput code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool\nproduces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap`\nhelper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a\n`TraceMap` instance:\n\n```typescript\nimport { AnyMap } from '@jridgewell/trace-mapping';\nconst fooOutput = 'foo';\nconst barOutput = 'bar';\nconst output = [fooOutput, barOutput].join('\\n');\n\nconst sectioned = new AnyMap({\n  version: 3,\n  sections: [\n    {\n      // 0-base line and column\n      offset: { line: 0, column: 0 },\n      // fooOutput's sourcemap\n      map: {\n        version: 3,\n        sources: ['foo.js'],\n        names: ['foo'],\n        mappings: 'AAAAA',\n      },\n    },\n    {\n      // barOutput's sourcemap will not affect the first line, only the second\n      offset: { line: 1, column: 0 },\n      map: {\n        version: 3,\n        sources: ['bar.js'],\n        names: ['bar'],\n        mappings: 'AAAAA',\n      },\n    },\n  ],\n});\n\nconst traced = originalPositionFor(sectioned, {\n  line: 2,\n  column: 0,\n});\n\nassert.deepEqual(traced, {\n  source: 'bar.js',\n  line: 1,\n  column: 0,\n  name: 'bar',\n});\n```\n\n## Benchmarks\n\n```\nnode v18.0.0\n\namp.js.map - 45120 segments\n\nMemory Usage:\ntrace-mapping decoded         562400 bytes\ntrace-mapping encoded        5706544 bytes\nsource-map-js               10717664 bytes\nsource-map-0.6.1            17446384 bytes\nsource-map-0.8.0             9701757 bytes\nSmallest memory usage is trace-mapping decoded\n\nInit speed:\ntrace-mapping:    decoded JSON input x 180 ops/sec ±0.34% (85 runs sampled)\ntrace-mapping:    encoded JSON input x 364 ops/sec ±1.77% (89 runs sampled)\ntrace-mapping:    decoded Object input x 3,116 ops/sec ±0.50% (96 runs sampled)\ntrace-mapping:    encoded Object input x 410 ops/sec ±2.62% (85 runs sampled)\nsource-map-js:    encoded Object input x 84.23 ops/sec ±0.91% (73 runs sampled)\nsource-map-0.6.1: encoded Object input x 37.21 ops/sec ±2.08% (51 runs sampled)\nFastest is trace-mapping:    decoded Object input\n\nTrace speed:\ntrace-mapping:    decoded originalPositionFor x 3,952,212 ops/sec ±0.17% (98 runs sampled)\ntrace-mapping:    encoded originalPositionFor x 3,487,468 ops/sec ±1.58% (90 runs sampled)\nsource-map-js:    encoded originalPositionFor x 827,730 ops/sec ±0.78% (97 runs sampled)\nsource-map-0.6.1: encoded originalPositionFor x 748,991 ops/sec ±0.53% (94 runs sampled)\nsource-map-0.8.0: encoded originalPositionFor x 2,532,894 ops/sec ±0.57% (95 runs sampled)\nFastest is trace-mapping:    decoded originalPositionFor\n\n\n***\n\n\nbabel.min.js.map - 347793 segments\n\nMemory Usage:\ntrace-mapping decoded          89832 bytes\ntrace-mapping encoded       35474640 bytes\nsource-map-js               51257176 bytes\nsource-map-0.6.1            63515664 bytes\nsource-map-0.8.0            42933752 bytes\nSmallest memory usage is trace-mapping decoded\n\nInit speed:\ntrace-mapping:    decoded JSON input x 15.41 ops/sec ±8.65% (34 runs sampled)\ntrace-mapping:    encoded JSON input x 28.20 ops/sec ±12.87% (42 runs sampled)\ntrace-mapping:    decoded Object input x 964 ops/sec ±0.36% (99 runs sampled)\ntrace-mapping:    encoded Object input x 31.77 ops/sec ±13.79% (45 runs sampled)\nsource-map-js:    encoded Object input x 6.45 ops/sec ±5.16% (21 runs sampled)\nsource-map-0.6.1: encoded Object input x 4.07 ops/sec ±5.24% (15 runs sampled)\nFastest is trace-mapping:    decoded Object input\n\nTrace speed:\ntrace-mapping:    decoded originalPositionFor x 7,183,038 ops/sec ±0.58% (95 runs sampled)\ntrace-mapping:    encoded originalPositionFor x 5,192,185 ops/sec ±0.41% (100 runs sampled)\nsource-map-js:    encoded originalPositionFor x 4,259,489 ops/sec ±0.79% (94 runs sampled)\nsource-map-0.6.1: encoded originalPositionFor x 3,742,629 ops/sec ±0.71% (95 runs sampled)\nsource-map-0.8.0: encoded originalPositionFor x 6,270,211 ops/sec ±0.64% (94 runs sampled)\nFastest is trace-mapping:    decoded originalPositionFor\n\n\n***\n\n\npreact.js.map - 1992 segments\n\nMemory Usage:\ntrace-mapping decoded          37128 bytes\ntrace-mapping encoded         247280 bytes\nsource-map-js                1143536 bytes\nsource-map-0.6.1             1290992 bytes\nsource-map-0.8.0               96544 bytes\nSmallest memory usage is trace-mapping decoded\n\nInit speed:\ntrace-mapping:    decoded JSON input x 3,483 ops/sec ±0.30% (98 runs sampled)\ntrace-mapping:    encoded JSON input x 6,092 ops/sec ±0.18% (97 runs sampled)\ntrace-mapping:    decoded Object input x 249,076 ops/sec ±0.24% (98 runs sampled)\ntrace-mapping:    encoded Object input x 14,555 ops/sec ±0.48% (100 runs sampled)\nsource-map-js:    encoded Object input x 2,447 ops/sec ±0.36% (99 runs sampled)\nsource-map-0.6.1: encoded Object input x 1,201 ops/sec ±0.57% (96 runs sampled)\nFastest is trace-mapping:    decoded Object input\n\nTrace speed:\ntrace-mapping:    decoded originalPositionFor x 7,620,192 ops/sec ±0.09% (99 runs sampled)\ntrace-mapping:    encoded originalPositionFor x 6,872,554 ops/sec ±0.30% (97 runs sampled)\nsource-map-js:    encoded originalPositionFor x 2,489,570 ops/sec ±0.35% (94 runs sampled)\nsource-map-0.6.1: encoded originalPositionFor x 1,698,633 ops/sec ±0.28% (98 runs sampled)\nsource-map-0.8.0: encoded originalPositionFor x 4,015,644 ops/sec ±0.22% (98 runs sampled)\nFastest is trace-mapping:    decoded originalPositionFor\n\n\n***\n\n\nreact.js.map - 5726 segments\n\nMemory Usage:\ntrace-mapping decoded          16176 bytes\ntrace-mapping encoded         681552 bytes\nsource-map-js                2418352 bytes\nsource-map-0.6.1             2443672 bytes\nsource-map-0.8.0              111768 bytes\nSmallest memory usage is trace-mapping decoded\n\nInit speed:\ntrace-mapping:    decoded JSON input x 1,720 ops/sec ±0.34% (98 runs sampled)\ntrace-mapping:    encoded JSON input x 4,406 ops/sec ±0.35% (100 runs sampled)\ntrace-mapping:    decoded Object input x 92,122 ops/sec ±0.10% (99 runs sampled)\ntrace-mapping:    encoded Object input x 5,385 ops/sec ±0.37% (99 runs sampled)\nsource-map-js:    encoded Object input x 794 ops/sec ±0.40% (98 runs sampled)\nsource-map-0.6.1: encoded Object input x 416 ops/sec ±0.54% (91 runs sampled)\nFastest is trace-mapping:    decoded Object input\n\nTrace speed:\ntrace-mapping:    decoded originalPositionFor x 32,759,519 ops/sec ±0.33% (100 runs sampled)\ntrace-mapping:    encoded originalPositionFor x 31,116,306 ops/sec ±0.33% (97 runs sampled)\nsource-map-js:    encoded originalPositionFor x 17,458,435 ops/sec ±0.44% (97 runs sampled)\nsource-map-0.6.1: encoded originalPositionFor x 12,687,097 ops/sec ±0.43% (95 runs sampled)\nsource-map-0.8.0: encoded originalPositionFor x 23,538,275 ops/sec ±0.38% (95 runs sampled)\nFastest is trace-mapping:    decoded originalPositionFor\n```\n\n[source-map]: https://www.npmjs.com/package/source-map\n",
    "licenseText": "Copyright 2022 Justin Ridgewell <justin@ridgewell.name>\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/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
    "hash": "15f190e98895f3fc23276ee14bc76b675c2e50f0",
    "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
    "registry": "npm",
    "packageName": "@jridgewell/trace-mapping",
    "cacheIntegrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== sha1-FfGQ6YiV8/wjJ27hS8drZ1wuUPA="
  },
  "registry": "npm",
  "hash": "15f190e98895f3fc23276ee14bc76b675c2e50f0"
}