nuke-var-loader
Advanced tools
Comparing version 0.1.2 to 0.1.3
# Changelog | ||
## 0.1.3 / 2017-02-21 | ||
* [[d48b8dc](http://gitlab.alibaba-inc.com/nuke/var-loader/commit/d48b8dc4e092909bb65d4ee4b63fc45a359b2cfb)] - `feat` add window object compat ,add getVar function | ||
## 0.1.2 / 2017-01-16 | ||
@@ -5,0 +9,0 @@ |
'use strict'; | ||
typeof global === 'undefined' && (global = {}); | ||
global._nuke_custom_vars = global._nuke_custom_vars || {}; | ||
var X = window || global || null; | ||
X._nuke_custom_vars = X._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function varsLoader(config) { | ||
return Object.assign(config, global._nuke_custom_vars); | ||
return Object.assign(config, X._nuke_custom_vars); | ||
}, | ||
varLoader: function varLoader(key, value) { | ||
if (key in global._nuke_custom_vars) { | ||
return global._nuke_custom_vars[key]; | ||
if (key in X._nuke_custom_vars) { | ||
return X._nuke_custom_vars[key]; | ||
}; | ||
@@ -17,7 +17,10 @@ return value; | ||
setVars: function setVars(config) { | ||
Object.assign(global._nuke_custom_vars, config); | ||
Object.assign(X._nuke_custom_vars, config); | ||
}, | ||
setVar: function setVar(key, value) { | ||
global._nuke_custom_vars[key] = value; | ||
X._nuke_custom_vars[key] = value; | ||
}, | ||
getVar: function getVar(key) { | ||
return X._nuke_custom_vars[key]; | ||
}, | ||
androidVar: function androidVar(config) { | ||
@@ -24,0 +27,0 @@ var style = {}; |
{ | ||
"name": "nuke-var-loader", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "nuke var loader", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
'use strict'; | ||
typeof global === 'undefined' && (global = {}); | ||
global._nuke_custom_vars = global._nuke_custom_vars || {}; | ||
let X = window || global || null; | ||
X._nuke_custom_vars = X._nuke_custom_vars || {}; | ||
module.exports = { | ||
varsLoader: function (config) { | ||
return Object.assign(config, global._nuke_custom_vars); | ||
return Object.assign(config, X._nuke_custom_vars); | ||
}, | ||
varLoader: function (key, value) { | ||
if (key in global._nuke_custom_vars) { | ||
return global._nuke_custom_vars[key]; | ||
if (key in X._nuke_custom_vars) { | ||
return X._nuke_custom_vars[key]; | ||
}; | ||
@@ -18,7 +18,10 @@ return value; | ||
setVars: function(config) { | ||
Object.assign(global._nuke_custom_vars, config); | ||
Object.assign(X._nuke_custom_vars, config); | ||
}, | ||
setVar: function(key, value) { | ||
global._nuke_custom_vars[key] = value; | ||
X._nuke_custom_vars[key] = value; | ||
}, | ||
getVar: function(key) { | ||
return X._nuke_custom_vars[key]; | ||
}, | ||
androidVar:function(config) { | ||
@@ -25,0 +28,0 @@ let style = {}; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4582
73
1