Commit bd4773a0 authored by Rich Trott's avatar Rich Trott
Browse files

module: use undefined if no main

If the package.json file does not have a "main" entry, return undefined
rather than an empty string. This is to make more consistent behavior.
For example, when package.json is a directory, "main" is undefined
rather than an empty string.

PR-URL: https://github.com/nodejs/node/pull/18593


Reviewed-By: default avatarBradley Farias <bradley.meck@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: default avatarVladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: default avatarYuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: default avatarBenedikt Meurer <benedikt.meurer@gmail.com>
Reviewed-By: default avatarAli Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
parent 2aa3e3b0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment