Skip to content

Releases: true-myth/true-myth

Release 9.3.1

25 Nov 19:12
b875456

Choose a tag to compare

Identical to v9.3.0; npm was lagging and appeared not to have been published correctly… and then eventually showed up. 🙃

v9.3.0

25 Nov 18:57
2f5e09f

Choose a tag to compare

New features and fixes for True Myth—safe and idiomatic TypeScript types to handle null, error, and async code handling with Maybe, Result, and Task types that are really nice.

Overview

The big new feature is an inspect method and function that allows you to “tap into” a Maybe, Result, or Task to perform side effects safely. This can be helpful for debugging, for adding tracing, or for many other similar things. For example, to debug what value exists in a chain of Maybe operations, you could use the new inspect method like this:

import type Maybe from 'true-myth/maybe';

const log = (value: unknown) => console.log("The value:", value);
const randomInteger = () => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);

const finalMaybe = Maybe.of(randomInteger())
  .inspect(log)
  .map((n) => n % randomInteger())
  .inspect(log)
  .andThen((n) => n % 2 === 0 ? Maybe.just(n / 2) : Maybe.nothing())
  .inspect(log);

For any given run, this will always log two values; it will also log a third when the modulo check passes. The output is the Maybe value.

There are also inspectErr and inspectRejected methods and functions for Result and Task instances respectively.

Changes

🚀 Enhancement

🐛 Bug Fix

📝 Documentation

  • #1155 Fix typo in Task docs (Task.rejecte to Task.reject) (@kbrgl)
  • #1150 Docs: fix jitter example: Delay -> delay (@Zegnat)

🏠 Internal

Committers: 3

v9.2.0

27 Sep 00:32
2dd6d57

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Overview

Adds a flatten helper and method to each of Maybe, Result, and Task to help with the situations where you end up with a nested version of each. For example, with Maybe:

import Maybe from 'true-myth/maybe';

const wrapped = Maybe.of(Maybe.of(123));
console.log(wrapped.toString());  // Just(Just(123))

const flattened = wrapped.flatten();
console.log(flattened.toString()); // Just(123)

Note that the method or function removes only a single layer of wrapping.

Changes

🚀 Enhancement

📝 Documentation

🏠 Internal

Committers: 2

v9.1.0

25 Aug 01:11
8770875

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Overview

v9.1.0 is a fairly full release—thanks to folks for continuing to offer feedback and suggestions for how we can make the library better! This version:

  • Adds Standard Schema support (Guide | API Docs).
  • Adds transposeAll and transposeAny helpers for dealing with arrays of results.
  • Introduces fromJSON functions for Maybe and Result to support round-tripping.
  • Constrains Maybe to accept only non-nullable types at construction, rather than only in the return types.
  • Does some more documentation cleanup.

Changes

🚀 Enhancement

📝 Documentation

🏠 Internal

Committers: 2

v9.0.1

21 May 01:38
f1b10d3

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Overview

Fixes an assignability bug with the PromiseLike interface and continues cleaning up some docs. This one comes entirely from external contributors—thanks, folks!

Changes

🐛 Bug Fix

📝 Documentation

🏠 Internal

Committers: 3

v9.0.0

16 Apr 03:13
9e5b398

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Overview

Now with nicer internals, cleaner public APIs, a brand new docs site! For more details, see the announcement blog post.

Changes

💥 Breaking Change

🚀 Enhancement

📝 Documentation

🏠 Internal

🗑️ Deprecation

Committers: 2

v8.6.0

15 Apr 14:17
341f42b

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Overview

The headlining feature here is making the andThen and orElse functions work more like people intuitively expect them to! See #1003 for details. Additionally, this fixes a long-standing (but easy-to-miss) bug in the behavior of maybe.get.

This final release in the v8.x series includes all the features which will be present on v9.0. To prepare for the v9.0 release, all you need to do is make sure you are on a sufficiently recent version of TypeScript and switch from any deprecated functions to their supported replacements.

Changes

🚀 Enhancement

  • #1003 Feature: generalize inference for andThen and orElse [backport] (@chriskrycho)

🐛 Bug Fix

Committers: 1

Release 8.5.3

09 Apr 17:40
dc38c51

Choose a tag to compare

True Myth provides safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.

Changes

🐛 Bug Fix

Committers: 1

Release 8.5.2

07 Apr 01:25
47e8531

Choose a tag to compare

True Myth provides safe, idiomatic null, error, and async code handling in TypeScript, with Maybe, Result, and Task types that are really nice.

Changes

This mostly comes down to fixing a bug introduced in v8.5.1 in the definition of Strategy, but it brings along some documentation benefits as well.

🐛 Bug Fix

📝 Documentation

Committers: 1

Release 8.5.1

02 Apr 00:53
e857ef9

Choose a tag to compare

True Myth provides safe, idiomatic null, error, and async code handling in TypeScript, with Maybe, Result, and Task types that are really nice.

Overview

The first of what will likely be several 8.5.x bug fix releases to address issues found in the past few months!

Changes

🐛 Bug Fix

Committers: 1