Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lists

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lists - npm Package Compare versions

Comparing version 0.1.95 to 0.1.96

2

package.json
{
"name": "lists",
"version": "0.1.95",
"version": "0.1.96",
"description": "A library of higher-order functions modeled after Haskell's Data.List module",

@@ -5,0 +5,0 @@ "main": "lists.js",

@@ -177,5 +177,5 @@ # [ l [ i [ s ] t ] s ]

* [`sortBy`](#sortBy) : [x]|str -> f -> [x]
* insertBy : (a -> a -> Ordering) -> a -> [a] -> [a]
* maximumBy : (a -> a -> Ordering) -> [a] -> a
* minimumBy : (a -> a -> Ordering) -> [a] -> a
* [`insertBy`](#insertBy) : x -> [x]|str -> f -> [x]
* [`maximumBy`](#maximumBy) : [x]|str -> f -> x
* [`minimumBy`](#minimumBy) : [x]|str -> f -> x

@@ -194,4 +194,3 @@ -----

* flip :
* compare :
* GT,LT,EQ :
* GT,LT,EQ,compare :
* bubbleSort :

@@ -1439,1 +1438,51 @@ * mergeSort :

------
<a name='insertBy'/>
### insertBy : x -> [x]|str -> f -> [x]
------
**Description**: Inserts an element into the first position of the Array of Variables based on the user supplied Ordering Function.
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables.
**Example Usage**:
```js
function fn(x,y) {
return (x+y) < (x*y) ? 'LT' : 'GT'
}
lists.insertBy(4, [0,1,3,5,7,9], fn); /* [0,1,4,3,5,7,9] */
```
------
<a name='maximumBy'/>
### maximumBy : [x]|str -> f -> x
------
**Description**: The largest element of a non-empty Array of Variables or a String where the definition of "largest" comes from the user supplied Ordering function.
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables.
**Example Usage**:
```js
lists.maximumBy([[1,3],[2]], lists.compare); /* [2] */
function compareLength(x,y) {
return x.length > y.length ? 'GT' : 'LT'
}
lists.maximumBy([[1,3],[2]], compareLength); /* [1,3] */
```
------
<a name='minimumBy'/>
### minimumBy : [x]|str -> f -> x
------
**Description**: The least element of a non-empty Array of Variables or a String where the definition of "least" comes from the user supplied Ordering function.
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables.
**Example Usage**:
```js
lists.minimumBy([[1,3],[2]], lists.compare); /* [1,3] */
function compareLength(x,y) {
return x.length > y.length ? 'GT' : 'LT'
}
lists.minimumBy([[1,3],[2],[]], compareLength); /* [] */
```
------
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