@builder.io/mitosis
Version:
Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io
14 lines (13 loc) • 523 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleMissingState = void 0;
const get_state_used_1 = require("./get-state-used");
function handleMissingState(json) {
const stateUsed = (0, get_state_used_1.getStateUsed)(json);
Array.from(stateUsed).forEach((property) => {
if (!(property in json.state)) {
json.state[property] = { code: 'null', type: 'property', propertyType: 'normal' };
}
});
}
exports.handleMissingState = handleMissingState;
;