Suchjs官网

扩展类型

Suchjs基于其扩展方式,在库内内置实现了一些常见扩展类型,详细说明可参见扩展类型文档

示例

  • Such.as({ 
      bool: ":bool", 
      int: ":int", 
      percent: ":percent", 
      uppercase: ":uppercase:{2,4}", 
      lowercase: ":lowercase:{2,4}", 
      alpha: ":alpha:{3,6}", 
      alphaNumeric: ":alphaNumeric:{3,6}", 
      alphaNumericDash: ":alphaNumericDash:{3,6}", 
      tld: ":tld", 
      domain: ":domain", 
      protocol: ":protocol", 
      url: ":url", 
      email: ":email:#[domain='163.com']", 
      ipv4: ":ipv4", 
      ipv6: ":ipv6", 
      color$hex: ":color$hex", 
      color$rgb: ":color$rgb", 
      color$rgba: ":color$rgba", 
      color$hsl: ":color$hsl", 
      color$hsla: ":color$hsla", 
    });