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

seamless-immutable

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.

  • 2.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
138K
decreased by-60.88%
Maintainers
1
Weekly downloads
 
Created

What is seamless-immutable?

The seamless-immutable npm package provides a way to create and work with deeply immutable data structures in JavaScript. It ensures that objects and arrays cannot be modified after they are created, which helps in maintaining predictable state and avoiding side effects in applications.

What are seamless-immutable's main functionalities?

Creating Immutable Objects

This feature allows you to create immutable objects. Once created, the object cannot be modified.

const Immutable = require('seamless-immutable');
const obj = Immutable({ name: 'John', age: 30 });
console.log(obj); // Output: { name: 'John', age: 30 }

Creating Immutable Arrays

This feature allows you to create immutable arrays. Once created, the array cannot be modified.

const Immutable = require('seamless-immutable');
const arr = Immutable([1, 2, 3]);
console.log(arr); // Output: [1, 2, 3]

Merging Immutable Objects

This feature allows you to merge immutable objects, creating a new immutable object with the merged properties.

const Immutable = require('seamless-immutable');
const obj1 = Immutable({ name: 'John', age: 30 });
const obj2 = obj1.merge({ age: 31 });
console.log(obj2); // Output: { name: 'John', age: 31 }

Updating Immutable Arrays

This feature allows you to perform operations on immutable arrays, resulting in a new immutable array.

const Immutable = require('seamless-immutable');
const arr = Immutable([1, 2, 3]);
const newArr = arr.map(x => x * 2);
console.log(newArr); // Output: [2, 4, 6]

Other packages similar to seamless-immutable

Keywords

FAQs

Package last updated on 11 Jun 2015

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

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