{"id":19336418,"url":"https://github.com/syarul/monads-maybe","last_synced_at":"2025-02-24T07:44:28.740Z","repository":{"id":57301388,"uuid":"104626088","full_name":"syarul/monads-maybe","owner":"syarul","description":"A simple wrapper of javascript statement branching that provide safe error handling and test friendly","archived":false,"fork":false,"pushed_at":"2017-09-24T10:09:40.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T10:53:40.610Z","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/syarul.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}},"created_at":"2017-09-24T07:12:45.000Z","updated_at":"2017-09-24T09:52:59.000Z","dependencies_parsed_at":"2022-09-10T21:11:55.148Z","dependency_job_id":null,"html_url":"https://github.com/syarul/monads-maybe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syarul%2Fmonads-maybe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syarul%2Fmonads-maybe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syarul%2Fmonads-maybe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syarul%2Fmonads-maybe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syarul","download_url":"https://codeload.github.com/syarul/monads-maybe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240441872,"owners_count":19801791,"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-11-10T03:11:01.419Z","updated_at":"2025-02-24T07:44:28.678Z","avatar_url":"https://github.com/syarul.png","language":"JavaScript","readme":"# monads-maybe\n\nA simple wrapper of javascript statement branching that provide safe error handling and test friendly\n\n## Usage\n\n```npm install monads-maybe```\n\n```javascript\n\nimport mayBe from 'monads-maybe'\n\nconst arr = ['one', 'two', 'three']\n\nconst log = console.log.bind(console)\n\nconst hasOne = arr.indexOf('one')\n\nlet isOne = mayBe.is(~hasOne, 'has one')\n\nlog(isOne) // has one\n\nisOne = mayBe.not(~hasOne, 'has one')\n\nlog(isOne) // false\n\nconst hasFour = arr.indexOf('four')\n\nlet isFour = mayBe.not(~hasFour, 'has no four')\n\nlog(isFour) // has no four\n\nisFour = mayBe.is(~hasFour, isFour = 'hello', isFour = 'world')\n\nlog(isFour) // world\n\nisFour = mayBe.so(~hasFour, true, false)\n\nlog(isFour) // false\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Shahrul Nizam Selamat\n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyarul%2Fmonads-maybe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyarul%2Fmonads-maybe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyarul%2Fmonads-maybe/lists"}