(
children,
maybeComponent
)
| 11351 | // 1: simple normalization needed (possible 1-level deep nested array) |
| 11352 | // 2: full normalization needed |
| 11353 | function getNormalizationType ( |
| 11354 | children, |
| 11355 | maybeComponent |
| 11356 | ) { |
| 11357 | var res = 0; |
| 11358 | for (var i = 0; i < children.length; i++) { |
| 11359 | var el = children[i]; |
| 11360 | if (el.type !== 1) { |
| 11361 | continue |
| 11362 | } |
| 11363 | if (needsNormalization(el) || |
| 11364 | (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { |
| 11365 | res = 2; |
| 11366 | break |
| 11367 | } |
| 11368 | if (maybeComponent(el) || |
| 11369 | (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { |
| 11370 | res = 1; |
| 11371 | } |
| 11372 | } |
| 11373 | return res |
| 11374 | } |
| 11375 | |
| 11376 | function needsNormalization (el) { |
| 11377 | return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' |
no test coverage detected