{"id":16096015,"url":"https://github.com/mrdrogdrog/optional","last_synced_at":"2025-08-01T15:39:33.230Z","repository":{"id":40592468,"uuid":"506695431","full_name":"mrdrogdrog/optional","owner":"mrdrogdrog","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-15T01:53:41.000Z","size":8375,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T02:35:56.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/mrdrogdrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-23T15:32:12.000Z","updated_at":"2025-03-08T08:07:52.000Z","dependencies_parsed_at":"2024-02-04T19:40:42.915Z","dependency_job_id":"8c27dd7a-87a2-45f2-91b7-08b3c75ce7e8","html_url":"https://github.com/mrdrogdrog/optional","commit_stats":{"total_commits":345,"total_committers":2,"mean_commits":172.5,"dds":"0.10434782608695647","last_synced_commit":"9b4d74bf1f5d3e7f62cb2ea42b8f8222339a0585"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdrogdrog%2Foptional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdrogdrog%2Foptional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdrogdrog%2Foptional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdrogdrog%2Foptional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrdrogdrog","download_url":"https://codeload.github.com/mrdrogdrog/optional/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872428,"owners_count":20361478,"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-09T17:10:09.303Z","updated_at":"2025-03-17T17:31:15.999Z","avatar_url":"https://github.com/mrdrogdrog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2023 Tilman Vatteroth\n\nSPDX-License-Identifier: CC-BY-SA-4.0\n--\u003e\n\n# Optional\n\nThis library provides java-like optionals to filter, map and process values depending on if they're present or not.\nI created this lib because I like functional programming think that Optionals are a good way to clean up code.\nYes, I know that typescript has the optional operator (`?`) but sometimes this isn't enough, like when I want to filter values or fail instantly if a value is empty.\n\n## How to use\n\nInstall it with yarn or npm using `yarn add @mrdrogdrog/optional` or `npm i @mrdrogdrog/optional`.\n\n## API\n\nIn addition to the [traditional java-like optional functions](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html) I added some more useful functions like\n[isEmpty](https://github.com/mrdrogdrog/optional/blob/main/docs/Optional.md#isempty), [orThrow](https://github.com/mrdrogdrog/optional/blob/main/docs/Optional.md#orthrow) and [guard](https://github.com/mrdrogdrog/optional/blob/main/docs/Optional.md#guard).\nCheck the [docs](https://github.com/mrdrogdrog/optional/tree/main/docs) folder for the whole API.\n\n## Build\nYou can build this lib by running `yarn build`.\nRun tests with `yarn test`.\nTo check the code style use `yarn lint`.\n\n## Contributions\n\nI welcome contributions!\nHave a look at the [contribution docs](CONTRIBUTING.md) to find out how you can help.\n\n# License\n\nLicensed under MIT. For our list of contributors, see [AUTHORS](AUTHORS).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdrogdrog%2Foptional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrdrogdrog%2Foptional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdrogdrog%2Foptional/lists"}