i-

1.1.5 • Public • Published

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.

Package Sidebar

Install

npm i i-

Weekly Downloads

99

Version

1.1.5

License

MIT

Last publish

Collaborators

  • md4