Sorting Arrays as simple as it gets.

Overview

Sort

Sorting Arrays as simple as it gets.

This module is published at: https://deno.land/x/sort.

Simple Usage Example

import { SortService, Direction } from "https://deno.land/x/[email protected]/mod.ts"

const testInput = [4, 9, 10, 8, 7]

const actualOutput = SortService.sort(testInput, Direction.DESCENDING)

console.log(actualOutput)

Advanced Usage Example

import { SortService, ISortOptions, Direction } from "https://deno.land/x/[email protected]/mod.ts"

const testInput = [
    {
        exchangeName: "Bitmex",
        longRate: 51.36,
    },
    {
        exchangeName: "Binance",
        longRate: 51.36,
    },
    {
        exchangeName: "Bybit",
        longRate: 55.36,
    },
]

const sortOptions: ISortOptions[] = [
    { fieldName: 'longRate', direction: Direction.ASCENDING }, 
    { fieldName: 'exchangeName', direction: Direction.DESCENDING }
]

const actualOutput = SortService.sort(testInput, sortOptions)


console.log(actualOutput)

Please check the unit tests to see more usage examples.

You might also like...

Input a list of Handshake top-level domains, outputs names sorted into 4 arrays: available, registered, reserved, or invalid.

name-check A simple NodeJS package that, given a flat list of top-level domain names, queries the Handshake (HNS) blockchain in order to classify each

Jan 8, 2022

sum-safe rounding for number arrays

saferound About saferound is a simplified typescript adaption of the python library Iteround, a sum-safe rounding library. The library solves the prob

Oct 31, 2022

This project will be a basic website that allows users to add/remove books from a list. The main objective is to understand how to use JavaScript objects and arrays and dynamically modify the DOM and add basic events.

Awesome-books Awesome Books This project will be a basic website that allows users to add/remove books from a list. This project is part of the Microv

Oct 3, 2022

Serialize an HTML Form to a JavaScript Object, supporting nested attributes and arrays.

jquery.serializeJSON Adds the method .serializeJSON() to jQuery to serializes a form into a JavaScript Object. Supports the same format for nested par

Dec 12, 2022

Repositorio sobre arrays con información y ejemplos.

Arrays Repositorio sobre arrays con información y ejemplos. 1)Para poder utilizar el repositorio correctamente es necesario que se eliminen los coment

Sep 14, 2022

jQuery-plugin for add/remove dom-items with renaming form-elements (arrays)

dynamicrows jQuery-plugin for add/remove rows by cloning existing row / renaming form-elements (arrays). Requirements jQuery =2.0 if move-action used

Nov 9, 2020

Convert arrays to bitmask representations to quickly operate with them through bitwise operations. (uses JSBI)

Bitmask Set (JSBI) Convert arrays to bitmask representations to quickly operate with them through bitwise operations. In general, this approach can be

Sep 7, 2022

Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the DOM and adding basic events.

Awesome Books Basic website that allows users to add/remove books from a list. Achieved using JavaScript objects and arrays, dynamically modifying the

Dec 20, 2022

This is a basic app that allows user add/remove books from a list of books. It was created by using JavaScript arrays and objects to dynamically modify the DOM.

Awesome-Books This application lets you compile a dynamic collection of books using JavaScript. It is a single page app. You enter your book title & a

Oct 24, 2022
Releases(v1.1.1)
Owner
null
The world's fastest game! User gets ten dice. Then rolls and rolls as fast as they can until he gets all their dice on the same number.

tenzies-game The world's fastest game! User gets ten dice. Then rolls and rolls as fast as they can until he gets all their dice on the same number. I

Babur Shah Sayer 6 Nov 26, 2022
Lightweight (< 2.3kB gzipped) and performant natural sorting of arrays and collections by differentiating between unicode characters, numbers, dates, etc.

fast-natural-order-by Lightweight (< 2.3kB gzipped) and performant natural sorting of arrays and collections by differentiating between unicode charac

Shelf 5 Nov 14, 2022
Sorting visualizer to introduce students to different sorting algorithms, how they work, and how to apply them

sorting-visualizer Sorting visualizer to introduce students to different sorting algorithms, how they work, and how to apply them Iteration 1 Demo: ht

Aditya Malik 1 Nov 14, 2022
Simple utils to pack arrays, objects and strings to a flat object (and back again).

packrup Simple utils to pack (and unpack) arrays and strings to a flat object. Status: In Development Please report any issues ?? Made possible by my

Harlan Wilton 15 Dec 23, 2022
SEE WHO GETS TO A SCORE OF A 100 FIRST

PIG-GAME RULES 1 . The main goal is to reach a score equal or above to a 100. 2 . To play, click on the button named " ROLL DICE ". 3 . To hold your s

Daniel Dukundane 6 Jun 12, 2021
Gets news from liveuamap.com and sends it to a Discord webhook

Gets news from liveuamap.com and sends it to a Discord webhook

Mohammed Keyvanzadeh 7 Jun 27, 2022
Gets system requirement information to compare to the ones shown in Steam.

Steam SysReq Gets system requirement information to compare to the ones shown in Steam. Usage import getSteamSysReq from 'steam-sysreq'; const steamS

Mohammed Keyvanzadeh 3 Nov 15, 2022
Chrome Extension - Gets your Trybe Agenda from slack

Trybe Schedule Notification Extensão para navegadores base chromium para facilitar o dia a dia do estudante da Trybe. Sumário Instalação Uso FAQ Contr

Pedro Brito 13 Apr 8, 2022
Cryptostat is a Node.js based CLI that gets you the real-time stats of your favorite cryptocurrency.

Cryptostat-CLI Cryptostat is a Node.js based CLI that gets you the real-time stats of your favorite cryptocurrency. Installation Use the npm package m

Kunal Rohitas 5 Dec 15, 2022
A JavaScript Library that allows you to execute function when a certain element gets added to the document

wait-for-it.js A JavaScript Library that allows you to execute function when a certain element gets added to the document Getting Started If you want

Muhammad Tayyab Sheikh 12 Apr 26, 2022