MCPcopy Create free account
hub / github.com/TruthHun/BookStack / getNormalizationType

Function getNormalizationType

static/vuejs/vue.esm.js:8763–8781  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

8761// 1: simple normalization needed (possible 1-level deep nested array)
8762// 2: full normalization needed
8763function getNormalizationType (children) {
8764 var res = 0;
8765 for (var i = 0; i < children.length; i++) {
8766 var el = children[i];
8767 if (el.type !== 1) {
8768 continue
8769 }
8770 if (needsNormalization(el) ||
8771 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
8772 res = 2;
8773 break
8774 }
8775 if (maybeComponent(el) ||
8776 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
8777 res = 1;
8778 }
8779 }
8780 return res
8781}
8782
8783function needsNormalization (el) {
8784 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'

Callers 1

genChildrenFunction · 0.70

Calls 2

needsNormalizationFunction · 0.70
maybeComponentFunction · 0.70

Tested by

no test coverage detected