@autofleet/settings 1.3.2 → 1.3.4
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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ interface SettingsClassOptions {
|
|
|
6
6
|
ttl?: number;
|
|
7
7
|
disableTestEnvCheck?: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare type SettingValue = string | boolean | number | any[] |
|
|
9
|
+
declare type SettingValue = string | boolean | number | any[] | any;
|
|
10
10
|
interface Location {
|
|
11
11
|
lat: number;
|
|
12
12
|
lng: number;
|
|
@@ -32,7 +32,7 @@ declare class SettingsManager {
|
|
|
32
32
|
NEVER_DEFAULT_VALUE: string;
|
|
33
33
|
disableTestEnvCheck: boolean;
|
|
34
34
|
static get NEVER_DEFAULT_VALUE(): string;
|
|
35
|
-
static readNetworkValue(networkValue: SettingValue, defaultValue: SettingValue):
|
|
35
|
+
static readNetworkValue(networkValue: SettingValue, defaultValue: SettingValue): any;
|
|
36
36
|
constructor({ serviceUrl, ttl, disableTestEnvCheck }?: SettingsClassOptions);
|
|
37
37
|
get(key: SettingValue, defaultValue?: any, labels?: LabelsArray, { timeout, rejectOnFail }?: GetSettingOption): Promise<any>;
|
|
38
38
|
getMultiple(settingsToGet: {
|
package/dist/index.js
CHANGED
|
@@ -118,7 +118,7 @@ class SettingsManager {
|
|
|
118
118
|
settingsToGet.map((obj) => {
|
|
119
119
|
const cacheKey = this.getCacheKey(obj.key, labels);
|
|
120
120
|
const cacheValue = this.settingsCache.get(cacheKey);
|
|
121
|
-
if (cacheValue) {
|
|
121
|
+
if (cacheValue && cacheValue !== waitingToNetwork) {
|
|
122
122
|
settingsToReturn.set(obj.key, cacheValue);
|
|
123
123
|
}
|
|
124
124
|
else {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -28,7 +28,7 @@ interface SettingsClassOptions {
|
|
|
28
28
|
disableTestEnvCheck?: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type SettingValue = string | boolean | number | any[] |
|
|
31
|
+
type SettingValue = string | boolean | number | any[] | any;
|
|
32
32
|
|
|
33
33
|
interface Location {
|
|
34
34
|
lat: number;
|
|
@@ -169,7 +169,7 @@ class SettingsManager {
|
|
|
169
169
|
settingsToGet.map((obj) => {
|
|
170
170
|
const cacheKey = this.getCacheKey(obj.key, labels);
|
|
171
171
|
const cacheValue = this.settingsCache.get(cacheKey);
|
|
172
|
-
if (cacheValue) {
|
|
172
|
+
if (cacheValue && cacheValue !== waitingToNetwork) {
|
|
173
173
|
settingsToReturn.set(obj.key, cacheValue);
|
|
174
174
|
} else {
|
|
175
175
|
settingsToFetch.push(obj.key);
|