normalize

  • function
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

  1. name {String}

    The moduleIdentifier provided in the import, require() or similar call depending on the module syntax used.

  2. parentName {String}Optional

    The moduleName of the parent module; the module that is doing the importing.

  3. parentAddress {String}Optional

    The 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.