array-mumu 0.2.0-rc.5

Array tools plugin for the Mumu ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extend("test")
extend("array")

describe("array:compact", () => {
  it("removes falsy ints", () => {
    expect_equal(array:compact([0,1,0,2]), [1,2])
  })
  it("removes falsy strings", () => {
    expect_equal(array:compact(["", "x", "", "y"]), ["x","y"])
  })
  it("removes falsy MixedArray elements", () => {
    expect_equal(array:compact([_, 0, "", false, "ok", 3]), ["ok",3])
  })
})