2.5.22 • Published 3 years ago

@extra-iterable/has-prefix v2.5.22

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

Checks if iterable starts with a prefix. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPath.

This is part of package extra-iterable.

iterable.hasPrefix(x, y, [fc], [fm]);
// x:  an iterable
// y:  prefix?
// fc: compare function (a, b)
// fm: map function (v, i, x)
const iterable = require("extra-iterable");

var x = [1, 2, 3, 4];
iterable.hasPrefix(x, [1, 2]);
// true

iterable.hasPrefix(x, [-1, -2]);
// false

iterable.hasPrefix(x, [-1, -2], (a, b) => Math.abs(a) - Math.abs(b));
// true

iterable.hasPrefix(x, [-1, -2], null, v => Math.abs(v));
// true

References

2.5.22

3 years ago

2.5.21

3 years ago

2.5.20

3 years ago

2.5.18

3 years ago

2.5.17

3 years ago

2.5.14

3 years ago

2.5.13

4 years ago

2.5.10

4 years ago

2.5.11

4 years ago

2.5.12

4 years ago

2.5.8

4 years ago

2.5.7

4 years ago

2.5.9

4 years ago

2.5.6

4 years ago

2.5.5

4 years ago

2.5.4

4 years ago

2.5.3

4 years ago

2.5.2

4 years ago

2.5.1

4 years ago