normalize
steal.hooks.normalize
A loader hook that converts a moduleIdentifier into a moduleName to serve as the canonical key for a module.
normalize(name, parentName, parentAddress)
Parameters
-
name
{String}
The moduleIdentifier provided in the
import
,require()
or similar call depending on the module syntax used. -
parentName
{String}
OptionalThe moduleName of the parent module; the module that is doing the importing.
-
parentAddress
{String}
OptionalThe address (as determined in locate) of the parent module.
Returns
{Promise | String}
The string moduleName as determined by applying the normalize algorithm, or a Promise that will resolve with the moduleName.
The normalize hook is used to convert a moduleIdentifier from a given context and, using the normalization algorithm, to a canonical moduleName.