Auditable
Auditable data structures for modern browsers
Installation
npm install --save auditable
Usage
import {List} from 'auditable'
const myList = List(1, 2, 3)
a[0] = 10
a[1] = 20
console.log(List.audit(myList))
console.log(List.auditWithTraces(myList))
Scripts
| |
---|
Run tests | npm test |
Compile TypeScript | npm run build |
Watch Typescript | npm run watch |
Watch Typescript & TDD tests | npm run tdd |
TODO
Future direction
If the operator overloading proposal is adopted, we can apply pass-by-value semantics to our auditable types for far more efficient functional data structures:
const a = Set(1, 2, 3)
const b = a.add(4)
assert(a !== b)
assert(a === Set(1, 2, 3))
assert(b === Set(1, 2, 3, 4))