nuke-var-loader
Advanced tools
Comparing version 0.1.1 to 0.1.2
# Changelog | ||
## 0.1.2 / 2017-01-16 | ||
* [[9e198bf](http://gitlab.alibaba-inc.com/nuke/var-loader/commit/9e198bf79e25bdc4ee30d140c9af218b79667706)] - `feat` update from window to global | ||
## 0.1.1 / 2017-01-12 | ||
@@ -5,0 +9,0 @@ |
'use strict'; | ||
typeof window === 'undefined' && (window = {}); | ||
window._nuke_custom_vars = window._nuke_custom_vars || {}; | ||
typeof global === 'undefined' && (global = {}); | ||
global._nuke_custom_vars = global._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function varsLoader(config) { | ||
return Object.assign(config, window._nuke_custom_vars); | ||
return Object.assign(config, global._nuke_custom_vars); | ||
}, | ||
varLoader: function varLoader(key, value) { | ||
if (key in window._nuke_custom_vars) { | ||
return window._nuke_custom_vars[key]; | ||
if (key in global._nuke_custom_vars) { | ||
return global._nuke_custom_vars[key]; | ||
}; | ||
@@ -17,6 +17,6 @@ return value; | ||
setVars: function setVars(config) { | ||
Object.assign(window._nuke_custom_vars, config); | ||
Object.assign(global._nuke_custom_vars, config); | ||
}, | ||
setVar: function setVar(key, value) { | ||
window._nuke_custom_vars[key] = value; | ||
global._nuke_custom_vars[key] = value; | ||
}, | ||
@@ -23,0 +23,0 @@ androidVar: function androidVar(config) { |
{ | ||
"name": "nuke-var-loader", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "nuke var loader", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
'use strict'; | ||
typeof window === 'undefined' && (window = {}); | ||
window._nuke_custom_vars = window._nuke_custom_vars || {}; | ||
typeof global === 'undefined' && (global = {}); | ||
global._nuke_custom_vars = global._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function (config) { | ||
return Object.assign(config, window._nuke_custom_vars); | ||
return Object.assign(config, global._nuke_custom_vars); | ||
}, | ||
varLoader: function (key, value) { | ||
if (key in window._nuke_custom_vars) { | ||
return window._nuke_custom_vars[key]; | ||
if (key in global._nuke_custom_vars) { | ||
return global._nuke_custom_vars[key]; | ||
}; | ||
@@ -18,6 +18,6 @@ return value; | ||
setVars: function(config) { | ||
Object.assign(window._nuke_custom_vars, config); | ||
Object.assign(global._nuke_custom_vars, config); | ||
}, | ||
setVar: function(key, value) { | ||
window._nuke_custom_vars[key] = value; | ||
global._nuke_custom_vars[key] = value; | ||
}, | ||
@@ -24,0 +24,0 @@ androidVar:function(config) { |
4335