{"id":17736688,"url":"https://github.com/parro-it/map-iterable","last_synced_at":"2025-03-31T19:17:14.909Z","repository":{"id":57291145,"uuid":"68151414","full_name":"parro-it/map-iterable","owner":"parro-it","description":"Array.prototype.map analog for iterables.","archived":false,"fork":false,"pushed_at":"2020-05-09T19:35:58.000Z","size":2955,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T07:28:31.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parro-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-13T22:09:05.000Z","updated_at":"2019-07-09T11:56:07.000Z","dependencies_parsed_at":"2022-09-01T14:01:10.144Z","dependency_job_id":null,"html_url":"https://github.com/parro-it/map-iterable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fmap-iterable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fmap-iterable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fmap-iterable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Fmap-iterable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parro-it","download_url":"https://codeload.github.com/parro-it/map-iterable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523847,"owners_count":20791444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T00:24:04.476Z","updated_at":"2025-03-31T19:17:14.891Z","avatar_url":"https://github.com/parro-it.png","language":"JavaScript","readme":"# map-iterable\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/parro-it/map-iterable.svg)](https://greenkeeper.io/)\n\n\u003e Array.prototype.map analog for iterables.\n\n[![Travis Build Status](https://img.shields.io/travis/parro-it/map-iterable/master.svg)](http://travis-ci.org/parro-it/map-iterable)\n[![NPM module](https://img.shields.io/npm/v/map-iterable.svg)](https://npmjs.org/package/map-iterable)\n[![NPM downloads](https://img.shields.io/npm/dt/map-iterable.svg)](https://npmjs.org/package/map-iterable)\n\nThe map() method creates a new iterable with the results of calling a provided\nfunction on every element in given iterable.\n\nYou can omit the data argument and you get a function that map over the provided\nfunction.\n\n# Installation\n\n```bash\nnpm install --save map-iterable\n```\n\n# Examples\n\n```js\nconst map = require(\"map-iterable\");\nconst numbers = [1, 4, 9];\nconst roots = Array.from(map(Math.sqrt, numbers));\n// roots is now [1, 2, 3], numbers is still [1, 4, 9]\n```\n\n**using partial apply**\n\n```js\nconst map = require(\"map-iterable\");\nconst mapSqrt = map(Math.sqrt);\nconst numbers = [1, 4, 9];\ncons;\nconst roots = Array.from(mapSqrt(numbers));\n// roots is now [1, 2, 3], numbers is still [1, 4, 9]\n```\n\n# API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n## map\n\nCreates a new iterable with the results of calling `transform` function on every\nelement in `data` iterable. If you omit the data argument return a unary\nfunction that accept the data argument and map over the provided function.\n\n**Parameters**\n\n* `transform`\n  **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**\n  a function that return an element of the new Iterable, receiving as arguments:\n  . currentValue - The current element being processed in the iterable. index -\n  The index of the current element being processed in the iterable.\n* `data` **Iterable** The source iterable to iterate over.\n\nReturns **Iterable** A new Iterable over results of the transform function.\n\n# License\n\nThe MIT License (MIT)\n\n© 2017 Andrea Parodi\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Fmap-iterable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparro-it%2Fmap-iterable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Fmap-iterable/lists"}