@iterable-iterator/map
Advanced tools
+13
-12
| { | ||
| "name": "@iterable-iterator/map", | ||
| "description": "Iterable mapping functions for JavaScript", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "license": "AGPL-3.0", | ||
@@ -25,3 +25,3 @@ "author": "make-github-pseudonymous-again", | ||
| "source": "src/index.js", | ||
| "main": "dist/index.js", | ||
| "main": "dist/index.cjs", | ||
| "module": "dist/index.module.js", | ||
@@ -35,3 +35,3 @@ "esmodule": "dist/index.modern.js", | ||
| "umd": "./dist/index.umd.js", | ||
| "require": "./dist/index.js", | ||
| "require": "./dist/index.cjs", | ||
| "default": "./dist/index.modern.js" | ||
@@ -47,2 +47,3 @@ } | ||
| "build-gh-pages": "npm run build-docs", | ||
| "ci:build": "npm run build", | ||
| "ci:test": "npm run lint-config && npm run lint && npm run cover", | ||
@@ -68,9 +69,9 @@ "commit-msg": "commitlint --edit", | ||
| "devDependencies": { | ||
| "@babel/core": "7.14.3", | ||
| "@babel/preset-env": "7.14.4", | ||
| "@babel/register": "7.13.16", | ||
| "@babel/core": "7.14.6", | ||
| "@babel/preset-env": "7.14.7", | ||
| "@babel/register": "7.14.5", | ||
| "@commitlint/cli": "12.1.4", | ||
| "@functional-abstraction/operator": "2.0.0", | ||
| "@iterable-iterator/list": "1.0.0", | ||
| "@iterable-iterator/range": "2.0.0", | ||
| "@functional-abstraction/operator": "3.0.0", | ||
| "@iterable-iterator/list": "1.0.1", | ||
| "@iterable-iterator/range": "2.0.1", | ||
| "@js-library/commitlint-config": "0.0.4", | ||
@@ -81,3 +82,3 @@ "ava": "3.15.0", | ||
| "babel-preset-power-assert": "3.0.0", | ||
| "c8": "7.7.2", | ||
| "c8": "7.7.3", | ||
| "esdoc": "1.1.0", | ||
@@ -89,4 +90,4 @@ "esdoc-ecmascript-proposal-plugin": "1.0.0", | ||
| "fixpack": "4.0.0", | ||
| "husky": "6.0.0", | ||
| "lint-staged": "11.0.0", | ||
| "husky": "7.0.1", | ||
| "lint-staged": "11.0.1", | ||
| "microbundle": "0.13.1", | ||
@@ -93,0 +94,0 @@ "np": "7.5.0", |
| function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r,t){var n="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(n)return(n=n.call(r)).next.bind(n);if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(r))||t&&r&&"number"==typeof r.length){n&&(r=n);var a=0;return function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t=regeneratorRuntime.mark(n);function n(e,n){var a,o,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=r(n);case 1:if((o=a()).done){t.next=7;break}return i=o.value,t.next=5,e(i);case 5:t.next=1;break;case 7:case"end":return t.stop()}},t)}var a=regeneratorRuntime.mark(o);function o(e,t){var n,o,i;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n=r(t);case 1:if((o=n()).done){a.next=7;break}return i=o.value,a.next=5,e[i];case 5:a.next=1;break;case 7:case"end":return a.stop()}},a)}var i=regeneratorRuntime.mark(u);function u(e,t){var n,a,o;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:n=r(t);case 1:if((a=n()).done){i.next=7;break}return o=a.value,i.next=5,e.apply(void 0,o);case 5:i.next=1;break;case 7:case"end":return i.stop()}},i)}exports.map=n,exports.pick=o,exports.starmap=u; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sources":["../src/map.js","../src/pick.js","../src/starmap.js"],"sourcesContent":["/**\n * Applies a given callable to each of the elements of the input iterable.\n *\n * @example\n * // return [ 0 , 1 , 4 , 9 ]\n * list( map( x => x**2 , range( 4 ) ) ) ;\n *\n * @param {Function} callable - The callable to use.\n * @param {Iterable} iterable - The input iterable.\n * @returns {IterableIterator}\n */\nexport default function* map(callable, iterable) {\n\tfor (const item of iterable) {\n\t\tyield callable(item);\n\t}\n}\n","/**\n * Yields some of the properties of the input object. The properties to yield\n * are designated by the input iterable.\n *\n * @example\n * // returns [ 'a' , 'e' , 'c' ]\n * list( pick( 'abcde' , [ 0 , 4 , 2 ] ) ) ;\n *\n * @param {Object} object - The input object.\n * @param {Iterable} iterable - The input iterable.\n * @returns {IterableIterator}\n */\nexport default function* pick(object, iterable) {\n\tfor (const key of iterable) {\n\t\tyield object[key];\n\t}\n}\n","/**\n * Same as {@link map} but allows multiple arguments callable functions.\n *\n * @example\n * // return [ 0 , 1 , 4 , 9 ]\n * list( starmap( ( x , y ) => x*y , zip( range( 4 ) , range( 4 ) ) ) ;\n *\n * @param {Function} callable - The callable to use.\n * @param {Iterable} iterable - The input iterable.\n * @returns {Iterator}\n */\nexport default function* starmap(callable, iterable) {\n\tfor (const args of iterable) {\n\t\tyield callable(...args);\n\t}\n}\n"],"names":["map","callable","iterable","item","pick","object","key","starmap","args"],"mappings":"o1BAWyBA,YAAAA,EAAIC,EAAUC,gGACnBA,0CAClB,OADUC,mBACJF,EAASE,GAFF,0FCCUC,YAAAA,EAAKC,EAAQH,gGACnBA,0CACjB,OADUI,mBACJD,EAAOC,GAFA,0FCDUC,YAAAA,EAAQN,EAAUC,gGACvBA,0CAClB,OADUM,mBACJP,eAAYO,GAFL"} |
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
-25%512229
-1.92%12
-14.29%27
-22.86%