+28
-15
@@ -21,15 +21,11 @@ 'use strict'; | ||
| function _slicedToArray(arr, i) { | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
| } | ||
| function _toConsumableArray(arr) { | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
| } | ||
| function _arrayWithoutHoles(arr) { | ||
| if (Array.isArray(arr)) { | ||
| for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
| } | ||
@@ -42,17 +38,17 @@ | ||
| function _iterableToArray(iter) { | ||
| if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
| if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
| } | ||
| function _iterableToArrayLimit(arr, i) { | ||
| if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
| return; | ||
| } | ||
| var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
| if (_i == null) return; | ||
| var _arr = []; | ||
| var _n = true; | ||
| var _d = false; | ||
| var _e = undefined; | ||
| var _s, _e; | ||
| try { | ||
| for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
| for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
| _arr.push(_s.value); | ||
@@ -76,8 +72,25 @@ | ||
| function _unsupportedIterableToArray(o, minLen) { | ||
| if (!o) return; | ||
| if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
| var n = Object.prototype.toString.call(o).slice(8, -1); | ||
| if (n === "Object" && o.constructor) n = o.constructor.name; | ||
| if (n === "Map" || n === "Set") return Array.from(o); | ||
| if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
| } | ||
| function _arrayLikeToArray(arr, len) { | ||
| if (len == null || len > arr.length) len = arr.length; | ||
| for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| function _nonIterableSpread() { | ||
| throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
| 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 _nonIterableRest() { | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
| } | ||
@@ -84,0 +97,0 @@ |
+30
-17
@@ -1,6 +0,6 @@ | ||
| // Version 1.0.3 jerrypick - https://github.com/vasturiano/jerrypick | ||
| // Version 1.0.4 jerrypick - https://github.com/vasturiano/jerrypick | ||
| (function (global, factory) { | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
| typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
| (global = global || self, factory(global.jerrypick = {})); | ||
| (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jerrypick = {})); | ||
| }(this, (function (exports) { 'use strict'; | ||
@@ -24,15 +24,11 @@ | ||
| function _slicedToArray(arr, i) { | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
| } | ||
| function _toConsumableArray(arr) { | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
| } | ||
| function _arrayWithoutHoles(arr) { | ||
| if (Array.isArray(arr)) { | ||
| for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
| } | ||
@@ -45,17 +41,17 @@ | ||
| function _iterableToArray(iter) { | ||
| if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
| if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
| } | ||
| function _iterableToArrayLimit(arr, i) { | ||
| if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
| return; | ||
| } | ||
| var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
| if (_i == null) return; | ||
| var _arr = []; | ||
| var _n = true; | ||
| var _d = false; | ||
| var _e = undefined; | ||
| var _s, _e; | ||
| try { | ||
| for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
| for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
| _arr.push(_s.value); | ||
@@ -79,8 +75,25 @@ | ||
| function _unsupportedIterableToArray(o, minLen) { | ||
| if (!o) return; | ||
| if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
| var n = Object.prototype.toString.call(o).slice(8, -1); | ||
| if (n === "Object" && o.constructor) n = o.constructor.name; | ||
| if (n === "Map" || n === "Set") return Array.from(o); | ||
| if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
| } | ||
| function _arrayLikeToArray(arr, len) { | ||
| if (len == null || len > arr.length) len = arr.length; | ||
| for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| function _nonIterableSpread() { | ||
| throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
| 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 _nonIterableRest() { | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
| } | ||
@@ -87,0 +100,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"jerrypick.js","sources":["../src/index.js"],"sourcesContent":["const pluck = (obj, keys) =>\n Object.assign({}, ...keys.map(key => ({ [key]: obj[key] })));\n\nconst omit = (obj, keys) => {\n const keySet = new Set(keys);\n\n return Object.assign(\n {},\n ...Object.entries(obj)\n .filter(([key]) => !keySet.has(key))\n .map(([key, val]) => ({ [key]: val }))\n );\n};\n\nexport { pluck, omit };\n"],"names":["pluck","obj","keys","Object","assign","map","key","omit","keySet","Set","entries","filter","has","val"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,GAAD,EAAMC,IAAN;EAAA,SACZC,MAAM,CAACC,MAAP,OAAAD,MAAM,GAAQ,EAAR,4BAAeD,IAAI,CAACG,GAAL,CAAS,UAAAC,GAAG;EAAA,+BAAQA,GAAR,EAAcL,GAAG,CAACK,GAAD,CAAjB;EAAA,GAAZ,CAAf,GADM;EAAA;;MAGRC,IAAI,GAAG,SAAPA,IAAO,CAACN,GAAD,EAAMC,IAAN,EAAe;EAC1B,MAAMM,MAAM,GAAG,IAAIC,GAAJ,CAAQP,IAAR,CAAf;EAEA,SAAOC,MAAM,CAACC,MAAP,OAAAD,MAAM,GACX,EADW,4BAERA,MAAM,CAACO,OAAP,CAAeT,GAAf,EACAU,MADA,CACO;EAAA;EAAA,QAAEL,GAAF;;EAAA,WAAW,CAACE,MAAM,CAACI,GAAP,CAAWN,GAAX,CAAZ;EAAA,GADP,EAEAD,GAFA,CAEI;EAAA;EAAA,QAAEC,GAAF;EAAA,QAAOO,GAAP;;EAAA,+BAAoBP,GAApB,EAA0BO,GAA1B;EAAA,GAFJ,CAFQ,GAAb;EAMD;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"jerrypick.js","sources":["../src/index.js"],"sourcesContent":["const pluck = (obj, keys) =>\n Object.assign({}, ...keys.map(key => ({ [key]: obj[key] })));\n\nconst omit = (obj, keys) => {\n const keySet = new Set(keys);\n\n return Object.assign(\n {},\n ...Object.entries(obj)\n .filter(([key]) => !keySet.has(key))\n .map(([key, val]) => ({ [key]: val }))\n );\n};\n\nexport { pluck, omit };\n"],"names":["pluck","obj","keys","Object","assign","map","key","omit","keySet","Set","entries","filter","has","val"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,GAAD,EAAMC,IAAN;EAAA,SACZC,MAAM,CAACC,MAAP,OAAAD,MAAM,GAAQ,EAAR,4BAAeD,IAAI,CAACG,GAAL,CAAS,UAAAC,GAAG;EAAA,+BAAQA,GAAR,EAAcL,GAAG,CAACK,GAAD,CAAjB;EAAA,GAAZ,CAAf,GADM;EAAA;;MAGRC,IAAI,GAAG,SAAPA,IAAO,CAACN,GAAD,EAAMC,IAAN,EAAe;EAC1B,MAAMM,MAAM,GAAG,IAAIC,GAAJ,CAAQP,IAAR,CAAf;EAEA,SAAOC,MAAM,CAACC,MAAP,OAAAD,MAAM,GACX,EADW,4BAERA,MAAM,CAACO,OAAP,CAAeT,GAAf,EACAU,MADA,CACO;EAAA;EAAA,QAAEL,GAAF;;EAAA,WAAW,CAACE,MAAM,CAACI,GAAP,CAAWN,GAAX,CAAZ;EAAA,GADP,EAEAD,GAFA,CAEI;EAAA;EAAA,QAAEC,GAAF;EAAA,QAAOO,GAAP;;EAAA,+BAAoBP,GAApB,EAA0BO,GAA1B;EAAA,GAFJ,CAFQ,GAAb;EAMD;;;;;;;;;;;"} |
@@ -1,2 +0,2 @@ | ||
| // Version 1.0.3 jerrypick - https://github.com/vasturiano/jerrypick | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).jerrypick={})}(this,(function(t){"use strict";function e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t.omit=function(t,o){var i=new Set(o);return Object.assign.apply(Object,[{}].concat(n(Object.entries(t).filter((function(t){var e=r(t,1)[0];return!i.has(e)})).map((function(t){var n=r(t,2);return e({},n[0],n[1])})))))},t.pluck=function(t,r){return Object.assign.apply(Object,[{}].concat(n(r.map((function(r){return e({},r,t[r])})))))},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
| // Version 1.0.4 jerrypick - https://github.com/vasturiano/jerrypick | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jerrypick={})}(this,(function(t){"use strict";function e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(t,e)||o(t,e)||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 i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(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 o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}t.omit=function(t,o){var i=new Set(o);return Object.assign.apply(Object,[{}].concat(n(Object.entries(t).filter((function(t){var e=r(t,1)[0];return!i.has(e)})).map((function(t){var n=r(t,2);return e({},n[0],n[1])})))))},t.pluck=function(t,r){return Object.assign.apply(Object,[{}].concat(n(r.map((function(r){return e({},r,t[r])})))))},Object.defineProperty(t,"__esModule",{value:!0})})); |
+28
-15
@@ -17,15 +17,11 @@ function _defineProperty(obj, key, value) { | ||
| function _slicedToArray(arr, i) { | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
| return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
| } | ||
| function _toConsumableArray(arr) { | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
| return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
| } | ||
| function _arrayWithoutHoles(arr) { | ||
| if (Array.isArray(arr)) { | ||
| for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
| } | ||
@@ -38,17 +34,17 @@ | ||
| function _iterableToArray(iter) { | ||
| if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
| if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
| } | ||
| function _iterableToArrayLimit(arr, i) { | ||
| if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
| return; | ||
| } | ||
| var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
| if (_i == null) return; | ||
| var _arr = []; | ||
| var _n = true; | ||
| var _d = false; | ||
| var _e = undefined; | ||
| var _s, _e; | ||
| try { | ||
| for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
| for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
| _arr.push(_s.value); | ||
@@ -72,8 +68,25 @@ | ||
| function _unsupportedIterableToArray(o, minLen) { | ||
| if (!o) return; | ||
| if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
| var n = Object.prototype.toString.call(o).slice(8, -1); | ||
| if (n === "Object" && o.constructor) n = o.constructor.name; | ||
| if (n === "Map" || n === "Set") return Array.from(o); | ||
| if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
| } | ||
| function _arrayLikeToArray(arr, len) { | ||
| if (len == null || len > arr.length) len = arr.length; | ||
| for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
| return arr2; | ||
| } | ||
| function _nonIterableSpread() { | ||
| throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
| 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 _nonIterableRest() { | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
| throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
| } | ||
@@ -80,0 +93,0 @@ |
+10
-10
| { | ||
| "name": "jerrypick", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4", | ||
| "description": "Pluck and omit properties from a JS object", | ||
@@ -38,13 +38,13 @@ "unpkg": "dist/jerrypick.min.js", | ||
| "devDependencies": { | ||
| "@babel/core": "^7.8.7", | ||
| "@babel/plugin-proposal-class-properties": "^7.8.3", | ||
| "@babel/plugin-proposal-object-rest-spread": "^7.8.3", | ||
| "@babel/preset-env": "^7.8.7", | ||
| "@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", | ||
| "rimraf": "^3.0.2", | ||
| "rollup": "^2.1.0", | ||
| "rollup-plugin-babel": "^4.4.0", | ||
| "rollup-plugin-dts": "^1.3.0", | ||
| "rollup-plugin-terser": "^5.3.0", | ||
| "typescript": "^3.8.3" | ||
| "rollup": "^2.47.0", | ||
| "rollup-plugin-dts": "^3.0.1", | ||
| "rollup-plugin-terser": "^7.0.2", | ||
| "typescript": "^4.2.4" | ||
| } | ||
| } |
17228
19.91%295
10.9%