@mirai/core 0.3.352 → 0.3.354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,13 @@ const sanitizeComponent = el => {
|
|
|
9
9
|
let ghost;
|
|
10
10
|
Array.from(el.children).forEach(child => {
|
|
11
11
|
const dataset = Object.keys(child.dataset);
|
|
12
|
-
if (child.dataset['content']) content.push(child.cloneNode(true));else if (!ghost && child.dataset['ghost']) ghost = child.cloneNode(true);else if (!dataset.includes('role'))
|
|
12
|
+
if (child.dataset['content']) content.push(child.cloneNode(true));else if (!ghost && child.dataset['ghost']) ghost = child.cloneNode(true);else if (!dataset.includes('role')) {
|
|
13
|
+
if (child.parentNode) {
|
|
14
|
+
child.parentNode.removeChild(child);
|
|
15
|
+
} else {
|
|
16
|
+
console.warn('The parentNode does not exists for child:', child);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
13
19
|
});
|
|
14
20
|
return content.length > 0 ? {
|
|
15
21
|
dangerousChildren: Array.from(content),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeComponent.js","names":["sanitizeComponent","el","content","ghost","Array","from","children","forEach","child","dataset","Object","keys","push","cloneNode","includes","parentNode","removeChild","length","dangerousChildren","exports"],"sources":["../../src/helpers/sanitizeComponent.js"],"sourcesContent":["export const sanitizeComponent = (el) => {\n const content = [];\n let ghost;\n\n Array.from(el.children).forEach((child) => {\n const dataset = Object.keys(child.dataset);\n\n if (child.dataset['content']) content.push(child.cloneNode(true));\n else if (!ghost && child.dataset['ghost']) ghost = child.cloneNode(true);\n else if (!dataset.includes('role')) child.parentNode.removeChild(child);\n });\n\n return content.length > 0\n ? {\n dangerousChildren: Array.from(content),\n el,\n ghost,\n }\n : {};\n};\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAIC,EAAE,IAAK;EACvC,MAAMC,OAAO,GAAG,EAAE;EAClB,IAAIC,KAAK;EAETC,KAAK,CAACC,IAAI,CAACJ,EAAE,CAACK,QAAQ,CAAC,CAACC,OAAO,CAAEC,KAAK,IAAK;IACzC,MAAMC,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACH,KAAK,CAACC,OAAO,CAAC;IAE1C,IAAID,KAAK,CAACC,OAAO,CAAC,SAAS,CAAC,EAAEP,OAAO,CAACU,IAAI,CAACJ,KAAK,CAACK,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAC7D,IAAI,CAACV,KAAK,IAAIK,KAAK,CAACC,OAAO,CAAC,OAAO,CAAC,EAAEN,KAAK,GAAGK,KAAK,CAACK,SAAS,CAAC,IAAI,CAAC,CAAC,KACpE,IAAI,CAACJ,OAAO,CAACK,QAAQ,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"sanitizeComponent.js","names":["sanitizeComponent","el","content","ghost","Array","from","children","forEach","child","dataset","Object","keys","push","cloneNode","includes","parentNode","removeChild","console","warn","length","dangerousChildren","exports"],"sources":["../../src/helpers/sanitizeComponent.js"],"sourcesContent":["export const sanitizeComponent = (el) => {\n const content = [];\n let ghost;\n\n Array.from(el.children).forEach((child) => {\n const dataset = Object.keys(child.dataset);\n\n if (child.dataset['content']) content.push(child.cloneNode(true));\n else if (!ghost && child.dataset['ghost']) ghost = child.cloneNode(true);\n else if (!dataset.includes('role')) {\n if (child.parentNode) {\n child.parentNode.removeChild(child);\n } else {\n console.warn('The parentNode does not exists for child:', child);\n }\n }\n });\n\n return content.length > 0\n ? {\n dangerousChildren: Array.from(content),\n el,\n ghost,\n }\n : {};\n};\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAIC,EAAE,IAAK;EACvC,MAAMC,OAAO,GAAG,EAAE;EAClB,IAAIC,KAAK;EAETC,KAAK,CAACC,IAAI,CAACJ,EAAE,CAACK,QAAQ,CAAC,CAACC,OAAO,CAAEC,KAAK,IAAK;IACzC,MAAMC,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACH,KAAK,CAACC,OAAO,CAAC;IAE1C,IAAID,KAAK,CAACC,OAAO,CAAC,SAAS,CAAC,EAAEP,OAAO,CAACU,IAAI,CAACJ,KAAK,CAACK,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAC7D,IAAI,CAACV,KAAK,IAAIK,KAAK,CAACC,OAAO,CAAC,OAAO,CAAC,EAAEN,KAAK,GAAGK,KAAK,CAACK,SAAS,CAAC,IAAI,CAAC,CAAC,KACpE,IAAI,CAACJ,OAAO,CAACK,QAAQ,CAAC,MAAM,CAAC,EAAE;MAClC,IAAIN,KAAK,CAACO,UAAU,EAAE;QACpBP,KAAK,CAACO,UAAU,CAACC,WAAW,CAACR,KAAK,CAAC;MACrC,CAAC,MAAM;QACLS,OAAO,CAACC,IAAI,CAAC,2CAA2C,EAAEV,KAAK,CAAC;MAClE;IACF;EACF,CAAC,CAAC;EAEF,OAAON,OAAO,CAACiB,MAAM,GAAG,CAAC,GACrB;IACEC,iBAAiB,EAAEhB,KAAK,CAACC,IAAI,CAACH,OAAO,CAAC;IACtCD,EAAE;IACFE;EACF,CAAC,GACD,CAAC,CAAC;AACR,CAAC;AAACkB,OAAA,CAAArB,iBAAA,GAAAA,iBAAA"}
|