New (old kid on the block) utility TypeScript library

1 view
Skip to first unread message

Mike Austin

unread,
May 1, 2026, 11:15:26 PM (9 days ago) May 1
to PiLuD

vs ramda vs rambda vs ts-belt:

Also, dynamically adding array element if not null came up. Maybe that is literally the name :)

  const appendIfNotNull = (array: Item["assignees"], item: Item["assignedUser"]) => [...array, ...(item ? [item] : [])];

  const assignees = pipe(
    flatMap(items, item => appendIfNotNull(item.assignees, item.assignedUser)),
    uniqueBy(assignee => assignee.id)
  );

Reply all
Reply to author
Forward
0 new messages