gatsby
Version:
Blazing fast modern site generator for React
15 lines (14 loc) • 464 B
JavaScript
exports.__esModule = true;
exports.extractUndefinedGlobal = extractUndefinedGlobal;
/**
* Extract undefined global variables used in server context from a reference error.
*/
function extractUndefinedGlobal(error) {
const match = error.message.match(/(window|document|localStorage|navigator|alert|location) is not defined/i);
if (match && match[1]) {
return match[1];
}
return ``;
}
//# sourceMappingURL=extract-undefined-global.js.map
;