npm's personal messenger

    total-order

    4.0.1 • Public • Published

    🤡 total-order

    A total order for all JavaScript values. See docs.

    ⚠️ The code requires regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

    import totalOrder from 'total-order'
    [
     [1, 2, 3],
     0,
     undefined,
     {x: 1},
     new Date(1),
     null,
     {},
     /abc/,
     new Date(0),
     'abc',
     [],
     NaN
    ].sort(totalOrder)
    // [
    //  0,
    //  NaN,
    //  null,
    //  [],
    //  [1, 2, 3],
    //  new Date(0),
    //  new Date(1),
    //  {},
    //  {x: 1},
    //  /abc/,
    //  'abc',
    //  undefined,
    // ]

    License Version Tests Dependencies Dev dependencies GitHub issues Downloads

    Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

    Install

    npm i total-order

    DownloadsWeekly Downloads

    32

    Version

    4.0.1

    License

    AGPL-3.0

    Unpacked Size

    551 kB

    Total Files

    14

    Last publish

    Collaborators

    • aureooms