sort_quick

1.0.1 • Public • Published

Installation:

npm install sort_quick

Usage

    const { qsort, qsortObj } = require('sort_quick');
    const notSorted = [6, 4, 7, 2, 10, 1];
    /* qsort sorts only strings and numbers. You can pass an array and direction (asc or desc) as arguments. */
    const sorted = qsort(notSorted);
    const objs = [
      {
        id: 6,
      },
      {
        id: 4,
      },
      {
        id: 7,
      },
      {
        id: 2,
      },
      {
        id: 10,
      },
      {
        id: 1,
      },
    ];
    /* To sort complex objects use qsortObj. You can pass an array, direction and sort key as arguments. */
    const sortedObjs = qsortObj(objs, true, 'id');

/sort_quick/

    Package Sidebar

    Install

    npm i sort_quick

    Weekly Downloads

    1

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    2.23 kB

    Total Files

    3

    Last publish

    Collaborators

    • ms-dosx86