Skip to content

Releases: ugaya40/leseq

v1.12.2

15 Jul 22:55
Compare
Choose a tag to compare
const result1 = from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).pipe(
  chunkByAccumulation(
    0,
    (acc, current) => acc + current,
    (acc) => acc <= 10
  )
).toArray();

// result1: [[1, 2, 3, 4], [5], [6], [7], [8], [9], [10]]

// Example where the first value doesn't satisfy the condition
const result2 = from([11, 1, 2, 3]).pipe(
  chunkByAccumulation(
    0,
    (acc, current) => acc + current,
    (acc) => acc <= 10
  )
).toArray();

// result2: []

// Example where enumeration stops when a single value doesn't satisfy the condition
const result3 = from([1, 2, 3, 15, 4, 5]).pipe(
  chunkByAccumulation(
    0,
    (acc, current) => acc + current,
    (acc) => acc <= 10
  )
).toArray();

// result3: [[1, 2, 3]]

v1.11.0

11 Jan 22:38
Compare
Choose a tag to compare
const result = from([91, 92, 93, 94, 95]).value(every((i, index) => i % 2 == 1 || index % 2 == 1 ));
//result: true

v1.10.0

28 Dec 00:24
Compare
Choose a tag to compare
const result = from([1,'a',2,'b'])
  .pipe(
    filter<number | string, string>((i): i is string => typeof i === 'string')
  )
  .toMutableArray();
//result: ['a','b']
//result type is string[]
  • improve return value of all async predicate.

Until now, all async predicate must return Promise.

const result = await rangeAsAsync(1,10).pipe(
  takeWhileAsync(async i => i < 5)
).toArrayAsync()
//result: [1,2,3,4]

From now on, all async predicate can also return a boolean if asynchronous processing is not required.

const result = await rangeAsAsync(1,10).pipe(
  takeWhileAsync(i => i < 5)
).toArrayAsync()
//result: [1,2,3,4]

v1.9.1

22 Dec 07:30
Compare
Choose a tag to compare

v1.8.1

27 Aug 05:13
Compare
Choose a tag to compare

breaking change:

v1.7.0

05 Aug 21:45
Compare
Choose a tag to compare

v1.6.1

29 May 03:08
Compare
Choose a tag to compare
  • Introduced the concept of To for sequence conversion.
    • Deprecated .value(toAsync()). Use .to(asyncSeq()) instead.
    • Add .to(sharedSeq())/.to(sharedAsyncSeq()) that can share iterator.

v1.5.1

06 Apr 03:03
Compare
Choose a tag to compare

remove return await.

v1.5.0

24 Mar 16:10
Compare
Choose a tag to compare

v1.4.4

22 Mar 08:09
Compare
Choose a tag to compare

breaking change:

  • The return value of toArray()/toArrayAsync() has been changed from T[] to readonly T[].
    To return T[], toMutableArray()/toMutableArrayAsync() must be used.(Thanks! by @hachibeeDI )