utiller 1.0.227 → 1.0.228

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.
@@ -928,15 +928,11 @@ var Utiller = /*#__PURE__*/function () {
928
928
  }
929
929
  }, {
930
930
  key: "getStringOfCreditCardFormatted",
931
- value: function getStringOfCreditCardFormatted(input) {
932
- var _cleaned$match;
933
- var cleaned = input.replace(/\D/g, "");
934
- // 取前16個字元
935
- if (cleaned.length > 16) {
936
- cleaned = cleaned.slice(0, 16);
937
- }
938
- // 插入`-`每4個字符
939
- return ((_cleaned$match = cleaned.match(/.{1,4}/g)) === null || _cleaned$match === void 0 ? void 0 : _cleaned$match.join("-")) || "";
931
+ value: function getStringOfCreditCardFormatted() {
932
+ var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
933
+ var inputValue = string.replace(/\D/g, ""); // Remove all non-digit characters
934
+ var result = inputValue.replace(/(\d{4})(?=\d)/g, "$1-"); // Add a dash every 4 digits
935
+ return result.slice(0, 16);
940
936
  }
941
937
  }, {
942
938
  key: "getObjectKey",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.227",
3
+ "version": "1.0.228",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "configerer": "^1.0.11",
14
- "utiller": "^1.0.226",
14
+ "utiller": "^1.0.227",
15
15
  "linepayer": "^1.0.4",
16
16
  "databazer": "^1.0.12",
17
17
  "lodash": "^4.17.20",