How to use the whitelist function from validator
Find comprehensive JavaScript validator.whitelist code examples handpicked from public code repositorys.
GitHub: ELowry/StadiaIcons
119 120 121 122 123 124 125 126 127 128
// uid names if (refs.hasOwnProperty('uids')) { for (key in refs.uids) { key = validator.whitelist(key, 'a-zA-Z0-9'); if ( !refs.uids.hasOwnProperty(key) || !(key === 'defaultIcon' || validator.matches(key, /^[A-z0-9]{32}rcp1$/)) )
5
20
0
16 17 18 19 20 21 22 23 24 25
} if (sanitization.blacklist) { sanitizefield = Validator.blacklist(sanitizefield); } if (sanitization.whitelist) { sanitizefield = Validator.whitelist(sanitizefield); } if (sanitization.trim) { sanitizefield = Validator.trim(sanitizefield); }
0
3
0
233 234 235 236 237 238 239 240 241 242
} if (sanitization.unescape) { req.body[field] = Validator.unescape(req.body[field]); } if (sanitization.whitelist) { req.body[field] = Validator.whitelist(req.body[field]); } } return true; },
0
0
0
+ 11 other calls in file
validator.escape is the most popular function in validator (548 examples)