@builder.io/mitosis
Version:
Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io
15 lines (14 loc) • 601 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTextValue = void 0;
const getTextValue = (node) => {
var _a;
const textValue = ((_a = node.bindings._text) === null || _a === void 0 ? void 0 : _a.code) || node.properties.__text || '';
return textValue.replace(/\s+/g, '');
};
exports.getTextValue = getTextValue;
function isChildren({ node, extraMatches = [], }) {
const textValue = (0, exports.getTextValue)(node);
return ['props.children', 'children', 'children()'].concat(extraMatches).includes(textValue);
}
exports.default = isChildren;
;