utiller 1.0.184 → 1.0.186
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/lib/exceptioner/index.js
CHANGED
|
@@ -18,7 +18,6 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
18
18
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
var MyException = /*#__PURE__*/function (_Error) {
|
|
21
|
-
(0, _inherits2["default"])(MyException, _Error);
|
|
22
21
|
function MyException(code) {
|
|
23
22
|
var _this;
|
|
24
23
|
(0, _classCallCheck2["default"])(this, MyException);
|
|
@@ -42,7 +41,8 @@ var MyException = /*#__PURE__*/function (_Error) {
|
|
|
42
41
|
if (_configerer.configerer.MODULE_MSG.SHOW_ERROR) _index.utiller.appendError(_this.message);
|
|
43
42
|
return _this;
|
|
44
43
|
}
|
|
45
|
-
(0,
|
|
44
|
+
(0, _inherits2["default"])(MyException, _Error);
|
|
45
|
+
return (0, _createClass2["default"])(MyException, [{
|
|
46
46
|
key: "getErrorCode",
|
|
47
47
|
value: function getErrorCode() {
|
|
48
48
|
return this.code;
|
|
@@ -58,6 +58,5 @@ var MyException = /*#__PURE__*/function (_Error) {
|
|
|
58
58
|
return JSON.stringify(_msg);
|
|
59
59
|
}
|
|
60
60
|
}]);
|
|
61
|
-
return MyException;
|
|
62
61
|
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Error));
|
|
63
62
|
var _default = exports["default"] = MyException;
|
package/lib/pooller/index.js
CHANGED
|
@@ -698,7 +698,7 @@ var InfinitePool = /*#__PURE__*/function () {
|
|
|
698
698
|
_iterator4.f();
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
(0, _createClass2["default"])(InfinitePool, [{
|
|
701
|
+
return (0, _createClass2["default"])(InfinitePool, [{
|
|
702
702
|
key: "enableQueueTerminateBySleepCount",
|
|
703
703
|
value:
|
|
704
704
|
/**
|
|
@@ -1770,6 +1770,5 @@ var InfinitePool = /*#__PURE__*/function () {
|
|
|
1770
1770
|
return sampleOfEachTaskInFreeMarker;
|
|
1771
1771
|
}()
|
|
1772
1772
|
}]);
|
|
1773
|
-
return InfinitePool;
|
|
1774
1773
|
}();
|
|
1775
1774
|
var _default = exports["default"] = InfinitePool;
|
package/lib/utiller/index.js
CHANGED
|
@@ -159,7 +159,7 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
159
159
|
this.init();
|
|
160
160
|
this.env = "dev";
|
|
161
161
|
}
|
|
162
|
-
(0, _createClass2["default"])(Utiller, [{
|
|
162
|
+
return (0, _createClass2["default"])(Utiller, [{
|
|
163
163
|
key: "removeAttributeBy",
|
|
164
164
|
value: /** Key : idOfSetTimout */
|
|
165
165
|
|
|
@@ -1220,7 +1220,7 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
1220
1220
|
key: "isUndefinedNullEmpty",
|
|
1221
1221
|
value: function isUndefinedNullEmpty(obj) {
|
|
1222
1222
|
var first = obj === undefined || obj === null;
|
|
1223
|
-
var second = _lodash["default"].isString(obj) || _lodash["default"].isArray(obj)
|
|
1223
|
+
var second = _lodash["default"].isString(obj) || _lodash["default"].isArray(obj) || _lodash["default"].isObject(obj) ? _lodash["default"].isEmpty(obj) : false;
|
|
1224
1224
|
return first || second;
|
|
1225
1225
|
}
|
|
1226
1226
|
}, {
|
|
@@ -2394,6 +2394,5 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
2394
2394
|
return slices;
|
|
2395
2395
|
}
|
|
2396
2396
|
}]);
|
|
2397
|
-
return Utiller;
|
|
2398
2397
|
}();
|
|
2399
2398
|
var _default = exports["default"] = Utiller;
|
|
@@ -12,7 +12,6 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
16
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
17
|
var _path5 = _interopRequireDefault(require("path"));
|
|
@@ -33,7 +32,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
33
32
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
34
33
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
35
34
|
var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
36
|
-
(0, _inherits2["default"])(NodeUtiller, _Utiller);
|
|
37
35
|
function NodeUtiller() {
|
|
38
36
|
var _this;
|
|
39
37
|
(0, _classCallCheck2["default"])(this, NodeUtiller);
|
|
@@ -43,7 +41,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
43
41
|
_this = _callSuper(this, NodeUtiller, [].concat(args));
|
|
44
42
|
/**================================= only in node.js ================================= */
|
|
45
43
|
/** 是否把log message 存到 info.txt*/
|
|
46
|
-
(0, _defineProperty2["default"])(
|
|
44
|
+
(0, _defineProperty2["default"])(_this, "isPersistIntoLogFile", true);
|
|
47
45
|
/**
|
|
48
46
|
* 遞回的去找出folder每一個child file, 預設是全部檔案, 可以透過predicate做filter, 可以exclude 指定的 'folder name'
|
|
49
47
|
*
|
|
@@ -58,7 +56,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
58
56
|
dirName: database
|
|
59
57
|
absolute: '/Users/davidtu/cross-achieve/mimi19up/mimi19up-scrapy/database/index.js'}
|
|
60
58
|
] */
|
|
61
|
-
(0, _defineProperty2["default"])(
|
|
59
|
+
(0, _defineProperty2["default"])(_this, "findFilePathBy", function (path) {
|
|
62
60
|
var predicate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (each) {
|
|
63
61
|
return true;
|
|
64
62
|
};
|
|
@@ -95,7 +93,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
95
93
|
return files;
|
|
96
94
|
});
|
|
97
95
|
/** return [...{path: ,fileName: ,extension: ,absolute: ,dirName:}]*/
|
|
98
|
-
(0, _defineProperty2["default"])(
|
|
96
|
+
(0, _defineProperty2["default"])(_this, "findFilePathByExtension", function (rootpath) {
|
|
99
97
|
var _this3;
|
|
100
98
|
var _extension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
101
99
|
var reg = new RegExp("^[^.].+.(".concat(_lodash["default"].join(_extension, "|"), ")$"));
|
|
@@ -106,13 +104,13 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
106
104
|
return reg.test(item.fileNameExtension);
|
|
107
105
|
}].concat(exclude));
|
|
108
106
|
});
|
|
109
|
-
(0, _defineProperty2["default"])(
|
|
107
|
+
(0, _defineProperty2["default"])(_this, "executeCommandLine", /*#__PURE__*/function () {
|
|
110
108
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(command) {
|
|
111
109
|
var self;
|
|
112
110
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
113
111
|
while (1) switch (_context.prev = _context.next) {
|
|
114
112
|
case 0:
|
|
115
|
-
self =
|
|
113
|
+
self = _this;
|
|
116
114
|
_this.appendInfo("\u57F7\u884C\u8173\u672C ".concat(command));
|
|
117
115
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
118
116
|
_child_process["default"].exec(command, function (error, stdout, stderr) {
|
|
@@ -138,7 +136,8 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
138
136
|
}());
|
|
139
137
|
return _this;
|
|
140
138
|
}
|
|
141
|
-
(0,
|
|
139
|
+
(0, _inherits2["default"])(NodeUtiller, _Utiller);
|
|
140
|
+
return (0, _createClass2["default"])(NodeUtiller, [{
|
|
142
141
|
key: "findSpecificFolderByPath",
|
|
143
142
|
value: function findSpecificFolderByPath(path, folderName) {
|
|
144
143
|
var absolute = _path5["default"].resolve(path);
|
|
@@ -1329,6 +1328,17 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1329
1328
|
}
|
|
1330
1329
|
return upgradePackageJsonVersion;
|
|
1331
1330
|
}())
|
|
1331
|
+
}, {
|
|
1332
|
+
key: "getVersionOfPackageJson",
|
|
1333
|
+
value: function getVersionOfPackageJson(path) {
|
|
1334
|
+
if (_lodash["default"].isEqual("package.json", this.getPathInfo(path).fileNameExtension)) {
|
|
1335
|
+
var _json$version;
|
|
1336
|
+
var json = this.getJsonObjByFilePath(path);
|
|
1337
|
+
return (_json$version = json.version) !== null && _json$version !== void 0 ? _json$version : "project without version notice";
|
|
1338
|
+
} else {
|
|
1339
|
+
throw new _index2["default"](8020, "path is not package.json, which is ".concat(path));
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1332
1342
|
}, {
|
|
1333
1343
|
key: "getAnswerFromPromptQ",
|
|
1334
1344
|
value: function () {
|
|
@@ -1469,6 +1479,5 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1469
1479
|
return document.toString();
|
|
1470
1480
|
}
|
|
1471
1481
|
}]);
|
|
1472
|
-
return NodeUtiller;
|
|
1473
1482
|
}(_index["default"]);
|
|
1474
1483
|
var _default = exports["default"] = NodeUtiller;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "utiller",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.186",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"uuid": "^8.3.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/cli": "^7.
|
|
31
|
-
"@babel/core": "^7.
|
|
32
|
-
"@babel/plugin-proposal-
|
|
33
|
-
"@babel/plugin-
|
|
34
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
35
|
-
"@babel/preset-env": "^7.
|
|
36
|
-
"@babel/
|
|
30
|
+
"@babel/cli": "^7.24.1",
|
|
31
|
+
"@babel/core": "^7.24.4",
|
|
32
|
+
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
33
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
34
|
+
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
35
|
+
"@babel/preset-env": "^7.24.4",
|
|
36
|
+
"@babel/preset-react": "^7.24.1",
|
|
37
|
+
"@babel/register": "^7.23.7"
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
presets: [
|
|
3
|
-
"@babel/preset-env"
|
|
3
|
+
"@babel/preset-env",
|
|
4
|
+
"@babel/preset-react"
|
|
4
5
|
],
|
|
5
6
|
plugins: [
|
|
6
7
|
[
|
|
@@ -12,7 +13,7 @@ module.exports = {
|
|
|
12
13
|
["@babel/transform-runtime", {
|
|
13
14
|
"regenerator": true
|
|
14
15
|
}],
|
|
15
|
-
["@babel/plugin-
|
|
16
|
+
["@babel/plugin-transform-class-properties"]
|
|
16
17
|
]
|
|
17
18
|
|
|
18
19
|
};
|
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"configerer": "^1.0.11",
|
|
14
|
-
"utiller": "^1.0.
|
|
14
|
+
"utiller": "^1.0.185",
|
|
15
15
|
"linepayer": "^1.0.4",
|
|
16
|
-
"databazer": "^1.0.
|
|
16
|
+
"databazer": "^1.0.12",
|
|
17
17
|
"lodash": "^4.17.20",
|
|
18
18
|
"moment": "^2.29.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babel/cli": "^7.
|
|
22
|
-
"@babel/core": "^7.
|
|
23
|
-
"@babel/plugin-proposal-
|
|
24
|
-
"@babel/plugin-
|
|
25
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
26
|
-
"@babel/preset-env": "^7.
|
|
27
|
-
"@babel/
|
|
28
|
-
"@babel/
|
|
21
|
+
"@babel/cli": "^7.24.1",
|
|
22
|
+
"@babel/core": "^7.24.4",
|
|
23
|
+
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
24
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
25
|
+
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
26
|
+
"@babel/preset-env": "^7.24.4",
|
|
27
|
+
"@babel/preset-react": "^7.24.1",
|
|
28
|
+
"@babel/register": "^7.23.7"
|
|
29
29
|
}
|
|
30
30
|
}
|