18 lines
568 B
JavaScript
Raw Normal View History

2017-03-15 18:47:18 -07:00
import { isBoolean } from "lodash";
export function createEntry(collection, slug = '', path = '', options = {}) {
2016-08-24 21:36:44 -03:00
const returnObj = {};
returnObj.collection = collection;
2016-08-24 21:36:44 -03:00
returnObj.slug = slug;
returnObj.path = path;
returnObj.partial = options.partial || false;
returnObj.raw = options.raw || '';
returnObj.data = options.data || {};
returnObj.label = options.label || null;
returnObj.metaData = options.metaData || null;
2017-03-15 18:47:18 -07:00
returnObj.isModification = isBoolean(options.isModification)
? options.isModification
: null;
2016-08-24 21:36:44 -03:00
return returnObj;
}