utiller 1.0.225 → 1.0.226

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.
@@ -177,8 +177,7 @@ var Utiller = /*#__PURE__*/function () {
177
177
 
178
178
  /**
179
179
  * 刪除物件裡面特別的屬性,預設是刪除value為undefined
180
- *
181
- * */
180
+ **/
182
181
  function removeAttributeBy(object) {
183
182
  var predicate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (value) {
184
183
  return _lodash["default"].isUndefined(value);
@@ -930,8 +929,14 @@ var Utiller = /*#__PURE__*/function () {
930
929
  }, {
931
930
  key: "getStringOfCreditCardFormatted",
932
931
  value: function getStringOfCreditCardFormatted(string) {
933
- var inputValue = string.replace(/\D/g, ""); // Remove all non-digit characters
934
- return inputValue.replace(/(\d{4})(?=\d)/g, "$1-"); // Add a dash every 4 digits
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("-")) || "";
935
940
  }
936
941
  }, {
937
942
  key: "getObjectKey",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.225",
3
+ "version": "1.0.226",
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.224",
14
+ "utiller": "^1.0.225",
15
15
  "linepayer": "^1.0.4",
16
16
  "databazer": "^1.0.12",
17
17
  "lodash": "^4.17.20",