@aliedu/common-cfgs
Advanced tools
Comparing version 1.0.1 to 1.0.2
import { IProps } from './types'; | ||
declare const setProConfigs: (param: IProps) => void; | ||
declare const getProConfigs: () => IProps; | ||
declare const getProConfigs: () => any; | ||
export { setProConfigs, getProConfigs }; |
import _extends from "@babel/runtime/helpers/extends"; | ||
var proConfigs = { | ||
var defaultProConfigs = { | ||
brandColor: '#fe6900', | ||
@@ -14,9 +14,15 @@ mainColor: '#00a8ff', | ||
var setProConfigs = function setProConfigs(param) { | ||
proConfigs = _extends({}, proConfigs, param); | ||
var curConfigs = window.commonProConfigs; | ||
if (curConfigs && typeof curConfigs === 'object') { | ||
window.commonProConfigs = _extends({}, curConfigs, param); | ||
} else { | ||
window.commonProConfigs = _extends({}, defaultProConfigs, param); | ||
} | ||
}; | ||
var getProConfigs = function getProConfigs() { | ||
return proConfigs; | ||
return window.commonProConfigs || defaultProConfigs; | ||
}; | ||
export { setProConfigs, getProConfigs }; |
import { IProps } from './types'; | ||
declare const setProConfigs: (param: IProps) => void; | ||
declare const getProConfigs: () => IProps; | ||
declare const getProConfigs: () => any; | ||
export { setProConfigs, getProConfigs }; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var proConfigs = { | ||
var defaultProConfigs = { | ||
brandColor: '#fe6900', | ||
@@ -23,3 +23,9 @@ mainColor: '#00a8ff', | ||
var setProConfigs = function setProConfigs(param) { | ||
proConfigs = (0, _extends2["default"])({}, proConfigs, param); | ||
var curConfigs = window.commonProConfigs; | ||
if (curConfigs && typeof curConfigs === 'object') { | ||
window.commonProConfigs = (0, _extends2["default"])({}, curConfigs, param); | ||
} else { | ||
window.commonProConfigs = (0, _extends2["default"])({}, defaultProConfigs, param); | ||
} | ||
}; | ||
@@ -30,5 +36,5 @@ | ||
var getProConfigs = function getProConfigs() { | ||
return proConfigs; | ||
return window.commonProConfigs || defaultProConfigs; | ||
}; | ||
exports.getProConfigs = getProConfigs; |
{ | ||
"name": "@aliedu/common-cfgs", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "commonCfgs", | ||
@@ -57,3 +57,3 @@ "files": [ | ||
"license": "MIT", | ||
"homepage": "https://unpkg.com/@aliedu/common-cfgs@1.0.1/build/index.html" | ||
"homepage": "https://unpkg.com/@aliedu/common-cfgs@1.0.2/build/index.html" | ||
} |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4595
78