{"id":13801483,"url":"https://github.com/OliverBrotchie/optionals","last_synced_at":"2025-05-13T11:31:12.393Z","repository":{"id":46652001,"uuid":"409741256","full_name":"OliverBrotchie/optionals","owner":"OliverBrotchie","description":"Rust-like error handling and options for TypeScript and Deno!","archived":false,"fork":false,"pushed_at":"2024-09-09T16:05:31.000Z","size":133,"stargazers_count":189,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T14:17:13.797Z","etag":null,"topics":["deno","error-handling","rust","typescript"],"latest_commit_sha":null,"homepage":"","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/OliverBrotchie.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}},"created_at":"2021-09-23T20:55:28.000Z","updated_at":"2025-03-20T14:40:34.000Z","dependencies_parsed_at":"2024-01-05T21:00:29.225Z","dependency_job_id":"3dc827cb-ab40-4494-ac04-410dfbae1a0a","html_url":"https://github.com/OliverBrotchie/optionals","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.12903225806451613","last_synced_commit":"dd58d6eead5d0a897e19c44ab8cb2df01e6dfc34"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverBrotchie%2Foptionals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverBrotchie%2Foptionals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverBrotchie%2Foptionals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverBrotchie%2Foptionals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OliverBrotchie","download_url":"https://codeload.github.com/OliverBrotchie/optionals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932827,"owners_count":21986456,"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":["deno","error-handling","rust","typescript"],"created_at":"2024-08-04T00:01:23.294Z","updated_at":"2025-05-13T11:31:09.922Z","avatar_url":"https://github.com/OliverBrotchie.png","language":"TypeScript","funding_links":[],"categories":["Modules"],"sub_categories":["Utils"],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ch1\u003e\u003ccode\u003eOptionals\u003c/code\u003e\u003c/h1\u003e\n\n\u003cstrong\u003eRust-like error handling and options for TypeScript, Node and Deno!\u003c/strong\u003e\n\n\u003c/div\u003e\n\nThis module allows you to remove `null` and `undefined` from your projects with the help of ES6 Symbols and helper methods. Inspired by Rust's `Option`, `Result` enums.\n\n## Why should you use Optionals?\n\nThe standard practice of returning `null` or `undefined` when no other value can be returned means that there is no simple way to express the difference between a function that has returned \"nothing\" and a `null` return type. There are also no easy ways to handle errors in a functional pattern. Rust's implementation of `Option` and `Result` guarantees correctness by expressly forcing correct result-handling practices.\n\nThis module provides a minimal, fast and simple way to create expressive functions and perform better pattern matching on resulting values! 🚀\n\n## Usage\n\n```ts\n// Result\nimport { Result, Ok, Err } from \"https://deno.land/x/optionals@v2.0.2/mod.ts\";\n\n// Option\nimport {\n  Option,\n  Some,\n  None,\n} from \"https://deno.land/x/optionals@v2.0.2/mod.ts\";\n```\n\n## Documentation\n\nPlease find further documentation on the [doc](https://doc.deno.land/https://deno.land/x/optionals@v2.0.2/mod.ts) page!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOliverBrotchie%2Foptionals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOliverBrotchie%2Foptionals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOliverBrotchie%2Foptionals/lists"}