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.
- Deprecated the
- [Breaking] Changed the
resultFrom()
to usetry-catch
instead of theT | 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()
, andepoch()
Date
constructors. - Added
isValid()
/isInvalid()
Date
predicates.
- Added
- Added
Timestamp
type.- Added
timestamp()
constructor.
- Added
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
- Dropped Node.js v16.x support, as it is no longer supported.
- Removed deprecated functions and types:
@perfective/common/array
:arrayFromArrayLike()
,arrayFromIterable()
,flatten()
.
@perfective/common/match
:Match.that()
,Match.to()
;Statement
,StatementEntry
,statements()
;When.then()
.
@perfective/common/maybe
:Maybe.lift()
/lift()
,Maybe.run()
/run()
;Nullable
,Nil
,Only
/Solum
,nullable()
,nil()
,only()
/solum()
;Optional
,None
,Some
,optional()
,none()
,some()
.
@perfective/common/promise
:Run
,result()
.
@perfective/common/string
:Output
,isNotOutput()
,isOutput()
,output()
.
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 thePanic
type andpanic()
function.
- Added
@perfective/common/maybe
:- Changed the
nothing()
/nil()
functions return type toNothing<Present<T>>
for TypeScript v5.3 compatibility.
- Changed the
@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()
andstringFromCodePoint()
functions.
Use theString.fromCharCode()
andString.fromCodePoint()
functions directly.
- Fixed
Deprecations
@perfective/common/function
:- Deprecated the
emtpy()
function. Usenaught()
as an empty no-op function instead.
- Deprecated the
@perfective/common/error
:- Deprecated the
Rethrow
type. UsePanic
instead. - Deprecated the
rethrow()
function. Usepanic()
instead. - Renamed the
unknownError()
function intocaughtError()
.
- Deprecated the
@perfective/common/maybe
:- Renamed the
naught()
function intonil()
.
- Renamed the
@perfective/common/object
:- Moved the
isTruthy()
/isFalsy()
functions into@perfective/common/boolean
.
- Moved the
@perfective/common/result
:- Deprecated the
recovery()
function. UseResult.otherwise()
instead.
- Deprecated the