UNPKG

@kitmi/data

Version:

Jacaranda Framework Data Access Model

19 lines (14 loc) 405 B
import { Types } from '@kitmi/validators/allSync'; const defaultGenerator = (info, i18n) => { const typeObject = Types[info.type]; const originType = typeObject.name; switch (originType) { case 'datetime': if (info.auto) { return new Date(); } break; } return typeObject.defaultValue; }; export default defaultGenerator;