Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dry-underscore

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dry-underscore - npm Package Compare versions

Comparing version 0.17.1 to 0.17.2

16

lib/common.js

@@ -612,9 +612,15 @@ "use strict";

_.get = function(obj, key){
_.get = function(obj, key, call_f){
if(obj[key] !== undefined){ return obj[key]; }
function get_val(v){
if(!call_f){ return(v); }
else if(_.isFunction(v)){ return(v()); }
else{ return(v); }
}
if(obj[key] !== undefined){ return get_val(obj[key]); }
for (var prop in obj){
if(_.has(obj, prop) && prop.toLowerCase() === key.toLowerCase()){
return obj[prop];
return get_val(obj[prop]);
}

@@ -626,2 +632,6 @@ }

_.val = function(obj, key){
return _.get(obj, key, true);
};
_.define = _.def = function(obj, key, defaultValue){

@@ -628,0 +638,0 @@ if(key === undefined){ return(obj); }

@@ -436,4 +436,16 @@ "use strict";

eq(_.get({ 'a': 'b'}, 'a'), 'b');
eq(_.get({ 'a': function(){ return('fb'); }}, 'a', true), 'fb');
ok(_.isFunction(_.get({ 'a': function(){ return('fb'); }}, 'a')));
});
test('val', function(){
eq(_.val({ 'A': 'b'}, 'a'), 'b');
eq(_.val(['a', 'b'], 1), 'b');
eq(_.val({ 'A': 'b'}, 'c'), undefined);
eq(_.val({ 'a': 'b'}, 'a'), 'b');
eq(_.val({ 'a': function(){ return('fb'); }}, 'a'), 'fb');
eq(_.val({ 'A': function(){ return('fb'); }}, 'a'), 'fb');
});
test('each', function(){

@@ -440,0 +452,0 @@

2

lib/string_builder.js

@@ -12,3 +12,3 @@

this.add(this._indent, " ");
this._str += _.toArray(arguments).join("") + "\n";
this._str += _.format.apply(null, arguments) + "\n";
};

@@ -15,0 +15,0 @@ string_builder_class.prototype.add_line = string_builder_class.prototype.addLine;

@@ -17,7 +17,7 @@ "use strict";

sb.in(2);
sb.add_line("in_two");
sb.add_line("in_two", {a: true}, [1,2]);
sb.in(2);
sb.add_line("in_four");
sb.add_line("in_four", "five", "six");
sb.out(2);
sb.add_line("in_two");
sb.add_line("in_two", [1,2,3]);
sb.out(2);

@@ -30,5 +30,5 @@ sb.add_line("in_zero");

expects += "in_zero\n";
expects += " in_two\n";
expects += " in_four\n";
expects += " in_two\n";
expects += " in_two { a: true } [ 1, 2 ]\n";
expects += " in_fourfivesix\n";
expects += " in_two [ 1, 2, 3 ]\n";
expects += "in_zero\n";

@@ -35,0 +35,0 @@

{
"name": "dry-underscore",
"version": "0.17.1",
"version": "0.17.2",
"dependencies": {

@@ -5,0 +5,0 @@ "formidable": {

{
"name": "dry-underscore",
"version": "0.17.1",
"version": "0.17.2",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "description": "The DRY Undescore Library",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc