question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Umbrella] std/collections

See original GitHub issue

We landed the initial version of std/collections at #993

This issue is the umbrella issue for the remaining 28 APIs, which still need discussion. More detailed type definitions / docs / examples are available in the original proposal PR by @LionC.

ARRAYS

Transformations to Array

  • mapNotNullish #1103
  • takeFirstWhile
  • takeLastWhile
  • dropFirstWhile
  • dropLastWhile
  • filterNotNullish
  • sortBy #1061
  • runningReduce
  • without #1074
  • withoutAll #1100

Transformations to value

  • findLastIndex #1060
  • single
  • firstNotNullishOf
  • sumOf #1108
  • maxBy
  • minBy
  • maxWith
  • minWith
  • maxOf #1144
  • minOf

Number array transformations

  • average moved to std/math proposal #1111

Transformations to other formats

  • associateBy #1071
  • windowed

RECORDS

Predicates

  • includesValue

Transformations to Records

  • filterValuesNotNullish
  • deepMerge #1075

Groups

  • reduceGroups
  • aggregateGroups

If you’re interested in some specific items in the above, please pick one or more items, create a separate issue/PR for them, and keep discussion there.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
LionCcommented, Aug 26, 2021

I would like to implement single, is there any issue with this function?

I would just add the pointer that including (it) => true as a default for the predicate should be considered - that is what kt does because it allows a very smooth and readable transition from an (assumed) single-element array into that single element while also forcing you to handle what happens when that assumption is wrong:

// Assuming some cli that expects exactly one argument

const target = single(Deno.args)
    ?? error("Expected exactly one argument")

doMagic(target)

Also a note on the implementation: Make sure to short circuit when finding a second match instead of iterating through the rest of the array 😃

0reactions
kt3kcommented, Aug 27, 2021

The rest of items will be tracked in #1173.

Thanks @LionC for taking over the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Standard Aluminum Collection Archives - East Coast Umbrella
Heavy Duty Fiberglass Umbrellas · Heavy Duty Alumnum Collection · Wooden Umbrellas · Standard Alumnimum Umbrellas · Beach Umbrellas · Umbrella Accessories ...
Read more >
STI self-sampling kits - Umbrella Health
... STI kits are available for home delivery or collection from Umbrella pharmacies. STI kits are not currently available for collection at Umbrella...
Read more >
How to collect your samples (male STI self-sampling kit)
This video shows you how to collect your samples using Umbrella's male sexually transmitted infection self-sampling kit.
Read more >
Rainy Day Golfer Umbrella Std - AFD Home
Rainy Day Golfer Umbrella Std · Favorites for restaurant and bar decor · Great for game and theatre rooms · Handpainted finish.
Read more >
Home Decorators Collection - Patio Umbrella Stands
Get free shipping on qualified Home Decorators Collection Patio Umbrella ... WESTIN OUTDOOR4-Piece Universal Standard Cross Patio Umbrella Base in Black.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found