waigo
Version:
Node.js ES6 framework for reactive, data-driven apps and APIs (Koa, RethinkDB)
19 lines (13 loc) • 311 B
JavaScript
;
const waigo = global.waigo,
_ = waigo._;
/**
* Sanitizer to trim whitespace from the end of strings.
*
* @return {Function} Sanitizaton function.
*/
module.exports = function() {
return function*(field, value) {
return (typeof value === 'string' ? _.trim(value) : value);
}
};