@builder.io/mitosis
Version:
Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io
20 lines (19 loc) • 652 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasProps = void 0;
const legacy_1 = __importDefault(require("neotraverse/legacy"));
const hasProps = (json) => {
let has = false;
(0, legacy_1.default)(json).forEach(function (item) {
// TODO: use proper reference tracking
if (typeof item === 'string' && item.match(/(^|\W)props\s*\./)) {
has = true;
this.stop();
}
});
return has;
};
exports.hasProps = hasProps;
;