nav tabs on admin dashboard
This commit is contained in:
9
node_modules/loader-runner/lib/LoaderRunner.js
generated
vendored
9
node_modules/loader-runner/lib/LoaderRunner.js
generated
vendored
@@ -123,9 +123,9 @@ function runSyncOrAsync(fn, context, args, callback) {
|
||||
if(result === undefined)
|
||||
return callback();
|
||||
if(result && typeof result === "object" && typeof result.then === "function") {
|
||||
return result.catch(callback).then(function(r) {
|
||||
return result.then(function(r) {
|
||||
callback(null, r);
|
||||
});
|
||||
}, callback);
|
||||
}
|
||||
return callback(null, result);
|
||||
}
|
||||
@@ -167,7 +167,10 @@ function iteratePitchingLoaders(options, loaderContext, callback) {
|
||||
|
||||
// load loader module
|
||||
loadLoader(currentLoaderObject, function(err) {
|
||||
if(err) return callback(err);
|
||||
if(err) {
|
||||
loaderContext.cacheable(false);
|
||||
return callback(err);
|
||||
}
|
||||
var fn = currentLoaderObject.pitch;
|
||||
currentLoaderObject.pitchExecuted = true;
|
||||
if(!fn) return iteratePitchingLoaders(options, loaderContext, callback);
|
||||
|
||||
23
node_modules/loader-runner/lib/loadLoader.js
generated
vendored
23
node_modules/loader-runner/lib/loadLoader.js
generated
vendored
@@ -1,11 +1,16 @@
|
||||
var LoaderLoadingError = require("./LoaderLoadingError");
|
||||
|
||||
module.exports = function loadLoader(loader, callback) {
|
||||
if(typeof System === "object" && typeof System.import === "function") {
|
||||
System.import(loader.path).catch(callback).then(function(module) {
|
||||
loader.normal = typeof module === "function" ? module : module.default;
|
||||
loader.pitch = module.pitch;
|
||||
loader.raw = module.raw;
|
||||
if(typeof loader.normal !== "function" && typeof loader.pitch !== "function")
|
||||
throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");
|
||||
if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") {
|
||||
return callback(new LoaderLoadingError(
|
||||
"Module '" + loader.path + "' is not a loader (must have normal or pitch function)"
|
||||
));
|
||||
}
|
||||
callback();
|
||||
});
|
||||
} else {
|
||||
@@ -26,13 +31,19 @@ module.exports = function loadLoader(loader, callback) {
|
||||
}
|
||||
return callback(e);
|
||||
}
|
||||
if(typeof loader !== "function" && typeof loader !== "object")
|
||||
throw new Error("Module '" + loader.path + "' is not a loader (export function or es6 module))");
|
||||
if(typeof module !== "function" && typeof module !== "object") {
|
||||
return callback(new LoaderLoadingError(
|
||||
"Module '" + loader.path + "' is not a loader (export function or es6 module)"
|
||||
));
|
||||
}
|
||||
loader.normal = typeof module === "function" ? module : module.default;
|
||||
loader.pitch = module.pitch;
|
||||
loader.raw = module.raw;
|
||||
if(typeof loader.normal !== "function" && typeof loader.pitch !== "function")
|
||||
throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");
|
||||
if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") {
|
||||
return callback(new LoaderLoadingError(
|
||||
"Module '" + loader.path + "' is not a loader (must have normal or pitch function)"
|
||||
));
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user