1.1.6 • Published 6 years ago

zo-containers-js v1.1.6

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

containers

Some utility containers: BitArray, OrderedArray

  • npm install zo-containers-js --save

BitArray

const { BitArray } = require('zo-containers-js');
let ba = new BitArray(8);
ba.set(5, 1); 
ba.get(5); //1

let entries = ba.entries();
for (let [i, v] of entries) {
    //...
}

OrderedArray

const { OrderedArray } = require('zo-containers-js');
let oa = new OrderedArray((a, b) => a - b);
oa.add(6);
oa.add(8);
oa.add(2);
oa.add(3);
console.log(oa);  // [ 2, 3, 6, 8 ]

let oa2 = new OrderedArray((a, b) => a - b);
oa2.add(5);
oa2.add(3);

oa.merge(oa2);
console.log(oa);  // [ 2, 3, 3, 5, 6, 8 ]
1.1.6

6 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago