Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {isPlainObject, toString} from '@form-create/utils';
VNode.use(nodes);
export const drive = {
ui: process.env.UI,
version: process.env.VERSION,
formRender,
components,
parsers,
makers,
getGlobalApi,
getConfig,
};
const {FormCreate, install} = createFormCreate(drive);
Creator.prototype.event = function (key, value) {
let event;
if (!isPlainObject(key)) {
event = {[key]: value}
} else {
event = key;
}
Object.keys(event).forEach((eventName) => {
const name = toString(eventName).indexOf('on-') === 0 ? eventName : `on-${eventName}`;
this.on(name, event[eventName]);
});
return this;
};