🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

podium-sort

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

podium-sort

Sorts arrays putting the highest numbers in the middle

1.0.5
latest
Source
npm
Version published
Weekly downloads
1
-80%
Maintainers
1
Weekly downloads
 
Created
Source

podium-sort

Sorts an array of numbers putting the highest numbers in the middle.

Build Status npm version npm version

Installation

npm install --save podium-sort

Usage

const podiumSort = require("podium-sort");

const input = [1, 2, 3, 4, 5];
const output = podiumSort(input);

expect(output).toEqual([2, 4, 5, 3, 1]);

Providing a mapper:

const podiumSort = require("podium-sort");

const input = [
  { value: 1 }, 
  { value: 2 }, 
  { value: 3 }, 
  { value: 4 }, 
  { value: 5 }
];
const output = podiumSort(input, element => element.value);

expect(output).toEqual([
  { value: 2 }, 
  { value: 4 }, 
  { value: 5 }, 
  { value: 3 }, 
  { value: 1 }
]);

Keywords

podium

FAQs

Package last updated on 10 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts