keyvaluepair
v0.1.2
Published
KeyValuePair object.
Downloads
5
Readme
keyvaluepair
KeyValuePair object.
Usage
const KeyValuePair = require('keyvaluepair'); let pair = KeyValuePair.create('key','value');
pair.key
'key'
pair.value
'value'
pair.valueOf();
['key','value']
let map = new Map(); map.set('a',1); map.set('b',2); map.set('c',3); let pairs = [ ...KeyValuePair.fromIterable( map ) ];
[ KeyValuePair { key: 'a', value: 1 }, KeyValuePair { key: 'b', value: 2 }, KeyValuePair { key: 'c', value: 3 } ]
let obj = {a:1,b:2,c:3}; let pairs = [ ...KeyValuePair.fromObject( obj ) ];
[ KeyValuePair { key: 'a', value: 1 }, KeyValuePair { key: 'b', value: 2 }, KeyValuePair { key: 'c', value: 3 } ]
License
ISC