UNPKG

@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) 699 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripStateAndProps = void 0; const slots_1 = require("../../helpers/slots"); const strip_state_and_props_refs_1 = require("../../helpers/strip-state-and-props-refs"); const stripStateAndProps = ({ options, json }) => (code) => (0, strip_state_and_props_refs_1.stripStateAndPropsRefs)(code, { includeState: options.stateType === 'variables', replaceWith: (name) => name === 'children' ? '$$slots.default' : (0, slots_1.isSlotProperty)(name) ? (0, slots_1.replaceSlotsInString)(name, (x) => `$$slots.${x}`) : name, }); exports.stripStateAndProps = stripStateAndProps;