1.1.1 • Published 5 years ago

@extra-iterable/starts-with v1.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

Check if iterable starts with value, like String.startsWith().

const startsWith = require('@extra-iterable/starts-with');
// startsWith(<iterable>, <value>)

startsWith(['a', 'b', 'c'], 'a');
// true
startsWith('abc', 'b');
// false
startsWith(new Set().add('a').add('b'), 'c');
// false
startsWith(new Map().set('a', 1).set('b', 2), ['a', 1]);
// false (why?)

extra-iterable