nuke-var-loader
Advanced tools
Comparing version 0.0.2 to 0.1.0
# Changelog | ||
## 0.1.0 / 2017-01-11 | ||
* [[49c1ac1](http://gitlab.alibaba-inc.com/nuke/var-loader/commit/49c1ac1f5f986cd749b6190f0ad351b2a9a4bdce)] - `feat` rename customVar to _nuke_custom_vars | ||
## 0.0.2 / 2017-01-09 | ||
@@ -5,0 +9,0 @@ |
'use strict'; | ||
typeof window === 'undefined' && (window = {}); | ||
window.customVar = {}; | ||
window._nuke_custom_vars = window._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function varsLoader(config) { | ||
return Object.assign(config, window.customVar); | ||
return Object.assign(config, window._nuke_custom_vars); | ||
}, | ||
varLoader: function varLoader(key, value) { | ||
if (key in window.customVar) { | ||
return window.customVar[key]; | ||
if (key in window._nuke_custom_vars) { | ||
return window._nuke_custom_vars[key]; | ||
}; | ||
@@ -17,6 +17,6 @@ return value; | ||
setVars: function setVars(config) { | ||
Object.assign(window.customVar, config); | ||
Object.assign(window._nuke_custom_vars, config); | ||
}, | ||
setVar: function setVar(key, value) { | ||
window.customVar[key] = value; | ||
window._nuke_custom_vars[key] = value; | ||
}, | ||
@@ -23,0 +23,0 @@ androidVar: function androidVar(config) { |
{ | ||
"name": "nuke-var-loader", | ||
"version": "0.0.2", | ||
"description": "var loader", | ||
"version": "0.1.0", | ||
"description": "nuke var loader", | ||
"main": "lib/index", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -5,11 +5,11 @@ 'use strict'; | ||
typeof window === 'undefined' && (window = {}); | ||
window.customVar = {}; | ||
window._nuke_custom_vars = window._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function (config) { | ||
return Object.assign(config, window.customVar); | ||
return Object.assign(config, window._nuke_custom_vars); | ||
}, | ||
varLoader: function (key, value) { | ||
if (key in window.customVar) { | ||
return window.customVar[key]; | ||
if (key in window._nuke_custom_vars) { | ||
return window._nuke_custom_vars[key]; | ||
}; | ||
@@ -19,6 +19,6 @@ return value; | ||
setVars: function(config) { | ||
Object.assign(window.customVar, config); | ||
Object.assign(window._nuke_custom_vars, config); | ||
}, | ||
setVar: function(key, value) { | ||
window.customVar[key] = value; | ||
window._nuke_custom_vars[key] = value; | ||
}, | ||
@@ -25,0 +25,0 @@ androidVar:function(config) { |
4111