@evervault/react-native 2.2.1 → 2.3.0
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/build/Card/types.d.ts +1 -1
- package/build/Card/types.d.ts.map +1 -1
- package/build/index.cjs.js +38 -13
- package/build/index.cjs.js.map +1 -1
- package/build/index.esm.js +38 -13
- package/package.json +2 -2
- package/src/Card/types.ts +1 -0
package/build/Card/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CARD_BRAND_NAMES: readonly ["american-express", "visa", "mastercard", "discover", "jcb", "diners-club", "unionpay", "maestro", "mir", "elo", "hipercard", "hiper", "szep", "uatp"];
|
|
1
|
+
export declare const CARD_BRAND_NAMES: readonly ["american-express", "visa", "mastercard", "discover", "jcb", "diners-club", "unionpay", "maestro", "mir", "elo", "hipercard", "hiper", "szep", "uatp", "rupay"];
|
|
2
2
|
export type CardBrandName = (typeof CARD_BRAND_NAMES)[number];
|
|
3
3
|
export interface CardConfig {
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Card/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Card/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,2KAgBnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,aAAa,EAAE,CAAC;QAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QACnB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
|
package/build/index.cjs.js
CHANGED
|
@@ -6794,7 +6794,7 @@ const h = [
|
|
|
6794
6794
|
isLocal: false,
|
|
6795
6795
|
numberValidationRules: {
|
|
6796
6796
|
luhnCheck: true,
|
|
6797
|
-
ranges: [[300, 305], 36, 38, 39],
|
|
6797
|
+
ranges: [[300, 305], 3095, 36, 38, 39],
|
|
6798
6798
|
lengths: [14, 16, 19]
|
|
6799
6799
|
},
|
|
6800
6800
|
securityCodeValidationRules: {
|
|
@@ -6806,7 +6806,7 @@ const h = [
|
|
|
6806
6806
|
isLocal: false,
|
|
6807
6807
|
numberValidationRules: {
|
|
6808
6808
|
luhnCheck: true,
|
|
6809
|
-
ranges: [6011, [644, 649],
|
|
6809
|
+
ranges: [6011, [644, 649], [65e4, 651999], [653150, 659999], 622],
|
|
6810
6810
|
lengths: [16, 19]
|
|
6811
6811
|
},
|
|
6812
6812
|
securityCodeValidationRules: {
|
|
@@ -6818,7 +6818,16 @@ const h = [
|
|
|
6818
6818
|
isLocal: false,
|
|
6819
6819
|
numberValidationRules: {
|
|
6820
6820
|
luhnCheck: true,
|
|
6821
|
-
ranges: [
|
|
6821
|
+
ranges: [
|
|
6822
|
+
2131,
|
|
6823
|
+
1800,
|
|
6824
|
+
[3088, 3094],
|
|
6825
|
+
[3096, 3102],
|
|
6826
|
+
[3112, 3120],
|
|
6827
|
+
[3158, 3159],
|
|
6828
|
+
[3337, 3349],
|
|
6829
|
+
[3528, 3589]
|
|
6830
|
+
],
|
|
6822
6831
|
lengths: [16, 17, 18, 19]
|
|
6823
6832
|
},
|
|
6824
6833
|
securityCodeValidationRules: {
|
|
@@ -6866,16 +6875,20 @@ const h = [
|
|
|
6866
6875
|
numberValidationRules: {
|
|
6867
6876
|
luhnCheck: true,
|
|
6868
6877
|
ranges: [
|
|
6878
|
+
5018,
|
|
6879
|
+
5020,
|
|
6880
|
+
5038,
|
|
6881
|
+
5893,
|
|
6882
|
+
6101,
|
|
6883
|
+
6304,
|
|
6884
|
+
6759,
|
|
6885
|
+
6761,
|
|
6886
|
+
6762,
|
|
6887
|
+
6763,
|
|
6869
6888
|
493698,
|
|
6870
6889
|
[5e5, 504174],
|
|
6871
6890
|
[504176, 506698],
|
|
6872
6891
|
[506779, 508999],
|
|
6873
|
-
[56, 59],
|
|
6874
|
-
60,
|
|
6875
|
-
61,
|
|
6876
|
-
63,
|
|
6877
|
-
64,
|
|
6878
|
-
67,
|
|
6879
6892
|
69
|
|
6880
6893
|
],
|
|
6881
6894
|
lengths: [12, 13, 14, 15, 16, 17, 18, 19]
|
|
@@ -6981,6 +6994,18 @@ const h = [
|
|
|
6981
6994
|
securityCodeValidationRules: {
|
|
6982
6995
|
lengths: [0]
|
|
6983
6996
|
}
|
|
6997
|
+
},
|
|
6998
|
+
{
|
|
6999
|
+
name: "rupay",
|
|
7000
|
+
isLocal: false,
|
|
7001
|
+
numberValidationRules: {
|
|
7002
|
+
luhnCheck: true,
|
|
7003
|
+
ranges: [60, 81, 82, 508, [652100, 653149], [817200, 819899]],
|
|
7004
|
+
lengths: [16]
|
|
7005
|
+
},
|
|
7006
|
+
securityCodeValidationRules: {
|
|
7007
|
+
lengths: [3]
|
|
7008
|
+
}
|
|
6984
7009
|
}
|
|
6985
7010
|
];
|
|
6986
7011
|
function g(n, e, t) {
|
|
@@ -7047,7 +7072,7 @@ function C(n, e) {
|
|
|
7047
7072
|
isValid: l
|
|
7048
7073
|
};
|
|
7049
7074
|
}
|
|
7050
|
-
function
|
|
7075
|
+
function R(n) {
|
|
7051
7076
|
var r;
|
|
7052
7077
|
const e = /^(0[1-9]|1[[0-2]).*$/, t = n.match(e), s = t ? parseInt(t[1].toString(), 10) : null, l = /^(0[1-9]|1[[0-2])(\d{2})$/, i = n.match(l), a = i ? parseInt(i[2].toString(), 10) : null;
|
|
7053
7078
|
if (s) {
|
|
@@ -7113,7 +7138,7 @@ function areValuesComplete(values) {
|
|
|
7113
7138
|
if ("number" in values && !f(values.number ?? "").isValid) {
|
|
7114
7139
|
return false;
|
|
7115
7140
|
}
|
|
7116
|
-
if ("expiry" in values && !
|
|
7141
|
+
if ("expiry" in values && !R(values.expiry ?? "").isValid) {
|
|
7117
7142
|
return false;
|
|
7118
7143
|
}
|
|
7119
7144
|
if ("cvc" in values &&
|
|
@@ -7134,7 +7159,7 @@ function isAcceptedBrand(acceptedBrands, cardNumberValidationResult) {
|
|
|
7134
7159
|
return isBrandAccepted || isLocalBrandAccepted;
|
|
7135
7160
|
}
|
|
7136
7161
|
function formatExpiry(expiry) {
|
|
7137
|
-
const parsedExpiry =
|
|
7162
|
+
const parsedExpiry = R(expiry);
|
|
7138
7163
|
if (!parsedExpiry.isValid) {
|
|
7139
7164
|
return null;
|
|
7140
7165
|
}
|
|
@@ -7157,7 +7182,7 @@ function getCardFormSchema(acceptedBrands) {
|
|
|
7157
7182
|
expiry: z
|
|
7158
7183
|
.string()
|
|
7159
7184
|
.min(1, "Required")
|
|
7160
|
-
.refine((value) =>
|
|
7185
|
+
.refine((value) => R(value).isValid, {
|
|
7161
7186
|
message: "Invalid expiry",
|
|
7162
7187
|
}),
|
|
7163
7188
|
cvc: z
|