util-helpers 4.8.2 → 4.8.3
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/dist/util-helpers.js +6 -6
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/isBankCard.js +5 -5
- package/esm/isUrl.js +1 -1
- package/lib/isBankCard.js +5 -5
- package/lib/isUrl.js +1 -1
- package/package.json +1 -1
package/dist/util-helpers.js
CHANGED
|
@@ -318,12 +318,12 @@
|
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
320
|
* luhn 计算校验位
|
|
321
|
-
*
|
|
322
|
-
* @param {string}
|
|
323
|
-
* @returns
|
|
321
|
+
* @private
|
|
322
|
+
* @param {string} numStr 银行卡前面数字
|
|
323
|
+
* @returns {number}
|
|
324
324
|
*/
|
|
325
|
-
function sumCheckCode$2(
|
|
326
|
-
const numArr = (
|
|
325
|
+
function sumCheckCode$2(numStr) {
|
|
326
|
+
const numArr = (numStr + '').replace(/\D/g, '').split('').reverse();
|
|
327
327
|
|
|
328
328
|
let sum = 0;
|
|
329
329
|
for (let i = 0; i < numArr.length; i++) {
|
|
@@ -956,7 +956,7 @@
|
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
// url正则
|
|
959
|
-
const reg$1 = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[
|
|
959
|
+
const reg$1 = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\*\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
|
|
960
960
|
|
|
961
961
|
/**
|
|
962
962
|
* 检测值是否为url
|