Releases: emmanueltouzery/prelude-ts
Releases · emmanueltouzery/prelude-ts
v0.7.4
- add Option.getOrNull
- add Seq.dropRightWhile
v0.7.3
- more precise type for the left part of a partition result in case the predicate is a type guard
- add a series of curried type guards needed due to some TS limitation ( microsoft/TypeScript#20218 ) -- Either.isLeft, Either.isRight, LinkedList.isEmpty, LinkedList.isNotEmpty, Option.isSome, also for Vector, HashSet HashMap and so on.
- add Either.sequenceAcc & Either.liftApAcc for 'applicative-like' behavior of accumulating errors instead of short-circuiting (alternative to a 'Validation' class)
- [bugfix] didn't properly write the type definition for typeOf... the returned type was always 'string'...
v0.7.2
- maxOn, minOn, sortOn can now use string and boolean-based comparison (thanks to @user471 for the suggestion)
- sortOn can now take multiple sort criteria, and it's also possible to specify descending sorting for any of them (thanks to @user471 for the suggestion).
- added findAny to HashSet and HashMap.
v0.7.1
- allow for filter to change the generic type when given a type guard, the way also the typescript bindings for the array type enable it.
- introduce new functions instanceOf, typeOf, typeGuard which can be combined with the new filter behaviour to narrow types.
v0.7.0
- add Seq.toSet
- [compat break] fix issues with toString(), mkString() and null and string quoting for collections. Also fix an issue with HashSet and null values. Change the toString format for HashSet and HashMap.
- introduce FunctionX.liftNullable and Option.ofNullable
- [api change] remove the deprecated Option.ifPresent (replaced by Option.ifSome)
v0.6.1
v0.6.0
- add converters to
Tuple2
:toPair
,toArray
,toVector
,toLinkedList
- add
Seq.sliding
- [api change]
Function
.Function.lift1
is nowFunction1.of
. Same for Function2..5 - Add
Function0
- [api change]
Predicates.lift
is nowPredicate.of
. - add
FunctionX.liftOption
andFunctionX.liftEither
(also documented in the user guide) - add
IMap.containsKey
,IMap.filterKeys
,IMap.filterValues
- build with typescript 2.7RC
- add optional sorting to
ISet.toArray
v0.5.0
- smarter toString: call json.stringify if the object doesn't have a custom toString()
- add partial application (FunctionX.applyX)
- micro-optimizations in Vector
- fastpath for equality in case this===other
- hashmap.tostring, try harder to format the key nicely on toString()
- [behavior change] throw at runtime if given a hashmap key or hashset
value without proper equality support. should only matter for javascript or typescript with casts/any use - add lazy.map
- [api change] tuple.ofarray->tuple.ofpair, add ofarray which checks the number of elements
- make stream.ofarray private, although this has no effect on the transpiled JS code
(please use Stream.ofIterator) - add Lazy.toString
- add Either.liftA2, Either.liftAp, Option.liftAp
- make Option, Either, LinkedList and Stream union types instead of abstract classes, export the
individual types (Some, None, Left, Right, EmptyLinkedList, ConsLinkedList,
EmptyStream, ConsStream), make isEmpty, isLeft, isRight, isSome, isNone type guards. - code samples in apidocs are now extracted and run as part of tests
v0.4.4
- bugfix: calling vector.take with more than the vector length on a vector with a length being a multiple of 32 would fail, since 0.4.0.
v0.4.3
- [BUGFIX] fix a bug in Vector.take. It used to fail on a vector with a length multiple of 32 when take()ing the entire vector length, since 0.4.0.
- add HashMap.ofObjectDictionary & toObjectDictionary
- make Stream.ofIterable fully optimized when called with an array, mark Stream.ofArray deprecated
- add option.match & either.match catamorphisms