Explorar el Código

fix(util): 中文名正则

qinlaiqiao hace 5 años
padre
commit
142b1b49e6
Se han modificado 2 ficheros con 2 adiciones y 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]+$/;