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

Function getNormalizationType

static/vuejs/vue.common.js:8765–8783  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

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