Skip to content

Commit

Permalink
fix: ts 5.5版本编译报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
caijf committed Jun 29, 2024
1 parent ac9c8b0 commit a18443e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/parseIdCard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore
const regIdCard = /^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i;
// const regIdCard = /^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i;
const regIdCard = /^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i;

const Provinces = [
// 华北地区:北京市|110000,天津市|120000,河北省|130000,山西省|140000,内蒙古自治区|150000
Expand Down Expand Up @@ -146,7 +146,8 @@ function parseIdCard(id: string) {
return null;
}

const origin = match.groups || {
// const origin = match.groups || {
const origin = {
province: match[1],
city: match[2],
area: match[3],
Expand Down

0 comments on commit a18443e

Please sign in to comment.