mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
esm: make extension-less errors in type:module actionable
PR-URL: https://github.com/nodejs/node/pull/42301 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
6f8c983f90
commit
a01302b8df
5 files changed
+35
-13
No files matched your search
+1
-1
@@ -1091,7 +1091,7 @@ async function getPackageType(url) {
|
||||
// required by the spec
|
||||
// this simple truthy check for whether `url` contains a file extension will
|
||||
// work for most projects but does not cover some edge-cases (such as
|
||||
// extension-less files or a url ending in a trailing space)
|
||||
// extensionless files or a url ending in a trailing space)
|
||||
const isFilePath = !!extname(url);
|
||||
// If it is a file path, get the directory it's in
|
||||
const dir = isFilePath ?
|
||||
|
||||
Reference in new issue
Block a user