css-loader
Advanced tools
Comparing version 6.8.0 to 6.8.1
@@ -1012,35 +1012,39 @@ "use strict"; | ||
} | ||
function warningFactory(obj) { | ||
function warningFactory(warning) { | ||
let message = ""; | ||
if (typeof obj.line !== "undefined") { | ||
message += `(${obj.line}:${obj.column}) `; | ||
if (typeof warning.line !== "undefined") { | ||
message += `(${warning.line}:${warning.column}) `; | ||
} | ||
if (typeof obj.plugin !== "undefined") { | ||
message += `from "${obj.plugin}" plugin: `; | ||
if (typeof warning.plugin !== "undefined") { | ||
message += `from "${warning.plugin}" plugin: `; | ||
} | ||
message += obj.text; | ||
if (obj.node) { | ||
message += `\n\nCode:\n ${obj.node.toString()}\n`; | ||
message += warning.text; | ||
if (warning.node) { | ||
message += `\n\nCode:\n ${warning.node.toString()}\n`; | ||
} | ||
const warning = new Error(message); | ||
warning.stack = null; | ||
return warning; | ||
const obj = new Error(message, { | ||
cause: warning | ||
}); | ||
obj.stack = null; | ||
return obj; | ||
} | ||
function syntaxErrorFactory(obj) { | ||
function syntaxErrorFactory(error) { | ||
let message = "\nSyntaxError\n\n"; | ||
if (typeof obj.line !== "undefined") { | ||
message += `(${obj.line}:${obj.column}) `; | ||
if (typeof error.line !== "undefined") { | ||
message += `(${error.line}:${error.column}) `; | ||
} | ||
if (typeof obj.plugin !== "undefined") { | ||
message += `from "${obj.plugin}" plugin: `; | ||
if (typeof error.plugin !== "undefined") { | ||
message += `from "${error.plugin}" plugin: `; | ||
} | ||
message += obj.file ? `${obj.file} ` : "<css input> "; | ||
message += `${obj.reason}`; | ||
const code = obj.showSourceCode(); | ||
message += error.file ? `${error.file} ` : "<css input> "; | ||
message += `${error.reason}`; | ||
const code = error.showSourceCode(); | ||
if (code) { | ||
message += `\n\n${code}\n`; | ||
} | ||
const error = new Error(message); | ||
error.stack = null; | ||
return error; | ||
const obj = new Error(message, { | ||
cause: error | ||
}); | ||
obj.stack = null; | ||
return obj; | ||
} |
{ | ||
"name": "css-loader", | ||
"version": "6.8.0", | ||
"version": "6.8.1", | ||
"description": "css loader module for webpack", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131093
2272