gcf-common-lib 0.25.47 → 0.25.49
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 +1 -1
- package/src/types.ts +0 -2
- package/src/utils.ts +3 -2
package/package.json
CHANGED
package/src/types.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Channel, ConfirmChannel, connect, Connection, Options } from 'amqplib';
|
|
2
2
|
import Bluebird from 'bluebird';
|
|
3
3
|
import { chain, Dictionary } from 'lodash';
|
|
4
|
+
import Dict = NodeJS.Dict;
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
@@ -84,9 +85,9 @@ export function A1ToColNum(value: string) {
|
|
|
84
85
|
return result;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
export function safeJsonParse(value: string, fallbackValue?:
|
|
88
|
+
export function safeJsonParse<T = Dict<any>>(value: string, fallbackValue?: T) {
|
|
88
89
|
try {
|
|
89
|
-
return JSON.parse(value);
|
|
90
|
+
return JSON.parse(value) as T;
|
|
90
91
|
} catch (err) {
|
|
91
92
|
return fallbackValue;
|
|
92
93
|
}
|