@extra-iterable/is-suffix.min

Checks if iterable ends with a suffix.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-iterable/is-suffix.min
102.4.512 years ago3 years agoMinified + gzip package size for @extra-iterable/is-suffix.min in KB

Readme

Checks if iterable ends with a suffix. :running: :vhs: :package: :moon: :ledger:
Similar: isValue, isPrefix, isInfix, isSuffix, isSubsequence.
This is part of package extra-iterable.

This is browserified, minified version of @extra-iterable/is-suffix.
It is exported as global variable iterableisSuffix.
CDN: unpkg
, jsDelivr.

iterable.isSuffix(x, y, fc, [fm]);
// x:  an iterable
// y:  suffix?
// fc: compare function (a, b)
// fm: map function (v, i, x)

const iterable = require('extra-iterable');

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

iterable.isSuffix(x, [-3, -4]);
// false

iterable.isSuffix(x, [-3, -4], (a, b) => Math.abs(a) - Math.abs(b));
// true

iterable.isSuffix(x, [-3, -4], null, v => Math.abs(v));
// true

references