gcf-common-lib 0.26.55 → 0.26.56

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gcf-common-lib",
3
3
  "description": "",
4
- "version": "0.26.55",
4
+ "version": "0.26.56",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "branches": [
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 (0, chain_1.default)(Object.entries(o))
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 chain(Object.entries(o))
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) {