refactor(reference): simplify malformed UTF-8 handling
This commit is contained in:
@@ -334,10 +334,7 @@ export const parseReferenceSourceImports = (
|
|||||||
let source: string;
|
let source: string;
|
||||||
try {
|
try {
|
||||||
source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
||||||
} catch (cause: unknown) {
|
} catch {
|
||||||
// The import still records the original bytes; lossy text cannot supply
|
|
||||||
// observed module names or relationships.
|
|
||||||
void cause;
|
|
||||||
return {
|
return {
|
||||||
relationships: [],
|
relationships: [],
|
||||||
parse_failures: [
|
parse_failures: [
|
||||||
|
|||||||
Reference in New Issue
Block a user