🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

evil-sort

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evil-sort

> Note: this is a joke/meme package

latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

Evil Sort

Note: this is a joke/meme package

From the depths of unhinged software devs, I bring you the horror:

import sort from 'evil-sort';

const unsorted = [8, 42, 38, 111, 2, 39, 1];
const sorted = await sort(unsorted);
console.log(sorted);
// [1, 2, 8, 38, 39, 42, 111]

It's doing this basically:

export default async function sort(numbers) {
  const sorted = [];

  await Promise.all(
    numbers.map(async (n) => {
      return new Promise((done) => {
        setTimeout(() => done(sorted.push(n)), n);
      });
    }),
  );

  return sorted;
}

But hey, it has 3 tests!

FAQs

Package last updated on 13 Dec 2024

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