Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
30
my-app/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js
generated
vendored
Executable file
30
my-app/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js
generated
vendored
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
var getError = require('./get-error');
|
||||
|
||||
/**
|
||||
* Where the given list is non-null and contains error instances then consolidate and throw
|
||||
* @throws Error
|
||||
* @param {string} resourcePath The path to the resource being processed
|
||||
* @param {null|Array} candidates A possible Array with possible error elements
|
||||
*/
|
||||
function throwErrors(resourcePath, candidates) {
|
||||
var errors = !!candidates && candidates
|
||||
.filter(testIsError)
|
||||
.map(getMessage);
|
||||
|
||||
var hasError = !!errors && errors.length;
|
||||
if (hasError) {
|
||||
throw getError(['For resource: ' + resourcePath].concat(errors).join('\n'));
|
||||
}
|
||||
|
||||
function testIsError(candidate) {
|
||||
return !!candidate && (typeof candidate === 'object') && (candidate instanceof Error);
|
||||
}
|
||||
|
||||
function getMessage(error) {
|
||||
return error.message;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = throwErrors;
|
||||
Loading…
Add table
Add a link
Reference in a new issue