wikijs-fork/server/helpers/common.js

18 lines
295 B
JavaScript
Raw Normal View History

const _ = require('lodash')
module.exports = {
/**
* Get default value of type
*
* @param {any} Type Primitive Type
* @returns Default value
*/
getTypeDefaultValue (Type) {
if (_.isArray(Type)) {
return _.head(Type)
} else {
return new Type()
}
}
}