Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

moondef/constantie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published