gcf-common-lib 0.26.55 → 0.26.57
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/.eslintrc.json +2 -9
- package/package.json +1 -3
- package/src/utils.js +2 -4
- package/src/utils.ts +2 -4
package/.eslintrc.json
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
"root": true,
|
|
3
3
|
"env": {
|
|
4
4
|
"es2021": true,
|
|
5
|
-
"commonjs": true
|
|
6
|
-
"mongo": true
|
|
5
|
+
"commonjs": true
|
|
7
6
|
},
|
|
8
7
|
"parser": "@typescript-eslint/parser",
|
|
9
8
|
"parserOptions": {
|
|
@@ -20,8 +19,6 @@
|
|
|
20
19
|
"promise",
|
|
21
20
|
"rxjs",
|
|
22
21
|
"lodash",
|
|
23
|
-
"capture",
|
|
24
|
-
"no-closure",
|
|
25
22
|
"unicorn"
|
|
26
23
|
],
|
|
27
24
|
"extends": [
|
|
@@ -41,16 +38,12 @@
|
|
|
41
38
|
}
|
|
42
39
|
},
|
|
43
40
|
"rules": {
|
|
44
|
-
"block-scoped-var": "error",
|
|
45
|
-
"no-loop-func": "error",
|
|
46
41
|
"@typescript-eslint/no-explicit-any": "off",
|
|
47
42
|
"@typescript-eslint/no-unused-vars": "off",
|
|
48
43
|
"@typescript-eslint/no-empty-function": "off",
|
|
49
44
|
"@typescript-eslint/no-empty-interface": "off",
|
|
50
45
|
"lodash/prefer-lodash-method": "off",
|
|
51
46
|
"rxjs/no-implicit-any-catch": "off",
|
|
52
|
-
"unicorn/prevent-abbreviations": "off"
|
|
53
|
-
"capture/explicit-closures": "error",
|
|
54
|
-
"no-closure/no-tagged-closures": "error"
|
|
47
|
+
"unicorn/prevent-abbreviations": "off"
|
|
55
48
|
}
|
|
56
49
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-common-lib",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.57",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"branches": [
|
|
@@ -41,10 +41,8 @@
|
|
|
41
41
|
"@types/node": "^16.18.59",
|
|
42
42
|
"eslint": "^8.52.0",
|
|
43
43
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
44
|
-
"eslint-plugin-capture": "^1.1.0",
|
|
45
44
|
"eslint-plugin-import": "^2.29.0",
|
|
46
45
|
"eslint-plugin-lodash": "^7.4.0",
|
|
47
|
-
"eslint-plugin-no-closure": "^1.0.1",
|
|
48
46
|
"eslint-plugin-promise": "^6.1.1",
|
|
49
47
|
"eslint-plugin-rxjs": "^5.0.3",
|
|
50
48
|
"eslint-plugin-unicorn": "^48.0.1"
|
package/src/utils.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.sendToQueueConfAmqp = exports.publishAmqp = exports.withAmqpCh = exports.withAmqpConn = exports.safeJsonParse = exports.A1ToColNum = exports.colNumToA1 = exports.A1ToIndex = exports.indexToA1 = exports.sec = exports.ms = exports.delay = exports.timeoutAfter = void 0;
|
|
7
7
|
const amqplib_1 = require("amqplib");
|
|
8
8
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
9
|
-
const chain_1 = __importDefault(require("lodash/chain"));
|
|
10
9
|
/**
|
|
11
10
|
*
|
|
12
11
|
* @param seconds Google function v1 timeout limit (max: 9 min)
|
|
@@ -31,10 +30,9 @@ function sec(o) {
|
|
|
31
30
|
multiMap.h = multiMap.m * 60;
|
|
32
31
|
multiMap.d = multiMap.h * 24;
|
|
33
32
|
multiMap.w = multiMap.d * 7;
|
|
34
|
-
return
|
|
33
|
+
return Object.entries(o)
|
|
35
34
|
.map(([k, v]) => (multiMap[k] ?? 0) * (v ?? 0))
|
|
36
|
-
.reduce((sum, v) => sum + v)
|
|
37
|
-
.value();
|
|
35
|
+
.reduce((sum, v) => sum + v, 0);
|
|
38
36
|
}
|
|
39
37
|
exports.sec = sec;
|
|
40
38
|
function indexToA1(idx) {
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Channel, ConfirmChannel, connect, Connection, Options } from 'amqplib';
|
|
2
2
|
import Bluebird from 'bluebird';
|
|
3
|
-
import chain from 'lodash/chain';
|
|
4
3
|
import Dict = NodeJS.Dict;
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -31,10 +30,9 @@ export function sec(o: { w?: number; d?: number; h?: number; m?: number; s?: num
|
|
|
31
30
|
multiMap.d = multiMap.h * 24;
|
|
32
31
|
multiMap.w = multiMap.d * 7;
|
|
33
32
|
|
|
34
|
-
return
|
|
33
|
+
return Object.entries(o)
|
|
35
34
|
.map(([k, v]) => (multiMap[k] ?? 0) * (v ?? 0))
|
|
36
|
-
.reduce((sum, v) => sum + v)
|
|
37
|
-
.value();
|
|
35
|
+
.reduce((sum, v) => sum + v, 0);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
export function indexToA1(idx: number) {
|