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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.5
    42
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.5
    42
  • 1.1.3
    0
  • 1.1.2
    0
  • 1.1.1
    0
  • 1.1.0
    0

Package Sidebar

Install

npm i i-

Weekly Downloads

32

Version

1.1.5

License

MIT

Last publish

Collaborators

  • md4