{"id":32118649,"url":"https://github.com/oliverbrotchie/optionals","last_synced_at":"2026-02-19T02:02:01.907Z","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":194,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-20T22:07:37.393Z","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-23T20:55:28.000Z","updated_at":"2025-08-15T13:50:46.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,"purl":"pkg:github/OliverBrotchie/optionals","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverBrotchie%2Foptionals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29600844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"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":["deno","error-handling","rust","typescript"],"created_at":"2025-10-20T17:29:05.182Z","updated_at":"2026-02-19T02:02:01.902Z","avatar_url":"https://github.com/OliverBrotchie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"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"}