Skip to content

v0.10.0

Latest
Compare
Choose a tag to compare
@amikheychik amikheychik released this 01 Dec 11:40
· 19 commits to main since this release
v0.10.0
7900a79

Read the release announcement in the Perfective blog.

@perfective/common/result

  • Added the Result.that() filter method.
  • Added the Result.which() type-guard method.
  • Added the Result.when() filter method.
  • Added the Result.or() fold method.
  • Added the Result.otherwise() recovery method.
    • Deprecated the recovery() function.
  • [Breaking] Changed the resultFrom() to use try-catch instead of the T | Error union type. This makes the function behavior safer and allows wider usage.

New @perfective/common/date package

  • Added functions for the Date class:
    • Added date(), now(), and epoch() Date constructors.
    • Added isValid()/isInvalid() Date predicates.
  • Added Timestamp type.
    • Added timestamp() constructor.

Restructured Roadmap

ROADMAP.adoc now contains all built-in objects with their properties and methods. Some of the methods and properties already have a matching Perfective function, and some are marked as prohibited (e.g. eval) or not supported.

The Roadmap will document minimum support to tag @perfective/common v1.0.

Breaking changes

Improvements

  • @perfective/common/boolean:
    • Added JsDocs for all types and functions.
    • Added ES Coverage documentation for the Boolean type.
    • Added the isBoolean()/isNotBoolean() predicates.
    • Moved the isTruthy()/isFalsy() functions from @perfective/common/object.
  • @perfective/common/error:
    • Added Recovery type.
    • Added JsDocs for all types and functions.
    • Added support for cause (previous) error to the Panic type and panic() function.
  • @perfective/common/maybe:
    • Changed the nothing()/nil() functions return type to Nothing<Present<T>> for TypeScript v5.3 compatibility.
  • @perfective/common/object:
    • Added JsDocs for all types and functions.
  • @perfective/common/string:
    • Fixed lines() function: Use correct separator for Mac OS strings.
    • Deprecated the stringFromCharCode() and stringFromCodePoint() functions.
      Use the String.fromCharCode() and String.fromCodePoint() functions directly.

Deprecations