1.0.2 • Published 12 months ago

sorted-by v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months 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

12 months ago

1.0.1

3 years ago

1.0.0

3 years ago