0.1.4 • Published 6 years ago
iterable-startswith v0.1.4
iterable-startswith
NOTE: iterable-startswith was renamed to @extra-iterable/starts-with.
Check if iterable starts with value, like String.startsWith().
const startsWith = require('iterable-startswith');
// 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?)