misc: deps cleanup + form validation fixes
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const _ = require('lodash')
|
||||
const Filter = require('scim-query-filter-parser')
|
||||
|
||||
module.exports = {
|
||||
generateSuccess (msg) {
|
||||
@@ -18,13 +17,5 @@ module.exports = {
|
||||
message: err.message || 'An unexpected error occured.'
|
||||
}
|
||||
return (complete) ? { responseResult: error } : error
|
||||
},
|
||||
filter (arr, filterString) {
|
||||
const prvFilter = new Filter(_.toString(filterString).replace(/'/g, `"`))
|
||||
return arr.filter(prvFilter.test)
|
||||
},
|
||||
orderBy (arr, orderString) {
|
||||
let orderParams = _.zip(...orderString.split(',').map(ord => _.trim(ord).split(' ').map(_.trim)))
|
||||
return _.orderBy(arr, orderParams[0], orderParams[1])
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user