index-array-by
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -60,3 +60,3 @@ 'use strict'; | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
@@ -63,0 +63,0 @@ if (_i == null) return; |
@@ -23,2 +23,2 @@ type ListItem = any; | ||
export default indexBy; | ||
export { indexBy as default }; |
@@ -1,2 +0,2 @@ | ||
// Version 1.3.2 index-array-by - https://github.com/vasturiano/index-array-by | ||
// Version 1.3.3 index-array-by - https://github.com/vasturiano/index-array-by | ||
(function (global, factory) { | ||
@@ -6,3 +6,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.indexBy = factory()); | ||
}(this, (function () { 'use strict'; | ||
})(this, (function () { 'use strict'; | ||
@@ -66,3 +66,3 @@ function _objectWithoutPropertiesLoose(source, excluded) { | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
@@ -247,3 +247,3 @@ if (_i == null) return; | ||
}))); | ||
})); | ||
//# sourceMappingURL=index-array-by.js.map |
@@ -1,2 +0,2 @@ | ||
// Version 1.3.2 index-array-by - https://github.com/vasturiano/index-array-by | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).indexBy=r()}(this,(function(){"use strict";function t(t,r){if(null==t)return{};var n,e,o=function(t,r){if(null==t)return{};var n,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var e,o,i=[],u=!0,a=!1;try{for(n=n.call(t);!(u=(e=n.next()).done)&&(i.push(e.value),!r||i.length!==r);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(a)throw o}}return i}(t,r)||e(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||e(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){if(t){if("string"==typeof t)return o(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,r):void 0}}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function i(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var e=n.call(t,r||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=(o instanceof Array?o.length?o:[void 0]:[o]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=e.reduce((function(r,n){var e=r,o=n;return l.forEach((function(r,n){var a,f=r.keyAccessor;if(r.isProp){var c=o,s=c[f],y=t(c,[f].map(i));a=s,o=y}else a=f(o,n);n+1<l.length?(e.hasOwnProperty(a)||(e[a]={}),e=e[a]):u?(e.hasOwnProperty(a)||(e[a]=[]),e[a].push(o)):e[a]=o})),r}),{});u instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===l.length?Object.keys(r).forEach((function(t){return r[t]=u(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(f);var c=f;return a&&(c=[],function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];o.length===l.length?c.push({keys:o,vals:e}):Object.entries(e).forEach((function(e){var i=r(e,2),u=i[0],a=i[1];return t(a,[].concat(n(o),[u]))}))}(f),o instanceof Array&&0===o.length&&1===c.length&&(c[0].keys=[])),c}})); | ||
// Version 1.3.3 index-array-by - https://github.com/vasturiano/index-array-by | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).indexBy=r()}(this,(function(){"use strict";function t(t,r){if(null==t)return{};var n,e,o=function(t,r){if(null==t)return{};var n,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var e,o,i=[],u=!0,a=!1;try{for(n=n.call(t);!(u=(e=n.next()).done)&&(i.push(e.value),!r||i.length!==r);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(a)throw o}}return i}(t,r)||e(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||e(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){if(t){if("string"==typeof t)return o(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,r):void 0}}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function i(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var e=n.call(t,r||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=(o instanceof Array?o.length?o:[void 0]:[o]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=e.reduce((function(r,n){var e=r,o=n;return l.forEach((function(r,n){var a,f=r.keyAccessor;if(r.isProp){var c=o,s=c[f],y=t(c,[f].map(i));a=s,o=y}else a=f(o,n);n+1<l.length?(e.hasOwnProperty(a)||(e[a]={}),e=e[a]):u?(e.hasOwnProperty(a)||(e[a]=[]),e[a].push(o)):e[a]=o})),r}),{});u instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===l.length?Object.keys(r).forEach((function(t){return r[t]=u(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(f);var c=f;return a&&(c=[],function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];o.length===l.length?c.push({keys:o,vals:e}):Object.entries(e).forEach((function(e){var i=r(e,2),u=i[0],a=i[1];return t(a,[].concat(n(o),[u]))}))}(f),o instanceof Array&&0===o.length&&1===c.length&&(c[0].keys=[])),c}})); |
@@ -58,3 +58,3 @@ function _objectWithoutPropertiesLoose(source, excluded) { | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | ||
@@ -237,2 +237,2 @@ if (_i == null) return; | ||
export default index; | ||
export { index as default }; |
{ | ||
"name": "index-array-by", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "A utility function to index arrays by any criteria", | ||
@@ -10,2 +10,3 @@ "unpkg": "dist/index-array-by.min.js", | ||
"types": "dist/index-array-by.d.ts", | ||
"sideEffects": false, | ||
"repository": { | ||
@@ -39,13 +40,13 @@ "type": "git", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.0", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/preset-env": "^7.14.1", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@babel/core": "^7.18.10", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.18.9", | ||
"@babel/preset-env": "^7.18.10", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.47.0", | ||
"rollup-plugin-dts": "^3.0.1", | ||
"rollup": "^2.78.0", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.2.4" | ||
"typescript": "^4.7.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
36585