Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

i-

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i-

A (very) simple library to expose only clones of referenced objects in function arguments.

latest
Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

i

Build Status Build Status

A (very) simple library to expose only clones of referenced objects in function arguments.

Installation

npm install i-

Usage

Require

var i = require('i-');
// or simply
require('i-');

Example

var a = { a: 1, b: 2 };

var transform = (obj => {
  obj.b = 3;
  return obj;
}).i;

// or

transform = i(obj => {
  obj.b = 3;
  return obj;
});

// or

transform = i(function(obj) {
  obj.b = 3;
  return obj;
});

// or

transform = function(obj) {
  obj.b = 3;
  return obj;
}.i;

console.log(a);
console.log(transform(a));
console.log(a);

test

npm test

Notes

I still have no idea if it is a stupid or good idea.

Keywords

immutable

FAQs

Package last updated on 28 Jun 2016

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