Files
react-native-devtools-frontend/node_modules/rollup-plugin-sourcemaps2/dist/source-map-resolve.cjs.map
T
Simon Zünd abf0cd1847 [deps] Update rollup to 4.24.3 (and update plugins)
Since we have the major version jump, we needed to update quite
a few things to make this work:

  1. rollup4 ships with native binaries. We can't check them into
     our node_modules for all platforms. Luckily they also ship a
     a wasm version. This requires us to adjust the 'binary' path
     to `node_modules/@rollup/wasm-node/dist/bin/rollup` instead.

  2. rollup4 is more strict when it comes to ES modules vs
     CommonJS. We adjust this by renaming the rollup config files.

  3. Some plugins got deprecated so we had to replace them with
     the newer versions (source maps and terser).

Bug: None
Change-Id: If13d590c8185db6ad85b3992d0a869111909dc8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5999255
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2024-11-07 05:25:54 +00:00

1 line
6.6 KiB
Plaintext

{"version":3,"file":"source-map-resolve.cjs","sources":["../src/source-map-resolve.ts"],"sourcesContent":["import * as urlLib from 'node:url';\nimport type { ExistingRawSourceMap } from 'rollup';\nimport decodeUriComponent from './decode-uri-component.js';\n\ninterface ResolvedSources {\n sourcesResolved: string[];\n sourcesContent: (string | Error)[];\n}\n\ninterface ResolvedSourceMap {\n map: ExistingRawSourceMap;\n url: string | null;\n sourcesRelativeTo: string;\n sourceMappingURL: string;\n}\n\nfunction resolveUrl(...args: string[]): string {\n return args.reduce((resolved, nextUrl) => urlLib.resolve(resolved, nextUrl), '');\n}\n\nfunction customDecodeUriComponent(encodedURI: string): string {\n return decodeUriComponent(encodedURI.replace(/\\+/g, '%2B'));\n}\n\nfunction parseMapToJSON(string: string): ExistingRawSourceMap {\n return <ExistingRawSourceMap>JSON.parse(string.replace(/^\\)\\]\\}'/, ''));\n}\n\nconst sourceMappingURLRegex =\n /(?:\\/\\*(?:\\s*\\r?\\n(?:\\/\\/)?)?(?:[#@] sourceMappingURL=([^\\s'\"]*))\\s*\\*\\/|\\/\\/(?:[#@] sourceMappingURL=([^\\s'\"]*)))\\s*/;\n\nfunction getSourceMappingUrl(code: string): string | null {\n const match = sourceMappingURLRegex.exec(code);\n return match ? match[1] || match[2] || '' : null;\n}\n\nexport async function resolveSourceMap(\n code: string,\n codeUrl: string,\n read: (path: string) => Promise<Buffer | string>,\n): Promise<ResolvedSourceMap | null> {\n const sourceMappingURL = getSourceMappingUrl(code);\n if (!sourceMappingURL) {\n return null;\n }\n const dataUri = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/.exec(sourceMappingURL);\n if (dataUri) {\n const mimeType = dataUri[1] || 'text/plain';\n if (!/^(?:application|text)\\/json$/.test(mimeType)) {\n throw new Error(`Unuseful data uri mime type: ${mimeType}`);\n }\n const map = parseMapToJSON(\n (dataUri[2] === ';base64' ? atob : decodeURIComponent)(dataUri[3] || ''),\n );\n return { sourceMappingURL, url: null, sourcesRelativeTo: codeUrl, map };\n }\n const url = resolveUrl(codeUrl, sourceMappingURL);\n const map = parseMapToJSON(String(await read(customDecodeUriComponent(url))));\n return { sourceMappingURL, url, sourcesRelativeTo: url, map };\n}\n\nexport async function resolveSources(\n map: ExistingRawSourceMap,\n mapUrl: string,\n read: (path: string) => Promise<Buffer | string>,\n): Promise<ResolvedSources> {\n const sourcesResolved: string[] = [];\n const sourcesContent: (string | Error)[] = [];\n for (let index = 0, len = map.sources.length; index < len; index++) {\n const sourceRoot = map.sourceRoot;\n const sourceContent = (map.sourcesContent || [])[index];\n const resolvePaths = [mapUrl, map.sources[index]];\n if (sourceRoot !== undefined && sourceRoot !== '') {\n resolvePaths.splice(1, 0, sourceRoot.replace(/\\/?$/, '/'));\n }\n sourcesResolved[index] = resolveUrl(...resolvePaths);\n if (typeof sourceContent === 'string') {\n sourcesContent[index] = sourceContent;\n continue;\n }\n try {\n const source = await read(customDecodeUriComponent(sourcesResolved[index]));\n sourcesContent[index] = String(source);\n } catch (error) {\n sourcesContent[index] = <Error>error;\n }\n }\n return { sourcesResolved, sourcesContent };\n}\n"],"names":["resolveUrl","args","reduce","resolved","nextUrl","urlLib","resolve","customDecodeUriComponent","encodedURI","decodeUriComponent","replace","parseMapToJSON","string","JSON","parse","sourceMappingURLRegex","getSourceMappingUrl","code","match","exec","resolveSourceMap","codeUrl","read","sourceMappingURL","dataUri","mimeType","test","Error","map","atob","decodeURIComponent","url","sourcesRelativeTo","String","resolveSources","mapUrl","sourcesResolved","sourcesContent","index","len","sources","length","sourceRoot","sourceContent","resolvePaths","undefined","splice","source","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAASA,UAAAA,CAAW,GAAGC,IAAc,EAAA;IACnC,OAAOA,IAAAA,CAAKC,MAAM,CAAC,CAACC,QAAAA,EAAUC,UAAYC,iBAAOC,CAAAA,OAAO,CAACH,QAAAA,EAAUC,OAAU,CAAA,EAAA,EAAA,CAAA,CAAA;AAC/E,CAAA;AAEA,SAASG,yBAAyBC,UAAkB,EAAA;AAClD,IAAA,OAAOC,kBAAmBD,CAAAA,UAAAA,CAAWE,OAAO,CAAC,KAAO,EAAA,KAAA,CAAA,CAAA,CAAA;AACtD,CAAA;AAEA,SAASC,eAAeC,MAAc,EAAA;AACpC,IAAA,OAA6BC,KAAKC,KAAK,CAACF,MAAOF,CAAAA,OAAO,CAAC,UAAY,EAAA,EAAA,CAAA,CAAA,CAAA;AACrE,CAAA;AAEA,MAAMK,qBACJ,GAAA,uHAAA,CAAA;AAEF,SAASC,oBAAoBC,IAAY,EAAA;IACvC,MAAMC,KAAAA,GAAQH,qBAAsBI,CAAAA,IAAI,CAACF,IAAAA,CAAAA,CAAAA;IACzC,OAAOC,KAAAA,GAAQA,KAAK,CAAC,CAAA,CAAE,IAAIA,KAAK,CAAC,CAAE,CAAA,IAAI,EAAK,GAAA,IAAA,CAAA;AAC9C,CAAA;AAEO,eAAeE,gBACpBH,CAAAA,IAAY,EACZI,OAAe,EACfC,IAAgD,EAAA;AAEhD,IAAA,MAAMC,mBAAmBP,mBAAoBC,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