@trashpanda001/helpers
    Preparing search index...

    Function compareBooleansDesc

    • Compare two booleans, sorting true then false.

      The empty values null and undefined sort last.

      Parameters

      • target: Optional<boolean>

        the first boolean to compare

      • other: Optional<boolean>

        the second boolean to compare

      Returns -1 | 0 | 1

      true before false

      Sort booleans true-false.

      import { compareBooleansDesc } from "@trashpanda001/helpers/comparators"

      compareBooleansDesc(true, false)
      // -1 .. true, false
      compareBooleansDes(false, true)
      // 1 ... true, false