1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

fix(require): tryPackage uses optional chaining (#16020)

This commit is contained in:
Bartek Iwańczuk 2022-09-26 17:39:03 +02:00 committed by GitHub
parent a2262c11d7
commit 075bdfd621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,7 @@
requestPath,
"package.json",
);
const pkg = core.ops.op_require_read_package_scope(packageJsonPath).main;
const pkg = core.ops.op_require_read_package_scope(packageJsonPath)?.main;
if (!pkg) {
return tryExtensions(
pathResolve(requestPath, "index"),