feat: auth + storage config improvements
This commit is contained in:
17
server/helpers/common.js
Normal file
17
server/helpers/common.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user