dist/modules/function.js
function tryRequire(name, def, isRoot) {
    function _require() {
        if (!is_1.isNode())
            /* istanbul ignore next */
            return to_1.toDefault(null, def);
        if (isRoot)
            return require.main.require(name);
        return require(name);
    }
    return tryWrap(_require)(def);
}
function tryRequire(name, def, isRoot) {
    function _require() {
        if (!is_1.isNode())
            /* istanbul ignore next */
            return to_1.toDefault(null, def);
        if (isRoot)
            return require.main.require(name);
        return require(name);
    }
    return tryWrap(_require)(def);
}
function tryRequire ( name , def , isRoot ) { function _require ( ) { if ( ! is_1 . isNode ( ) ) /* istanbul ignore next */ return to_1 . toDefault ( null , def ) ; if ( isRoot ) return require . main . require ( name ) ; return require ( name ) ; } return tryWrap ( _require ) ( def ) ; }
Try Require
Tries to require a module returns null
if cannot require or empty object.

@param name the name of module to try and require.
@param def optional default value on null.
@param isRoot used internally by tryRootRequire to require root modules.
Try Require Tries to require a module returns null if cannot require or empty object .