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

Function getNormalizationType

static/vuejs/vue.js:8759–8777  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

8757// 1: simple normalization needed (possible 1-level deep nested array)
8758// 2: full normalization needed
8759function getNormalizationType (children) {
8760 var res = 0;
8761 for (var i = 0; i < children.length; i++) {
8762 var el = children[i];
8763 if (el.type !== 1) {
8764 continue
8765 }
8766 if (needsNormalization(el) ||
8767 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
8768 res = 2;
8769 break
8770 }
8771 if (maybeComponent(el) ||
8772 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
8773 res = 1;
8774 }
8775 }
8776 return res
8777}
8778
8779function needsNormalization (el) {
8780 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