Skip to content

Marius9595/fix compilation #54

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

Merged
merged 2 commits into from
Nov 1, 2024
Merged

Marius9595/fix compilation #54

merged 2 commits into from
Nov 1, 2024

Conversation

Marius9595
Copy link
Collaborator

@Marius9595 Marius9595 commented Nov 1, 2024

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

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

Description

This pull request includes several changes to improve the handling of monads in the @leanmind/monads package, specifically focusing on error handling in the Try monad and updating the build process.

Build Process Updates:
package.json: Updated the main and module fields to point to dist/cjs/index.js and dist/esm/index.js respectively. Modified the build scripts to compile both CommonJS and ES modules. [1] [2]
Try Monad Error Handling:
src/try/try.ts: Updated the from method to ensure that a Failure instance is always created with an Error object. Modified the Failure class to use a default type of Error. Removed the static NO_ERROR_PROVIDED instance. [1] [2] [3]
src/try/try.test.ts: Adjusted the test cases to reflect the changes in error handling, ensuring that Failure instances are created with an Error object.

Added/updated tests?

We encourage you to keep the quality of the code by creating test.

  • Yes: I updated test that has reference for static variable from Failure that was removed
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

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

alt_text

@Marius9595 Marius9595 requested a review from myugen November 1, 2024 16:49
@Marius9595 Marius9595 linked an issue Nov 1, 2024 that may be closed by this pull request
2 tasks
@Marius9595 Marius9595 self-assigned this Nov 1, 2024
@Marius9595 Marius9595 merged commit fcd2839 into beta Nov 1, 2024
3 checks passed
@Marius9595 Marius9595 deleted the Marius9595/fix-compilation branch November 1, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Fix "Try not defined"
1 participant