wiki.techinc.nl/tests/phpunit/data/resourceloader/codexModules/useSlotContents.js
Anne Tomasevich 4baf4dd8be CodexModule: Add unit test for code splitting
This requires the path to the Codex modules directory
to be configurable, so we can use static manifest and
component files in tests. This is achieved by changing
the constant storing the Codex modules dir from private
to protected so it can be overridden when creating a
test module.

Bug: T350054
Change-Id: Icd3c6c5d2a82f5a5fb1c38b52e54893034e7375c
2023-12-01 00:52:23 +00:00

1 line
618 B
JavaScript

"use strict";const o=require("vue");function r(e){const t=[];for(const n of e)typeof n.type=="string"||typeof n.type=="object"?t.push(n):n.type!==o.Comment&&(typeof n.children=="string"&&n.children.trim()!==""?t.push(n.children):Array.isArray(n.children)&&t.push(...r(n.children)));return t}function i(e,t){return typeof e.type=="object"&&"name"in e.type?t!==void 0?e.type.name===t:!0:!1}function s(e,t){return typeof e.type=="string"?t!==void 0?e.type===t.toLowerCase():!0:!1}function f(e){const t=typeof e=="function"?e():e;return t?r(t):[]}exports.isComponentVNode=i;exports.isTagVNode=s;exports.useSlotContents=f;