New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-bubsort

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-bubsort

node bubble sort with predicate function

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-bubsort

A node implementation of buble sort with user defined predicate function

npm install node-bubsort

Usage:

const bubble = require('node-bubsort');

const { result, count } = bubble.sort([2, 1, 3]);
// result => [1, 2, 3]
// count => 2. Count refers to the number of passes of sort.

// sort with a predicate function
    const { result, count } = bubble.sort([
        { key: 5 },
        { key: 1 },
        { key: 4 },
        { key: 2 },
        { key: 8 }
    ], (objOne, objTwo) => objOne.key > objTwo.key);

// result => [ { key: 1 }, { key: 2 }, { key: 4 }, { key: 5 }, { key: 8 }]
// count => 3

Keywords

FAQs

Package last updated on 13 Oct 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc