Explorar o código

fix(util): 中文名正则

qinlaiqiao %!s(int64=4) %!d(string=hai) anos
pai
achega
142b1b49e6
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      util/package.json
  2. 1 1
      util/src/reg.ts

+ 1 - 1
util/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/util",
-  "version": "1.0.5",
+  "version": "1.0.6",
   "description": "共用的工具包",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 1 - 1
util/src/reg.ts

@@ -38,4 +38,4 @@ export const integerReg = /^-?[1-9]\d*$/;
 export const numberReg = /^(-?\d+)(\.\d*)?$/;
 
 // 中文姓名
-export const chineseNameReg = /^[\u4e00-\u9fa5]+([·-]?[\u4e00-\u9fa5]+)?$/;
+export const chineseNameReg = /^[\u4e00-\u9fa5]+[·-]?[\u4e00-\u9fa5]+$/;