MCPcopy
hub / github.com/koodo-reader/koodo-reader / extractClixmlErrors

Function extractClixmlErrors

main.js:74–90  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

72};
73
74const extractClixmlErrors = (text) => {
75 if (!text) return "";
76 const matches = text.match(
77 /<S S="Error">([^<]*(?:<[^/][^>]*>[^<]*<\/[^>]*>)*[^<]*)<\/S>/g
78 );
79 if (!matches) return text;
80 return matches
81 .map((m) =>
82 m
83 .replace(/<\/?S[^>]*>/g, "")
84 .replace(/<[^>]+>/g, "")
85 .replace(/_x000D__x000A_/g, "\n")
86 .trim()
87 )
88 .filter(Boolean)
89 .join("\n");
90};
91
92const runPowerShellScript = (script, timeout = 30000) => {
93 return new Promise((resolve, reject) => {

Callers 1

runPowerShellScriptFunction · 0.85

Calls 2

mapMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected