{"id":15878869,"url":"https://github.com/ticky/fisher-yates-map","last_synced_at":"2026-03-13T14:34:54.596Z","repository":{"id":38265774,"uuid":"94587434","full_name":"ticky/fisher-yates-map","owner":"ticky","description":"🎲 A map implementation which calls the callback for each element in a random order","archived":false,"fork":false,"pushed_at":"2026-03-01T17:46:47.000Z","size":357,"stargazers_count":1,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-03-01T19:49:22.480Z","etag":null,"topics":["fisher-yates","fisher-yates-map","map"],"latest_commit_sha":null,"homepage":"","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/ticky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-06-16T23:08:50.000Z","updated_at":"2024-06-14T03:19:00.000Z","dependencies_parsed_at":"2024-02-04T11:25:24.746Z","dependency_job_id":"829bf074-a5cc-4fde-9338-647442130eee","html_url":"https://github.com/ticky/fisher-yates-map","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ticky/fisher-yates-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Ffisher-yates-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Ffisher-yates-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Ffisher-yates-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Ffisher-yates-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ticky","download_url":"https://codeload.github.com/ticky/fisher-yates-map/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ticky%2Ffisher-yates-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30468356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fisher-yates","fisher-yates-map","map"],"created_at":"2024-10-06T02:42:10.310Z","updated_at":"2026-03-13T14:34:54.565Z","avatar_url":"https://github.com/ticky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fisher-Yates Map\n\n[![npm](https://img.shields.io/npm/v/fisher-yates-map.svg?maxAge=2592000)](https://www.npmjs.com/package/fisher-yates-map) ![fisher-yates-map](https://img.shields.io/npm/l/fisher-yates-map.svg?maxAge=2592000) [![Build Status](https://travis-ci.org/ticky/fisher-yates-map.svg?branch=develop)](https://travis-ci.org/ticky/fisher-yates-map) [![codecov](https://codecov.io/gh/ticky/fisher-yates-map/branch/develop/graph/badge.svg)](https://codecov.io/gh/ticky/fisher-yates-map)\n\nA map implementation which calls the callback for each element in a random order\n\n## Usage\n\n`fyMap` is a simple map function which accepts an array and a callback;\n\n```js\nimport fyMap from 'fisher-yates-map';\n\nconst myArray = ['meow', 'purr', 'nya'];\n\nconst output = fyMap(myArray, (item, index, array) =\u003e {\n  console.log(`cat ${index + 1} ${item}s!`);\n  return `${item}~!`;\n});\n// =\u003e 'cat 2 purrs!'\n// =\u003e 'cat 1 meows!'\n// =\u003e 'cat 3 nyas!'\n\nconsole.log(output);\n// =\u003e ['meow~!', 'purr~!', 'nya~!']\n```\n\nThe output will be the same as calling the equivalent built-in `Array.prototype.map` method, however, each item will be sent to the callback in a random order.\n\n### With Babel Function Bind\n\nIf you're using [`babel-plugin-transform-function-bind`](http://babeljs.io/docs/plugins/transform-function-bind/), you can also call `fyMap` with an alternate syntax;\n\n```js\nconst output = myArray::fyMap((item, index, array) =\u003e {\n  console.log(`cat ${index + 1} ${item}s!`);\n  return `${item}~!`;\n});\n```\n\nMore information about this syntax extension can be found [on Babel's website](http://babeljs.io/docs/plugins/transform-function-bind/).\n\n## Why?\n\nThis could be useful in situations where the order of operations doesn't matter, or you want to enforce that per-item operations not rely on prior results. It could also be useful if you have a large number of operations which you'd like to scatter the application of.\n\n## Caveats\n\n`fyMap` doesn't implement the standard `Array.prototype.map` handling of `this`. If that doesn't work for you, you should probably use something else!\n\nPerformance is also imperfect - if you need something as fast as `Array.prototype.map` or a traditional loop, this isn't it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticky%2Ffisher-yates-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fticky%2Ffisher-yates-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticky%2Ffisher-yates-map/lists"}