JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q36763F
  • License MIT

Functions for interacting with arrays in a functional way

Package Exports

  • structs-list

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (structs-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

structs-list

Functions for interacting with arrays in a functional way.

Overview

All functions are curried.

List.contains(1, [1, 2])
// -> true

List.prepend(0, [1, 2])
// -> [0, 1, 2]

List.isempty([])
// -> true

List.append(3, [1, 2])
// -> [1, 2, 3]

List.concat([1, 2], [3, 4, 5])
// -> [1, .. 5]

List.filter((i) => item % 2 == 0, [1, 2, 3, 4])
// -> [2, 4]

List.drop(2, [1, 2, 4, 8, 16])
// -> [4, 8, 16]

List.head([5, 4, 3])
// -> 5

List.last([5, 4, 3])
// -> 3

List.tail([5, 4, 3])
// -> [4, 3]

List.map((i) => i * 2, [1, 2, 3])
// -> [2, 4, 6]

List.nth(1, [1, 2, 3])
// -> 2

Run tests

make test