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

immutable

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immutable - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

dist/immutable.d.ts

4

package.json
{
"name": "immutable",
"version": "2.5.0",
"version": "2.5.1",
"description": "Immutable Data Collections",

@@ -17,3 +17,3 @@ "homepage": "https://github.com/facebook/immutable-js",

},
"main": "dist/Immutable.js",
"main": "dist/immutable.js",
"scripts": {

@@ -20,0 +20,0 @@ "test": "jest"

@@ -247,11 +247,11 @@ Immutable Data Collections

Once the sequence is used, it performs only the work necessary. In this
example, no intermediate arrays are ever created, filter is only called
twice, and map is only called once:
example, no intermediate arrays are ever created, filter is called three times
twice, and map is only called two times:
console.log(oddSquares.last()); // 49
console.log(oddSquares.get(1)); // 9
Lazy Sequences allow for the efficient chaining of sequence operations, allowing
for the expression of logic that can otherwise be very tedious:
Lazy Sequences allow for the efficient chaining of sequence operations,
especially when converting to a different concrete type (such as to a JS object):
Immutable.Sequence({a:1, b:1, c:1})
Immutable.Map({a:1, b:1, c:1})
.flip().map(key => key.toUpperCase()).flip().toObject();

@@ -270,2 +270,8 @@ // Map { A: 1, B: 1, C: 1 }

A common pattern is reifying (converting to real form) back to the original
collection type. For example, mapping over a Vector:
var numsVect = Immutable.Vector.from([1,2,3,4,5]);
var squaresVect = numsVect.map(x => x * x).toVector();
Note: A sequence is always iterated in the same order, however that order may

@@ -272,0 +278,0 @@ not always be well defined, as is the case for the `Map`.

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