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

underscore-keypath

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

underscore-keypath - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

.versions

2

bower.json
{
"name": "underscore-keypath",
"version": "0.0.17",
"version": "0.0.18",
"homepage": "https://github.com/jeeeyul/underscore-keypath",

@@ -5,0 +5,0 @@ "authors": [

@@ -39,3 +39,3 @@ (function () {

if (typeof keypath === "object" && keypath.constructor.name === "Array") {
return keypath;
return Array.prototype.slice.call(keypath);
}

@@ -42,0 +42,0 @@ if (typeof keypath === "string") {

@@ -1,2 +0,2 @@

!function(){function a(a){"use strict";if("object"==typeof a&&"Array"===a.constructor.name)return a;if("string"==typeof a){var b=a.replace(/\['(([^']|\')+)'\]/g,".$1");return b=b.replace(/\["(([^"]|\")+)"\]/g,".$1"),b=b.replace(/([$A-Za-z_][0-9A-Za-z_$]*)\(\)/,"$1"),b.split(".")}throw new Error("keypath must be an array or a string")}function b(a){"use strict";return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)}function c(a,b){"use strict";var c=i[b];return c?c(a):void 0}function d(a,d){"use strict";if(""===d)return a;if(0===d.indexOf("@"))return c(a,d);var e=a["get"+b(d)];return void 0===e&&(e=a["is"+b(d)]),void 0===e&&(e=a[d]),"function"==typeof e&&(e=e.call(a)),e}function e(a,c){"use strict";return""===c?!0:"function"==typeof a["get"+b(c)]||"function"==typeof a["is"+b(c)]||_.has(a,c)}function f(a,c,d){"use strict";var e=a["set"+b(c)];return e?e.call(a,d):(a[c]=d,d)}function g(a,b){"use strict";var c,d,e=!0;for(c in b)if(b.hasOwnProperty(c)&&(d=b[c],_(a).valueForKeyPath(c)!==d)){e=!1;break}return e}var h,i,j,k,l=this;if(h="undefined"!=typeof module&&"undefined"!=typeof require,"undefined"==typeof _&&(_=h?require("underscore"):l._),void 0===typeof _)throw new Error("underscore.js is not found!");i={"@first":function(a){return _.first(a)},"@last":function(a){return _.last(a)},"@max":function(a){return _.max(a)},"@min":function(a){return _.min(a)},"@size":function(a){return _.size(a)}},j={valueForKeyPath:function(b,c,e){"use strict";var f,g,h,i=b;if(null===b||void 0===b)return e;for(f=a(c),g=f.shift(),h=void 0;null!==i&&void 0!==i&&"string"==typeof g;)h=i,i=d(i,g),"function"==typeof i&&(i=i.call(h)),g=f.shift();return i||e},setValueForKeyPath:function(b,c,d){"use strict";var e,g,h=a(c);return e=h.pop(),g=_(b).valueForKeyPath(h.join(".")),null!==g&&void 0!==g?f(g,e,d):void 0},pluckByKeyPath:function(a,b){"use strict";var c,d,e=[];for(c=0;c<a.length;c+=1)d=a[c],e[c]=_(d).valueForKeyPath(b);return e},whereByKeyPath:function(a,b){"use strict";var c,d,e=[];for(c=0;c<a.length;c+=1)d=a[c],g(d,b)&&e.push(d);return e},findWhereByKeyPath:function(a,b){"use strict";var c,d;for(c=0;c<a.length;c+=1)if(d=a[c],g(d,b))return d;return null},sortByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.sortBy(a,b):_.sortBy(a,function(a){return _.valueForKeyPath(a,b)})},groupByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.groupBy(a,b):_.groupBy(a,function(a){return _.valueForKeyPath(a,b)})},indexByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.indexBy(a,b):_.indexBy(a,function(a){return _.valueForKeyPath(a,b)})},countByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.countBy(a,b):_.countBy(a,function(a){return _.valueForKeyPath(a,b)})},hasKeyPath:function(b,c){"use strict";var d,f,g;return null===b||void 0===b?!1:(d=a(c),f=d.pop(),g=_.valueForKeyPath(b,d),null!==g&&void 0!==g?e(g,f):!1)}},k={getValueForKeyPath:j.valueForKeyPath},_.mixin(j),_.mixin(k),h&&(module.exports=_)}();
!function(){function a(a){"use strict";if("object"==typeof a&&"Array"===a.constructor.name)return Array.prototype.slice.call(a);if("string"==typeof a){var b=a.replace(/\['(([^']|\')+)'\]/g,".$1");return b=b.replace(/\["(([^"]|\")+)"\]/g,".$1"),b=b.replace(/([$A-Za-z_][0-9A-Za-z_$]*)\(\)/,"$1"),b.split(".")}throw new Error("keypath must be an array or a string")}function b(a){"use strict";return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)}function c(a,b){"use strict";var c=i[b];return c?c(a):void 0}function d(a,d){"use strict";if(""===d)return a;if(0===d.indexOf("@"))return c(a,d);var e=a["get"+b(d)];return void 0===e&&(e=a["is"+b(d)]),void 0===e&&(e=a[d]),"function"==typeof e&&(e=e.call(a)),e}function e(a,c){"use strict";return""===c?!0:"function"==typeof a["get"+b(c)]||"function"==typeof a["is"+b(c)]||_.has(a,c)}function f(a,c,d){"use strict";var e=a["set"+b(c)];return e?e.call(a,d):(a[c]=d,d)}function g(a,b){"use strict";var c,d,e=!0;for(c in b)if(b.hasOwnProperty(c)&&(d=b[c],_(a).valueForKeyPath(c)!==d)){e=!1;break}return e}var h,i,j,k,l=this;if(h="undefined"!=typeof module&&"undefined"!=typeof require,"undefined"==typeof _&&(_=h?require("underscore"):l._),void 0===typeof _)throw new Error("underscore.js is not found!");i={"@first":function(a){return _.first(a)},"@last":function(a){return _.last(a)},"@max":function(a){return _.max(a)},"@min":function(a){return _.min(a)},"@size":function(a){return _.size(a)}},j={valueForKeyPath:function(b,c,e){"use strict";var f,g,h,i=b;if(null===b||void 0===b)return e;for(f=a(c),g=f.shift(),h=void 0;null!==i&&void 0!==i&&"string"==typeof g;)h=i,i=d(i,g),"function"==typeof i&&(i=i.call(h)),g=f.shift();return null===i||void 0===i?e:i},setValueForKeyPath:function(b,c,d){"use strict";var e,g,h=a(c);return e=h.pop(),g=_(b).valueForKeyPath(h.join(".")),null!==g&&void 0!==g?f(g,e,d):void 0},pluckByKeyPath:function(a,b){"use strict";var c,d,e=[];for(c=0;c<a.length;c+=1)d=a[c],e[c]=_(d).valueForKeyPath(b);return e},whereByKeyPath:function(a,b){"use strict";var c,d,e=[];for(c=0;c<a.length;c+=1)d=a[c],g(d,b)&&e.push(d);return e},findWhereByKeyPath:function(a,b){"use strict";var c,d;for(c=0;c<a.length;c+=1)if(d=a[c],g(d,b))return d;return null},sortByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.sortBy(a,b):_.sortBy(a,function(a){return _.valueForKeyPath(a,b)})},groupByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.groupBy(a,b):_.groupBy(a,function(a){return _.valueForKeyPath(a,b)})},indexByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.indexBy(a,b):_.indexBy(a,function(a){return _.valueForKeyPath(a,b)})},countByKeyPath:function(a,b){"use strict";return"string"!=typeof b?_.countBy(a,b):_.countBy(a,function(a){return _.valueForKeyPath(a,b)})},hasKeyPath:function(b,c){"use strict";var d,f,g;return null===b||void 0===b?!1:(d=a(c),f=d.pop(),g=_.valueForKeyPath(b,d),null!==g&&void 0!==g?e(g,f):!1)}},k={getValueForKeyPath:j.valueForKeyPath},_.mixin(j),_.mixin(k),h&&(module.exports=_)}();
//# sourceMappingURL=underscore-keypath.min.js.map
{
"name" : "underscore-keypath",
"version" : "0.0.17",
"version" : "0.0.18",

@@ -36,5 +36,5 @@ "author" : "Jeeeyul Lee <jeeeyul@gmail.com>",

"scripts" : {
"minify" : "grunt minify",
"install" : "grunt build",
"test" : "grunt"
}
}

Sorry, the diff of this file is not supported yet

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