New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

comy

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comy

Doing something

latest
Source
npmnpm
Version
0.1.17
Version published
Maintainers
1
Created
Source



Comy - A sort of glorified dice-throwing

Comy - a sort of glorified dice-throwing

npm npm bundle size (minified) npm dependents Downloads

Introduction

Combinatorial algorithms are computational procedures which are designed to help solve combinatorial problems.

Install

$ npm install comy

Usage

const comy = require("comy");

// Specific example:
const { priorityGroups } = require("comy");
const arr = [
  { name: "Michael", priority: 1 },
  { name: "Murphy", priority: 2 },
  { name: "Capone", priority: 3 },
  { name: "Donnie", priority: 1 },
  { name: "Koby", priority: 2 },
  { name: "Felis", priority: 3 }
];

//Split the arr into 2 balanced groups by priority
console.log(priorityGroups(arr, 2, "priority"));
/* Possible output:
[
  [ { name: 'Donnie', priority: 1 },
    { name: 'Koby', priority: 2 },
    { name: 'Felis', priority: 3 }
  ],
  [
    { name: 'Michael', priority: 1 },
    { name: 'Murphy', priority: 2 },
    { name: 'Capone', priority: 3 }
  ]
]
*/

Methods

pickNumbers: (from: any, to: any, size: any) => any[]
pickRandom: (arr: any, n?: number) => any
pickHexColor: () => string
priorityGroups: (arr: any, numOfGroups: any, attr?: string) => any[][]
groups: (arr: any, numOfGroups: any) => any
generateString: () => string

ForTheBadge built-with-love

Keywords

comy

FAQs

Package last updated on 26 Dec 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