[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-09-13 04:48:26 +00:00
committed by GitHub
parent 57358d3062
commit b60b3cbef1
2 changed files with 5 additions and 4 deletions

View File

@@ -108,8 +108,7 @@ bool BundlerPlugin::anyMatchesCrossThread(JSC::VM& vm, const BunString* namespac
// Check virtual modules for both onLoad and onResolve (only in "file" namespace)
if (!this->virtualModules.isEmpty()) {
// Virtual modules only work in the "file" namespace or empty namespace (defaults to "file")
bool isFileNamespace = !namespaceStr || namespaceStr->isEmpty() ||
namespaceStr->toWTFString(BunString::ZeroCopy) == "file"_s;
bool isFileNamespace = !namespaceStr || namespaceStr->isEmpty() || namespaceStr->toWTFString(BunString::ZeroCopy) == "file"_s;
if (isFileNamespace && this->virtualModules.contains(pathString)) {
return true;
}

View File

@@ -442,7 +442,7 @@ export function runOnResolvePlugins(this: BundlerPlugin, specifier, inputNamespa
}
var results = onResolve.$get(inputNamespace);
if (!results) {
this.onResolveAsync(internalID, null, null, null);
return null;
@@ -595,7 +595,9 @@ export function runOnLoadPlugins(
contents = JSON.stringify(result.exports);
loader = "json";
} catch (e) {
throw new TypeError("Virtual module must return a JSON-serializable object when using loader: \"object\": " + e);
throw new TypeError(
'Virtual module must return a JSON-serializable object when using loader: "object": ' + e,
);
}
}