@authme/identity-verification 2.8.6 → 2.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +20 -16
- package/index.js +20 -16
- package/package.json +6 -6
package/index.cjs
CHANGED
|
@@ -30659,17 +30659,21 @@ const ocrResultModal = arg => {
|
|
|
30659
30659
|
return domGroupItem;
|
|
30660
30660
|
}
|
|
30661
30661
|
function formatDate(dateString, format) {
|
|
30662
|
-
//
|
|
30663
|
-
const
|
|
30664
|
-
|
|
30665
|
-
const
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30670
|
-
.
|
|
30671
|
-
.
|
|
30672
|
-
.
|
|
30662
|
+
// 確保日期格式為 "YYYY-MM-DD",避免瀏覽器解析錯誤
|
|
30663
|
+
const normalizedDateString = dateString.replace(/\//g, '-');
|
|
30664
|
+
// 解析日期字串
|
|
30665
|
+
const date = new Date(normalizedDateString);
|
|
30666
|
+
if (isNaN(date.getTime())) {
|
|
30667
|
+
throw new Error('Invalid date format');
|
|
30668
|
+
}
|
|
30669
|
+
// 取得年月日
|
|
30670
|
+
const year = date.getFullYear().toString(); // 取得年份
|
|
30671
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 補 0 的月份
|
|
30672
|
+
const day = date.getDate().toString().padStart(2, '0'); // 補 0 的日期
|
|
30673
|
+
// 替換格式
|
|
30674
|
+
return format.replace(/YYYY|yyyy/g, year) // 年份 (YYYY 或 yyyy)
|
|
30675
|
+
.replace(/MM|mm/g, month) // 月份 (MM)
|
|
30676
|
+
.replace(/dd/g, day); // 日期 (dd)
|
|
30673
30677
|
}
|
|
30674
30678
|
|
|
30675
30679
|
function isValidDateFormat(dateStr) {
|
|
@@ -30682,11 +30686,11 @@ const ocrResultModal = arg => {
|
|
|
30682
30686
|
const input = item.querySelector('input');
|
|
30683
30687
|
if (input) {
|
|
30684
30688
|
const key = item.id;
|
|
30685
|
-
|
|
30686
|
-
|
|
30689
|
+
let value = input.value;
|
|
30690
|
+
const valueOrigin = arg.items.find(i => i.name === key).value;
|
|
30687
30691
|
const dateFormat = arg.items.find(i => i.name === key).dateFormat;
|
|
30688
30692
|
if (dateFormat) {
|
|
30689
|
-
|
|
30693
|
+
value = formatDate(value, 'yyyy-mm-dd');
|
|
30690
30694
|
}
|
|
30691
30695
|
modifiedDetails[key] = {
|
|
30692
30696
|
isModified: value !== valueOrigin ? true : false,
|
|
@@ -35649,8 +35653,8 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
|
|
|
35649
35653
|
}
|
|
35650
35654
|
|
|
35651
35655
|
var name = "authme/sdk";
|
|
35652
|
-
var version$1 = "2.8.
|
|
35653
|
-
var date = "2025-03-
|
|
35656
|
+
var version$1 = "2.8.7";
|
|
35657
|
+
var date = "2025-03-21T02:01:27+0000";
|
|
35654
35658
|
var packageInfo = {
|
|
35655
35659
|
name: name,
|
|
35656
35660
|
version: version$1,
|
package/index.js
CHANGED
|
@@ -30651,17 +30651,21 @@ const ocrResultModal = arg => {
|
|
|
30651
30651
|
return domGroupItem;
|
|
30652
30652
|
}
|
|
30653
30653
|
function formatDate(dateString, format) {
|
|
30654
|
-
//
|
|
30655
|
-
const
|
|
30656
|
-
|
|
30657
|
-
const
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
.
|
|
30663
|
-
.
|
|
30664
|
-
.
|
|
30654
|
+
// 確保日期格式為 "YYYY-MM-DD",避免瀏覽器解析錯誤
|
|
30655
|
+
const normalizedDateString = dateString.replace(/\//g, '-');
|
|
30656
|
+
// 解析日期字串
|
|
30657
|
+
const date = new Date(normalizedDateString);
|
|
30658
|
+
if (isNaN(date.getTime())) {
|
|
30659
|
+
throw new Error('Invalid date format');
|
|
30660
|
+
}
|
|
30661
|
+
// 取得年月日
|
|
30662
|
+
const year = date.getFullYear().toString(); // 取得年份
|
|
30663
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 補 0 的月份
|
|
30664
|
+
const day = date.getDate().toString().padStart(2, '0'); // 補 0 的日期
|
|
30665
|
+
// 替換格式
|
|
30666
|
+
return format.replace(/YYYY|yyyy/g, year) // 年份 (YYYY 或 yyyy)
|
|
30667
|
+
.replace(/MM|mm/g, month) // 月份 (MM)
|
|
30668
|
+
.replace(/dd/g, day); // 日期 (dd)
|
|
30665
30669
|
}
|
|
30666
30670
|
|
|
30667
30671
|
function isValidDateFormat(dateStr) {
|
|
@@ -30674,11 +30678,11 @@ const ocrResultModal = arg => {
|
|
|
30674
30678
|
const input = item.querySelector('input');
|
|
30675
30679
|
if (input) {
|
|
30676
30680
|
const key = item.id;
|
|
30677
|
-
|
|
30678
|
-
|
|
30681
|
+
let value = input.value;
|
|
30682
|
+
const valueOrigin = arg.items.find(i => i.name === key).value;
|
|
30679
30683
|
const dateFormat = arg.items.find(i => i.name === key).dateFormat;
|
|
30680
30684
|
if (dateFormat) {
|
|
30681
|
-
|
|
30685
|
+
value = formatDate(value, 'yyyy-mm-dd');
|
|
30682
30686
|
}
|
|
30683
30687
|
modifiedDetails[key] = {
|
|
30684
30688
|
isModified: value !== valueOrigin ? true : false,
|
|
@@ -35641,8 +35645,8 @@ class AuthmeIdentityVerification extends AuthmeFunctionModule {
|
|
|
35641
35645
|
}
|
|
35642
35646
|
|
|
35643
35647
|
var name = "authme/sdk";
|
|
35644
|
-
var version$1 = "2.8.
|
|
35645
|
-
var date = "2025-03-
|
|
35648
|
+
var version$1 = "2.8.7";
|
|
35649
|
+
var date = "2025-03-21T02:01:27+0000";
|
|
35646
35650
|
var packageInfo = {
|
|
35647
35651
|
name: name,
|
|
35648
35652
|
version: version$1,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authme/identity-verification",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"core-js": "^3.6.0",
|
|
6
6
|
"lottie-web": "^5.9.2",
|
|
7
7
|
"rxjs": "^7.4.0",
|
|
8
|
-
"@authme/core": "2.8.
|
|
9
|
-
"@authme/engine": "2.8.
|
|
10
|
-
"@authme/id-recognition": "2.8.
|
|
11
|
-
"@authme/util": "2.8.
|
|
12
|
-
"@authme/liveness": "2.8.
|
|
8
|
+
"@authme/core": "2.8.7",
|
|
9
|
+
"@authme/engine": "2.8.7",
|
|
10
|
+
"@authme/id-recognition": "2.8.7",
|
|
11
|
+
"@authme/util": "2.8.7",
|
|
12
|
+
"@authme/liveness": "2.8.7"
|
|
13
13
|
},
|
|
14
14
|
"module": "./index.js",
|
|
15
15
|
"main": "./index.cjs",
|