MCPcopy
hub / github.com/webpack/webpack / collectErrors

Function collectErrors

test/walkHtmlTokens.unittest.js:2074–2083  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

2072 * @returns {{ code: string, slice: string, severity: string }[]} list of reported errors
2073 */
2074 const collectErrors = (html) => {
2075 /** @type {{ code: string, slice: string, severity: string }[]} */
2076 const errors = [];
2077 walkHtmlTokens(html, 0, {
2078 parseError: (input, code, start, end, severity) => {
2079 errors.push({ code, slice: input.slice(start, end), severity });
2080 }
2081 });
2082 return errors;
2083 };
2084
2085 it("reports missing-attribute-value as a warning", () => {
2086 const errors = collectErrors("<a foo=>");

Callers 1

Calls 3

walkHtmlTokensFunction · 0.85
sliceMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected