code: function sanitize(type, sanitizers) {
    return function (name) {
      // this.property(...).sanitize(functon (val) { return val; })
      if (typeof name === 'function') return this.define('sanitize', name);
  
      // `reset` will remove any existing sanitizers from property;
      if (name === 'reset') {
        delete this.property['sanitize'];
        return this;
      }
  
      if (!sanitizers[name]) throw new Error('Unknown sanitizer: ' + name);
  
      // this.property(...).sanitize('sanitizer', args...)
      var args = Array.prototype.slice.call(arguments, 1),
          prop = this.name,
          sanitizer = sanitizers[name],
          sanitizeFn = this.property['sanitize'];
  
      if (!sanitizeFn) {
        sanitizeFn = function (val) {
          if (type === 'array' ? Array.isArray(val) : typeof val === type) {
            return sanitizeFn.sanitizers.reduce(function (value, sanitizer) {
              return sanitizer.fn.apply(null, [value].concat(sanitizer.args));
            }, val);
          } else {
            return val;
          }
        }
        sanitizeFn.sanitizers = [];
      }
      sanitizeFn.sanitizers.push({ fn: sanitizer, args: args });
  
      this.property['sanitize'] = sanitizeFn;
  
      return this;
    };
  }
docs: Sanitize factory