Socket
Socket
Sign inDemoInstall

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.9.2 to 0.9.3

2

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

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

@@ -59,6 +59,6 @@ (function () {

"use strict";
if (typeof keypath === "object" && keypath.constructor.name === "Array") {
if (underscore.isArray(keypath)) {
return Array.prototype.slice.call(keypath);
}
if (typeof keypath === "string") {
if (underscore.isString(keypath)) {
keypath = keypath.replace(/\.\./g, "«dot»");

@@ -65,0 +65,0 @@

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

!function(){function a(a,b,c,d){return(0!==d?".":"")+b.replace(/\./g,"«dot»")}function b(b){"use strict";if("object"==typeof b&&"Array"===b.constructor.name)return Array.prototype.slice.call(b);if("string"==typeof b){b=b.replace(/\.\./g,"«dot»"),b=b.replace(/\['(([^']|\\')*)'\]/g,a),b=b.replace(/\["(([^"]|\\")*)"\]/g,a),b=b.replace(/([$A-Za-z_][0-9A-Za-z_$]*)\(\)/,"$1");var c=b.split(".");return c=j(c).map(function(a){return a.replace(/«dot»/g,".")})}throw new Error("keypath must be an array or a string")}function c(a){"use strict";return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)}function d(a,b){"use strict";var c=l[b];return c?c(a):void 0}function e(a,b,c){"use strict";if(!(a instanceof Array))return void 0;var d=m[b];return d?d(a,c):void 0}function f(a,b){"use strict";if(""===b)return a;if(0===b.indexOf("@"))return d(a,b);var e=a["get"+c(b)];return void 0===e&&(e=a["is"+c(b)]),void 0===e&&(e=a[b]),"function"==typeof e&&(e=e.call(a)),e}function g(a,b){"use strict";return""===b?!0:"function"==typeof a["get"+c(b)]||"function"==typeof a["is"+c(b)]||j.has(a,b)}function h(a,b,d){"use strict";var f=a["set"+c(b)];return f?f.call(a,d):0===b.indexOf("@")?e(a,b,d):(a[b]=d,d)}function i(a,b){"use strict";var c,d,e=!0;for(c in b)if(b.hasOwnProperty(c)&&(d=b[c],j(a).valueForKeyPath(c)!==d)){e=!1;break}return e}var j;"undefined"!=typeof _&&(j=_);var k,l,m,n,o,p=this;if(k="undefined"!=typeof module&&"undefined"!=typeof require,"undefined"==typeof j&&(j=k?require("underscore"):p.underscore),"undefined"==typeof j)throw new Error("underscore.js is not found!");l={"@first":function(a){return j.first(a)},"@last":function(a){return j.last(a)},"@max":function(a){return j.max(a)},"@min":function(a){return j.min(a)},"@size":function(a){return j.size(a)}},m={"@first":function(a,b){return a[0]=b,b},"@last":function(a,b){return a[Math.max(a.length-1,0)]=b,b}},n={valueForKeyPath:function(a,c,d){"use strict";var e,g,h,i=a;if(null===a||void 0===a)return d;for(e=b(c),g=e.shift(),h=void 0;null!==i&&void 0!==i&&"string"==typeof g;)h=i,i=f(i,g),"function"==typeof i&&(i=i.call(h)),g=e.shift();return null===i||void 0===i?d:i},setValueForKeyPath:function(a,c,d){"use strict";var e,f,g=b(c);return e=g.pop(),f=j(a).valueForKeyPath(g.join(".")),null!==f&&void 0!==f?h(f,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]=j(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],i(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],i(d,b))return d;return null},sortByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.sortBy(a,b):j.sortBy(a,function(a){return j.valueForKeyPath(a,b)})},groupByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.groupBy(a,b):j.groupBy(a,function(a){return j.valueForKeyPath(a,b)})},indexByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.indexBy(a,b):j.indexBy(a,function(a){return j.valueForKeyPath(a,b)})},countByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.countBy(a,b):j.countBy(a,function(a){return j.valueForKeyPath(a,b)})},hasKeyPath:function(a,c){"use strict";var d,e,f;return null===a||void 0===a?!1:(d=b(c),e=d.pop(),f=this.valueForKeyPath(a,d),null!==f&&void 0!==f?g(f,e):!1)},eachByKeyPath:function(a,b,c){j.chain(a).pluckByKeyPath(b).each(c)}},o={getValueForKeyPath:n.valueForKeyPath},j.mixin(n),j.mixin(o),k&&(module.exports=j,module.exports.__debug__={toSegments:b})}();
!function(){function a(a,b,c,d){return(0!==d?".":"")+b.replace(/\./g,"«dot»")}function b(b){"use strict";if(j.isArray(b))return Array.prototype.slice.call(b);if(j.isString(b)){b=b.replace(/\.\./g,"«dot»"),b=b.replace(/\['(([^']|\\')*)'\]/g,a),b=b.replace(/\["(([^"]|\\")*)"\]/g,a),b=b.replace(/([$A-Za-z_][0-9A-Za-z_$]*)\(\)/,"$1");var c=b.split(".");return c=j(c).map(function(a){return a.replace(/«dot»/g,".")})}throw new Error("keypath must be an array or a string")}function c(a){"use strict";return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)}function d(a,b){"use strict";var c=l[b];return c?c(a):void 0}function e(a,b,c){"use strict";if(a instanceof Array){var d=m[b];return d?d(a,c):void 0}}function f(a,b){"use strict";if(""===b)return a;if(0===b.indexOf("@"))return d(a,b);var e=a["get"+c(b)];return void 0===e&&(e=a["is"+c(b)]),void 0===e&&(e=a[b]),"function"==typeof e&&(e=e.call(a)),e}function g(a,b){"use strict";return""===b?!0:"function"==typeof a["get"+c(b)]||"function"==typeof a["is"+c(b)]||j.has(a,b)}function h(a,b,d){"use strict";var f=a["set"+c(b)];return f?f.call(a,d):0===b.indexOf("@")?e(a,b,d):(a[b]=d,d)}function i(a,b){"use strict";var c,d,e=!0;for(c in b)if(b.hasOwnProperty(c)&&(d=b[c],j(a).valueForKeyPath(c)!==d)){e=!1;break}return e}var j,k,l,m,n,o,p=this;if(k="undefined"!=typeof module&&"undefined"!=typeof require,k||"undefined"==typeof _||(j=_),"undefined"==typeof j&&(j=k?require("underscore"):p.underscore),"undefined"==typeof j)throw new Error("underscore.js is not found!");l={"@first":function(a){return j.first(a)},"@last":function(a){return j.last(a)},"@max":function(a){return j.max(a)},"@min":function(a){return j.min(a)},"@size":function(a){return j.size(a)}},m={"@first":function(a,b){return a[0]=b,b},"@last":function(a,b){return a[Math.max(a.length-1,0)]=b,b}},n={valueForKeyPath:function(a,c,d){"use strict";var e,g,h,i=a;if(null===a||void 0===a)return d;for(e=b(c),g=e.shift(),h=void 0;null!==i&&void 0!==i&&"string"==typeof g;)h=i,i=f(i,g),"function"==typeof i&&(i=i.call(h)),g=e.shift();return null===i||void 0===i?d:i},setValueForKeyPath:function(a,c,d){"use strict";var e,f,g=b(c);return e=g.pop(),f=j(a).valueForKeyPath(g.join(".")),null!==f&&void 0!==f?h(f,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]=j(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],i(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],i(d,b))return d;return null},sortByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.sortBy(a,b):j.sortBy(a,function(a){return j.valueForKeyPath(a,b)})},groupByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.groupBy(a,b):j.groupBy(a,function(a){return j.valueForKeyPath(a,b)})},indexByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.indexBy(a,b):j.indexBy(a,function(a){return j.valueForKeyPath(a,b)})},countByKeyPath:function(a,b){"use strict";return"string"!=typeof b?j.countBy(a,b):j.countBy(a,function(a){return j.valueForKeyPath(a,b)})},hasKeyPath:function(a,c){"use strict";var d,e,f;return null===a||void 0===a?!1:(d=b(c),e=d.pop(),f=this.valueForKeyPath(a,d),null!==f&&void 0!==f?g(f,e):!1)},eachByKeyPath:function(a,b,c){j.chain(a).pluckByKeyPath(b).each(c)}},o={getValueForKeyPath:n.valueForKeyPath},j.mixin(n),j.mixin(o),k&&(module.exports=j,module.exports.__debug__={toSegments:b})}();
//# sourceMappingURL=underscore-keypath.min.js.map
Package.describe({
summary : "Keypath mechanism for underscore",
git : "https://github.com/jeeeyul/underscore-keypath.git",
version : "0.9.2"
version : "0.9.3"
});

@@ -6,0 +6,0 @@

{
"name" : "underscore-keypath",
"version" : "0.9.2",
"version" : "0.9.3",
"author" : "Jeeeyul Lee <jeeeyul@gmail.com>",

@@ -5,0 +5,0 @@ "description" : "Adds Key-Path mechanism extensions for underscore",

Sorry, the diff of this file is not supported yet

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