How to use the whitelist function from validator

Find comprehensive JavaScript validator.whitelist code examples handpicked from public code repositorys.

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$/))
		)
fork icon5
star icon20
watch icon0

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);
}
fork icon0
star icon3
watch icon0

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;
},
fork icon0
star icon0
watch icon0

+ 11 other calls in file