An open API service indexing awesome lists of open source software.

https://github.com/unadlib/invariance

Utils for immutable data structures Records & Tuples
https://github.com/unadlib/invariance

Last synced: 6 months ago
JSON representation

Utils for immutable data structures Records & Tuples

Awesome Lists containing this project

README

          

# invariance

![Node CI](https://github.com/unadlib/invariance/workflows/Node%20CI/badge.svg)
[![npm](https://img.shields.io/npm/v/invariance.svg)](https://www.npmjs.com/package/invariance)

Utils for immutable data structures [Records & Tuples](https://github.com/tc39/proposal-record-tuple)

## APIs

- `toImmutable()`

Deeply convert regular objects, arrays and JSON objects to Records or Tuples.

- `JSON.parseImmutable()`

## Interfaces

- `DeepReadonly`
- `Record`
- `Tuple`

## TODO

- [ ] Add Types from [Spec](https://tc39.es/proposal-record-tuple)
- [ ] Implement polyfill for `JSON.parseImmutable`