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

list

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

list - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

2

dist/es/index.d.ts

@@ -8,3 +8,3 @@ export declare function setEquals(equals: (a: any, b: any) => boolean): void;

}
export declare function nth<A>(index: number, l: List<A>): A;
export declare function nth<A>(index: number, l: List<A>): A | undefined;
export declare class List<A> {

@@ -11,0 +11,0 @@ bits: number;

@@ -145,2 +145,5 @@ var branchingFactor = 32;

export function nth(index, l) {
if (index < 0 || l.length <= index) {
return undefined;
}
var prefixSize = getPrefixSize(l);

@@ -1217,2 +1220,5 @@ var suffixSize = getSuffixSize(l);

export function update(index, a, l) {
if (index < 0 || l.length <= index) {
return l;
}
var prefixSize = getPrefixSize(l);

@@ -1237,2 +1243,5 @@ var suffixSize = getSuffixSize(l);

export function adjust(f, index, l) {
if (index < 0 || l.length <= index) {
return l;
}
return update(index, f(nth(index, l)), l);

@@ -1239,0 +1248,0 @@ }

@@ -8,3 +8,3 @@ export declare function setEquals(equals: (a: any, b: any) => boolean): void;

}
export declare function nth<A>(index: number, l: List<A>): A;
export declare function nth<A>(index: number, l: List<A>): A | undefined;
export declare class List<A> {

@@ -11,0 +11,0 @@ bits: number;

@@ -148,2 +148,5 @@ "use strict";

function nth(index, l) {
if (index < 0 || l.length <= index) {
return undefined;
}
var prefixSize = getPrefixSize(l);

@@ -1254,2 +1257,5 @@ var suffixSize = getSuffixSize(l);

function update(index, a, l) {
if (index < 0 || l.length <= index) {
return l;
}
var prefixSize = getPrefixSize(l);

@@ -1275,2 +1281,5 @@ var suffixSize = getSuffixSize(l);

function adjust(f, index, l) {
if (index < 0 || l.length <= index) {
return l;
}
return update(index, f(nth(index, l)), l);

@@ -1277,0 +1286,0 @@ }

{
"name": "list",
"version": "2.0.4",
"version": "2.0.5",
"description": "Fast purely functional immutable lists.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -486,2 +486,5 @@ <h3 align="center">

If the index is out of bounds the given list is
returned unchanged.
**Complexity**: `O(log(n))`

@@ -500,2 +503,5 @@

If the index is out of bounds the given list is
returned unchanged.
**Complexity**: `O(log(n))`

@@ -836,3 +842,4 @@

Gets the `n`th element of the list.
Gets the `n`th element of the list. If `n` is out of bounds
`undefined` is returned.

@@ -839,0 +846,0 @@ **Complexity**: `O(log(n))`, practically constant

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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