dry-underscore
Advanced tools
Comparing version 0.17.4 to 0.17.5
@@ -911,3 +911,3 @@ "use strict"; | ||
_.getterSetterKey = _.getter_setter_key = function (variable_name){ | ||
_.getterSetterKey = _.getter_setter_key = function(variable_name, locked){ | ||
return(function(key, val){ | ||
@@ -917,3 +917,8 @@ if(key === undefined){ return(this[variable_name]); } | ||
if(val === undefined){ | ||
return(this[variable_name][key]); | ||
if(!locked && (_.isObject(key) || _.isArray(key))){ | ||
return(this[variable_name] = key); | ||
return(this); | ||
}else{ | ||
return(this[variable_name][key]); | ||
} | ||
}else{ | ||
@@ -920,0 +925,0 @@ this[variable_name][key] = val; |
@@ -90,2 +90,12 @@ "use strict"; | ||
eq(o.get_set_key(), [1,1,2]); | ||
o.get_set_key([2, 3, 4]); | ||
eq(o.get_set_key(), [2,3,4]); | ||
eq(o.get_set_key_locked(), [0,1,2]); | ||
eq(o.get_set_key_locked(0), 0); | ||
o.get_set_key_locked(0, 1); | ||
eq(o.get_set_key_locked(0), 1); | ||
eq(o.get_set_key_locked(), [1,1,2]); | ||
o.get_set_key_locked([2, 3, 4]); | ||
eq(o.get_set_key_locked(), [1,1,2]); | ||
} | ||
@@ -98,2 +108,3 @@ | ||
o.get_set_key = _.getter_setter_key("_get_set_key"); | ||
o.get_set_key_locked = _.getter_setter_key("_get_set_key_locked", true); | ||
}; | ||
@@ -106,2 +117,3 @@ | ||
o._get_set_key = [0,1,2]; | ||
o._get_set_key_locked = [0,1,2]; | ||
} | ||
@@ -108,0 +120,0 @@ |
{ | ||
"name": "dry-underscore", | ||
"version": "0.17.4", | ||
"version": "0.17.5", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "deep-diff": { |
{ | ||
"name": "dry-underscore", | ||
"version": "0.17.4", | ||
"version": "0.17.5", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "The DRY Undescore Library", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1816997
20481