Skip to content

Releases: emmanueltouzery/prelude-ts

v0.7.4

27 Apr 15:27
Compare
Choose a tag to compare
  • add Option.getOrNull
  • add Seq.dropRightWhile

v0.7.3

27 Mar 20:35
Compare
Choose a tag to compare
  • 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

22 Mar 21:50
Compare
Choose a tag to compare
  • 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

25 Feb 11:42
Compare
Choose a tag to compare
  • 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

19 Feb 22:53
Compare
Choose a tag to compare
  • 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

12 Feb 19:05
Compare
Choose a tag to compare
  • deprecate Option.ifPresent, replaced by Option.ifSome, introduce Option.ifNone.
  • add Option.getOrCall, fixes #3

v0.6.0

28 Jan 17:56
Compare
Choose a tag to compare
  • add converters to Tuple2: toPair, toArray, toVector, toLinkedList
  • add Seq.sliding
  • [api change] Function. Function.lift1 is now Function1.of. Same for Function2..5
  • Add Function0
  • [api change] Predicates.lift is now Predicate.of.
  • add FunctionX.liftOption and FunctionX.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

28 Dec 13:59
Compare
Choose a tag to compare
  • 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

14 Nov 23:40
Compare
Choose a tag to compare
  • 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

14 Nov 23:26
Compare
Choose a tag to compare
  • [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