Skip to content

🎥 Make videos programmatically with React

simplify

Jonny Burgerb9b0de6bd4c9
diff --git a/packages/bundler/src/error-overlay/react-overlay/utils/get-source-map.ts b/packages/bundler/src/error-overlay/react-overlay/utils/get-source-map.ts
index 4f10d16ce9..e78a4782a6 100644
--- a/packages/bundler/src/error-overlay/react-overlay/utils/get-source-map.ts
+++ b/packages/bundler/src/error-overlay/react-overlay/utils/get-source-map.ts
@@ -45,40 +45,9 @@ export class SourceMap {
return {line: l as number, column: c as number, source: s as string};
}
- /**
- * Returns the generated code position for an original position.
- * @param {string} source The source file of the original code position.
- * @param {number} line The line of the original code position.
- * @param {number} column The column of the original code position.
- */
- getGeneratedPosition(
- source: string,
- line: number,
- column: number
- ): {line: number; column: number} {
- const {line: l, column: c} = this.__source_map.generatedPositionFor({
- source,
- line,
- column,
- });
- return {
- line: l as number,
- column: c as number,
- };
- }
-
- /**
- * Returns the code for a given source file name.
- * @param {string} sourceName The name of the source file.
- */
getSource(sourceName: string): string {
return this.__source_map.sourceContentFor(sourceName) as string;
}
-
- getSources(): string[] {
- // @ts-expect-error
- return this.__source_map.sources;
- }
}
function extractSourceMapUrl(
diff --git a/packages/bundler/src/error-overlay/react-overlay/utils/path.ts b/packages/bundler/src/error-overlay/react-overlay/utils/path.ts
index 98e952c81d..c23948c5d7 100644
--- a/packages/bundler/src/error-overlay/react-overlay/utils/path.ts
+++ b/packages/bundler/src/error-overlay/react-overlay/utils/path.ts
@@ -70,19 +70,3 @@ function normalizeStringPosix(path: string, allowAboveRoot: boolean) {
return res;
}
-
-export function pathNormalize(path: string) {
- if (path.length === 0) return '.';
-
- const isAbsolute = path.charCodeAt(0) === 47; /* / */
- const trailingSeparator = path.charCodeAt(path.length - 1) === 47; /* / */
-
- // Normalize the path
- path = normalizeStringPosix(path, !isAbsolute);
-
- if (path.length === 0 && !isAbsolute) path = '.';
- if (path.length > 0 && trailingSeparator) path += '/';
-
- if (isAbsolute) return '/' + path;
- return path;
-}