utiller 1.0.34 → 1.0.38

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.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
 
8
8
  /***
9
- *
9
+ * 2XXX api io
10
10
  * 3XXX databases
11
11
  * 4XXX pooller
12
12
  * 8XXX file IO,Utiller
@@ -15,6 +15,9 @@ exports["default"] = void 0;
15
15
  * 6XXX puppter=>browser
16
16
  */
17
17
  var ERRORs = {
18
+ 2001: {
19
+ message: 'update item, id is required'
20
+ },
18
21
  3001: {
19
22
  message: "get table error"
20
23
  },
@@ -247,8 +247,7 @@ var Utiller = /*#__PURE__*/function () {
247
247
  value: function startWithRegex() {
248
248
  var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
249
249
  var rule = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ".";
250
- var line = "@desktop: ~\"only screen and (min-width: 600px) and (max-width: 1680px)\";";
251
- var pattern = new RegExp("^" + "".concat(rule), "i");
250
+ var pattern = new RegExp("^".concat(rule), "i");
252
251
  return pattern.test(string);
253
252
  }
254
253
  /** this is used for unit test,
@@ -1403,6 +1402,8 @@ var Utiller = /*#__PURE__*/function () {
1403
1402
  }, {
1404
1403
  key: "stringToInteger",
1405
1404
  value: function stringToInteger(string) {
1405
+ string = _lodash["default"].toUpper(string);
1406
+
1406
1407
  switch (string) {
1407
1408
  case "A":
1408
1409
  return 0;
@@ -1437,6 +1438,15 @@ var Utiller = /*#__PURE__*/function () {
1437
1438
  case "K":
1438
1439
  return 10;
1439
1440
 
1441
+ case "L":
1442
+ return 11;
1443
+
1444
+ case "M":
1445
+ return 12;
1446
+
1447
+ case "N":
1448
+ return 13;
1449
+
1440
1450
  default:
1441
1451
  return 101;
1442
1452
  }
@@ -1475,6 +1485,18 @@ var Utiller = /*#__PURE__*/function () {
1475
1485
  case 9:
1476
1486
  return "J";
1477
1487
 
1488
+ case 10:
1489
+ return "K";
1490
+
1491
+ case 11:
1492
+ return "L";
1493
+
1494
+ case 12:
1495
+ return "M";
1496
+
1497
+ case 13:
1498
+ return "N";
1499
+
1478
1500
  default:
1479
1501
  return "Z";
1480
1502
  }
@@ -1085,6 +1085,16 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
1085
1085
  _fs["default"].appendFileSync(path, "".concat(newLine ? "\n" : "").concat(data), options);
1086
1086
  }
1087
1087
  }
1088
+ /** 快速把資料結構印出來看 */
1089
+
1090
+ }, {
1091
+ key: "printCollectionToFile",
1092
+ value: function printCollectionToFile(collection) {
1093
+ var fileName = "./logs/__temp_".concat(this.getCurrentTimeFormat(), ".txt");
1094
+ this.persistByPath("./logs/");
1095
+ this.appendFile(fileName, this.deepFlat(collection, " \n\n, "));
1096
+ this.appendInfo("collectionToFile succeed, file name ==> ".concat(fileName));
1097
+ }
1088
1098
  }, {
1089
1099
  key: "singleFileTemplatify",
1090
1100
  value: function singleFileTemplatify() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.34",
3
+ "version": "1.0.38",
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.6",
14
- "utiller": "^1.0.33",
14
+ "utiller": "^1.0.37",
15
15
  "databazer": "^1.0.7",
16
16
  "lodash": "^4.17.20",
17
17
  "moment": "^2.29.1"