byBoolean sortable

Description

The byBoolean sortable, as the name explain, is the sortable to sort the boolean type

Example

Standard example

//js or ts file
import {byBoolean} from 'sort-es'

const unsorted = [false, true, false];
const sorted = unsorted.sort(byBoolean());

console.log(sorted); //(5) [true, false, false]

Sort descending

//js or ts file
import {byBoolean} from 'sort-es'

const unsorted = [false, true, false];
const sorted = unsorted.sort(byBoolean({desc: true}));

console.log(sorted); //(5) [false, false, true]