@extra-array/is-infix.min
TypeScript icon, indicating that this package has built-in type declarations

2.9.64 • Public • Published

Checks if array contains an infix. 🏃 📼 📦 🌔 📒

Similar: infix, infixes, isInfix, searchInfix.
Similar: isValue, isPrefix, isInfix, isSuffix, isSubsequence, isPermutation.
This is part of package extra-array.

This is browserified, minified version of @extra-array/is-infix.
It is exported as global variable array_isInfix.
CDN: unpkg, jsDelivr.

array.isInfix(x, y, [fc], [fm]);
// x:  an array
// y:  infix?
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require('extra-array');

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

array.isInfix(x, [-2, -3]);
// false

array.isInfix(x, [-2, -3], (a, b) => Math.abs(a) - Math.abs(b));
// true

array.isInfix(x, [-2, -3], null, v => Math.abs(v));
// true

references

Package Sidebar

Install

npm i @extra-array/is-infix.min

Weekly Downloads

395

Version

2.9.64

License

MIT

Unpacked Size

9.07 kB

Total Files

14

Last publish

Collaborators

  • wolfram77