1.0.2 • Published 5 years ago

constantie v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

constantie

A tiny JavaScript library for creation of fully immutable objects and arrays

API

Constantie(object || array)

Installation

yarn add constantie

Usage

const Constantie = require("constantie");

const obj = Constantie({a: 1, b: 2, c: 3});
const arr = Constantie([1, 2, 3]);

obj.d = 4; // Error! You can't change properties of this object

Object.defineProperty(obj, "d", {
  value: 4,
  writable: true,
  enumerable: true,
  configurable: true
}); // Error! You can't change properties of this object

arr.push(4); // Error! You can't change elements of this array
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago