@driveflux/time 6.0.0 → 6.0.1
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/config.js +4 -4
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { initSingleton } from '@driveflux/singleton';
|
|
2
2
|
var getConfig = function() {
|
|
3
3
|
return {
|
|
4
|
-
timezone: process.env.TIME_ZONE || 'Asia/Kuala_Lumpur'
|
|
4
|
+
timezone: typeof process !== 'undefined' ? process.env.TIME_ZONE || 'Asia/Kuala_Lumpur' : 'Asia/Kuala_Lumpur'
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
export var config =
|
|
7
|
+
export var config = initSingleton('timeConfig', getConfig);
|
|
8
8
|
export var resetConfig = function() {
|
|
9
|
-
config =
|
|
9
|
+
config = initSingleton('timeConfig', getConfig, true);
|
|
10
10
|
return config;
|
|
11
11
|
};
|
|
12
12
|
export var setConfig = function(key, value) {
|