{"id":16485293,"url":"https://github.com/morganconrad/fobu","last_synced_at":"2026-06-08T18:31:04.362Z","repository":{"id":71409779,"uuid":"159247666","full_name":"MorganConrad/fobu","owner":"MorganConrad","description":"YA functional utilities for JavaScript Objects, mimicking ES6 Array methods.","archived":false,"fork":false,"pushed_at":"2020-01-28T20:15:58.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T00:11:45.121Z","etag":null,"topics":["filter","foreach","functional-programming","javascript","map","object","reduce"],"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/MorganConrad.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-26T23:40:00.000Z","updated_at":"2020-12-15T16:18:07.000Z","dependencies_parsed_at":"2023-03-06T00:45:24.911Z","dependency_job_id":null,"html_url":"https://github.com/MorganConrad/fobu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MorganConrad/fobu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffobu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffobu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffobu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffobu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorganConrad","download_url":"https://codeload.github.com/MorganConrad/fobu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffobu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34075950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["filter","foreach","functional-programming","javascript","map","object","reduce"],"created_at":"2024-10-11T13:25:15.119Z","updated_at":"2026-06-08T18:31:04.344Z","avatar_url":"https://github.com/MorganConrad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/MorganConrad/fobu.png)](http://travis-ci.org/MorganConrad/fobu)\n[![License](http://img.shields.io/badge/license-MIT-A31F34.svg)](https://github.com/MorganConrad/fobu)\n[![NPM Downloads](http://img.shields.io/npm/dm/fobu.svg)](https://www.npmjs.org/package/fobu)\n[![Known Vulnerabilities](https://snyk.io/test/github/morganconrad/fobu/badge.svg)](https://snyk.io/test/github/morganconrad/fobu)\n[![Coverage Status](https://coveralls.io/repos/github/MorganConrad/fobu/badge.svg)](https://coveralls.io/github/MorganConrad/fobu)\n\n# fobu\nYet another set of utilities to do \"functional programming\" on JavaScript Objects.  \nYou can find many other versions of these online, but I like mine better :-).\n\nBasically, allows you to use the ES6 array methods like `map()` and `reduce()` on objects.\n\nMaybe you will find this useful.  I mainly put it on GitHub so I can easily cut and paste these into other code.\n\n## API\n\nAll methods take the object as the first argument, and the user function (or \"predicate\") to be applied as the 2nd.\nThe method will loop over the key/value pairs in the object, as determined by `Object.keys(theObject)`.\n\nThe user function will usually be called with three arguments, much like the array versions.\n - The value\n - the key (for the corresponding array versions, this is the index)\n - the entire object\n\nFor `reduce() and `reduceRight()`, the user function takes an additional `acc` first argument. \n\n### every(object, predicate)\nTests if every key/value pair passes `predicate(value, key, object)`.  Returns true or false, and will \"short-circuit\".\n\n### find(object, predicate)\nFinds the first key/value pair that passes `predicate(value, key, object)`.\n - returns it as an array: [key, value]\n\n### filter(object, predicate)\nCreates a new object with (shallow) copies of all key/value pairs that pass `predicate(value, key, object)`.\n\n### forEach(object, fn)\nCalls fn(value, key, object) for every key/value pair.\n\n### map(object, fn)\nReturns a new result object, with result[key] = fn(object[key], key, object).\n\n### reduce(object, fn, initialValue)\n\n### reduceRight(object, fn, initialValue)\n\n### some(object, predicate)\nTests if any key/value pair passes `predicate(value, key, object)`.  Returns true or false, and will \"short-circuit\".\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Ffobu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganconrad%2Ffobu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Ffobu/lists"}