@collection-abstraction/pairs
v5.0.0
Published
Pairs set for JavaScript
Downloads
295
Readme
:cherries: @collection-abstraction/pairs
Pairs set for JavaScript. See docs.
:warning: The code requires
regeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import {EfficientlyInvertiblePairs as Pairs} from '@collection-abstraction/pairs';
const pairs = Pairs.from(['ab', [1,2], [1,3]]);
pairs.left(); // a 1
pairs.right(); // b 2 3
pairs.invert().right(); // a 1
pairs.leftOf(3); // 1
pairs.rightOf(1); // 2 3
pairs.has([1, 2]); // true
pairs.add('bc');
...