code: function (val) {
        var valid = [
          'string',  'number', 'integer',
          'boolean', 'object', 'array',
          'null',    'any'
        ];
  
        valid = (Array.isArray(val) ? val : [val]).every(function (val) {
          return valid.indexOf(val) !== -1;
        });
        if (!valid) {
          throw new(TypeError)("invalid type.");
        }
  
        this.property.type = val;
        return this;
      }
docs: JSON Schema 5.1: type