( mapBefore: ExistingRawSourceMap | undefined, root: string, )
| 3101 | } |
| 3102 | |
| 3103 | function formatStylusSourceMap( |
| 3104 | mapBefore: ExistingRawSourceMap | undefined, |
| 3105 | root: string, |
| 3106 | ): ExistingRawSourceMap | undefined { |
| 3107 | if (!mapBefore) return undefined |
| 3108 | const map = { ...mapBefore } |
| 3109 | |
| 3110 | const resolveFromRoot = (p: string | null) => |
| 3111 | normalizePath(path.resolve(root, p!)) |
| 3112 | |
| 3113 | if (map.file) { |
| 3114 | map.file = resolveFromRoot(map.file) |
| 3115 | } |
| 3116 | // Note: the real `Sourcemap#sources` maybe `null`, but rollup typing is not handle it. |
| 3117 | map.sources = map.sources!.map(resolveFromRoot) |
| 3118 | |
| 3119 | return map |
| 3120 | } |
| 3121 | // #endregion |
| 3122 | |
| 3123 | async function getSource( |
no test coverage detected