{"id":15385990,"url":"https://github.com/gianlucaguarini/cumpa","last_synced_at":"2025-04-15T20:06:07.705Z","repository":{"id":34406131,"uuid":"178547577","full_name":"GianlucaGuarini/cumpa","owner":"GianlucaGuarini","description":"Minimal function composition implementation","archived":false,"fork":false,"pushed_at":"2023-07-20T09:55:44.000Z","size":6671,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-18T07:56:20.321Z","etag":null,"topics":[],"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/GianlucaGuarini.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":"2019-03-30T11:05:20.000Z","updated_at":"2024-07-22T06:19:48.000Z","dependencies_parsed_at":"2024-06-19T12:10:32.951Z","dependency_job_id":"859c9cb2-777a-4b2d-b691-773d8b48eb59","html_url":"https://github.com/GianlucaGuarini/cumpa","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaGuarini%2Fcumpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaGuarini%2Fcumpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaGuarini%2Fcumpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianlucaGuarini%2Fcumpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GianlucaGuarini","download_url":"https://codeload.github.com/GianlucaGuarini/cumpa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241150605,"owners_count":19918353,"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-01T14:46:55.421Z","updated_at":"2025-02-28T12:31:51.492Z","avatar_url":"https://github.com/GianlucaGuarini.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cumpa\n\nMinimal function composition implementation\n\n\u003cimg alt=\"cumpa\" src=\"./cumpa.gif\" width=\"50%\"/\u003e\n\n\u003e `cumpá` in some Italian :it: dialects means `fellow`\n\n[![Build Status][ci-image]][ci-url]\n\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads][npm-downloads-image]][npm-url]\n[![MIT License][license-image]][license-url]\n\n## Usage\n\n```js\nimport compose from 'cumpa'\n\nconst add2 = x =\u003e x + 2\nconst multiplyBy3 = x =\u003e x * 3\n\nconst add2AndMultiplyBy3 = compose(multiplyBy3, add2)\n\nconsole.log(add2AndMultiplyBy3(1)) // ((1 + 2) * 3) = 9\n```\n\n[ci-image]: https://img.shields.io/github/actions/workflow/status/gianlucaguarini/cumpa/test.yml?style=flat-square\n[ci-url]: https://github.com/gianlucaguarini/cumpa/actions\n\n[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square\n\n[license-url]: LICENSE\n\n[npm-version-image]: http://img.shields.io/npm/v/cumpa.svg?style=flat-square\n\n[npm-downloads-image]: http://img.shields.io/npm/dm/cumpa.svg?style=flat-square\n\n[npm-url]: https://npmjs.org/package/cumpa\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [composeRight](#composeright)\n    -   [Parameters](#parameters)\n-   [compose](#compose)\n    -   [Parameters](#parameters-1)\n\n### composeRight\n\nSimilar to compose but performs from left-to-right function composition.\u003cbr/\u003e\n[see also](https://30secondsofcode.org/function#composeright)\n\n#### Parameters\n\n-   `fns` **...\\[[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)]** ) - list of unary fynctions\n\nReturns **any** result of the computation\n\n### compose\n\nPerforms right-to-left function composition.\nUse Array.prototype.reduce() to perform right-to-left function composition.\nThe last (rightmost) function can accept one or more arguments; the remaining functions must be unary.\u003cbr/\u003e\n[source code](https://30secondsofcode.org/function#compose)\n\n#### Parameters\n\n-   `fns` **...\\[[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)]** ) - list of unary fynctions\n\nReturns **any** result of the computation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucaguarini%2Fcumpa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianlucaguarini%2Fcumpa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucaguarini%2Fcumpa/lists"}