Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Option): ✨ Add new methods for Option #57

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Sstark97
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

In this PR I have added two methods for the Option cutie:

  • ofSome: Creates an Option with a safe value, so it will return the subtype Some
  • ofNone: Creates an Option with no value, so it will return the subtype None
const some = Option.ofSome(5);
some.match(console.log, () => console.log('none')); // 5

const none = Option.ofNone();
none.match(console.log, () => console.log('none')); // none

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

What gif best describes this PR or how it makes you feel?

happy

@Marius9595 Marius9595 merged commit 6cbbb0a into lean-mind:beta Nov 12, 2024
3 checks passed
@Marius9595 Marius9595 linked an issue Nov 12, 2024 that may be closed by this pull request
2 tasks
Copy link

🎉 This PR is included in version 1.3.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More methods for Option
2 participants