Skip to content

Instantly share code, notes, and snippets.

View mtamadon's full-sized avatar
🎯

Mahdi Tamadon mtamadon

🎯
View GitHub Profile
@mtamadon
mtamadon / Filter .js
Last active April 20, 2018 07:32
AdonisJS Useful Lucid Functions
//Function:
static async filter(data , fields ){
const { sanitize } = use('Validator')
const sanitizeRules = {}
for (let key in fields){
sanitizeRules[fields[key]]= 'toNull'
}
data = sanitize(data,sanitizeRules )
data = this.NaNEscaper(data)