1.0.2 • Published 1 year ago

sorted-by v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago
import {sortedByFunction} from "../index.mjs"

describe("sortedByFunction", () => {
  const peopleWithNames = [
    {
      name: () => "Kasper"
    },
    {
      name: () => "Christina"
    }
  ]

  it("sorts by function", () => {
    const sortedPeopleWithNames = sortedByFunction(peopleWithNames, "name")
    const sortedNames = sortedPeopleWithNames.map((person) => person.name())

    expect(sortedNames).toEqual(["Christina", "Kasper"])
  })
})
1.0.2

1 year ago

1.0.1

3 years ago

1.0.0

3 years ago