* Creates an error object for when a requested ES module cannot be found. * @param {string} request The name of the requested module * @param {string} [path] The path to the requested module * @returns {Error}
(request, path)
| 1622 | * @returns {Error} |
| 1623 | */ |
| 1624 | function createEsmNotFoundErr(request, path) { |
| 1625 | // eslint-disable-next-line no-restricted-syntax |
| 1626 | const err = new Error(`Cannot find module '${request}'`); |
| 1627 | err.code = 'MODULE_NOT_FOUND'; |
| 1628 | if (path) { |
| 1629 | err.path = path; |
| 1630 | } |
| 1631 | // TODO(BridgeAR): Add the requireStack as well. |
| 1632 | return err; |
| 1633 | } |
| 1634 | |
| 1635 | function getExtensionForFormat(format) { |
| 1636 | switch (format) { |
no outgoing calls
no test coverage detected
searching dependent graphs…