Skip to content

Releases: seangwright/typescript-functional-extensions

v2.0.0 - Expand fetch helpers, new Result methods

07 May 01:52
Compare
Choose a tag to compare

What's Changed

fetchResponse

fetchResponse now returns the Response instead of Unit, giving the consumer more context to inform their next steps. This is a breaking change.

The error handlers for fetchResponse and fetchJsonResponse can now return Promises. This can be helpful if, for example, an API request returns a 400 response with a JSON body that needs to be unwrapped with response.json().

tapEither

Result.tapEither, Result.tapEitherAsync, and ResultAsync.tapEither can all be used to perform a side effect action independent of the result succeeding or failing. This can be useful if, for example, the state of a component (ex: isLoading) should be toggled when the result of an operation completes - either in a success or failure scenario.

bindFailure

Result.bindFailure, Result.bindFailureAsync, and ResultAsync.bindFailure can be used to convert a failed result to another result. This covers the combination of bind and mapFailure.

Full Changelog: v1.4.0...v2.0.0

v1.4.0 - Native ESM support 🧘🏽‍♀️, Vitest, and Utility Functions

28 Sep 02:52
Compare
Choose a tag to compare

What's Changed

You can now use typescript-functional-extensions directly from Unpkg as mentioned in the README

Docs have been updated in the README to include the full list of module exports, the size of these modules, and better examples of how the monads in the library might be used.

Work has also begun on more detailed docs for each monad that complement the library's unit tests.

All unit tests have been migrated from Jest to Vitest for faster test runs and a much simpler test configuration when using ESM.

A few new utilities have been added to the library as pure functions instead of methods on the monads so that bundlers can more easily tree-shake them away if they are unused.

import {
  noop,
  zeroAsNone,
  emptyStringAsNone,
  emptyOrWhiteSpaceStringAsNone,
} from 'typescript-functional-extensions';

A few methods missing from MaybeAsync have been added:

  • getValueOrDefault
  • getValueOrThrow

Full Changelog: v1.3.0...v1.4.0

v1.3.0 - 🛡 Type Guards for Result to access error and value

03 Jun 01:47
Compare
Choose a tag to compare

What's Changed

  • feat(Result): Expose value or error if it is safe to expose by @GregOnNet in #10

To see how this feature works, check out the new tests for Result

Full Changelog: v1.2.0...v1.3.0

v1.2.0 - Result.Combine 🐱‍🏍

23 Apr 14:35
Compare
Choose a tag to compare

What's Changed

  • feat(result): support combining multiple results by @GregOnNet in #8

New Contributors

Full Changelog: v1.1.1...v1.2.0

v1.1.1 - GitHub Actions integration ⚙

23 Apr 14:09
Compare
Choose a tag to compare

This is a non-functional update that adds GitHub Actions publishing to the repository and updates the npm package metadata.

v1.1.0 - Pipe operator

11 Jan 19:18
bf9e148
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.1...v1.1.0

v1.1.0-beta.2 - Pipe operator

10 Jan 23:09
ff85358
Compare
Choose a tag to compare
Pre-release

Test release for adding .pipe() method to all monads
#6

v1.0.1 - CommonJs support

31 Dec 15:27
ff85358
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Initial Release 🎉

27 Dec 18:52
Compare
Choose a tag to compare
  • Add tests for all types/methods
  • Add jsdoc comments for all public methods for all types
  • Update README.md with examples

v1.0.0-beta.4

11 Nov 04:01
Compare
Choose a tag to compare
v1.0.0-beta.4 Pre-release
Pre-release
  • Add Maybe.tryLast
    • static tryLast<TValue>(values: TValue[]): Maybe<TValue>;
    • static tryLast<TValue>(values: Some<TValue>[], predicate: PredicateOfT<Some<TValue>>): Maybe<TValue>;