Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extra-array

Package Overview
Dependencies
Maintainers
1
Versions
856
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-array - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

2

package.json
{
"name": "extra-array",
"version": "2.1.1",
"version": "2.1.2",
"description": "Standard utility methods for Array.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -89,67 +89,6 @@ /**

/**
* Checks if array starts with a prefix.
* @param {Array} x source
* @param {Array} y prefix?
* @returns {boolean} true if prefix
*/
function isPrefix(x, y) {
var i = 0;
for(var v of y)
if(x[i]!==v) return false;
return true;
}
/**
* Checks if array ends with a suffix.
* @param {Array} x source
* @param {Array} y suffix?
* @returns {boolean} true if suffix
*/
function isSuffix(x, y) {
var i = x.length - y.length;
for(var v of y)
if(x[i]!==v) return false;
return true;
}
/**
* Checks if array contains an infix.
* @param {Array} x source
* @param {Array} y infix?
* @returns {boolean} true if infix
*/
function isInfix(x, y) {
var i = 0, I = y.length;
for(var v of x) {
if(v===y[i]) i++;
else if(i<I) i = 0;
}
return i===I;
}
/**
* Checks if array has a subsequence.
* @param {Array} x source
* @param {Array} y subsequence?
* @returns {boolean} true if subsequence
*/
function isSubsequence(x, y) {
var i = 0, I = y.length;
for(var v of x)
if(v===y[i]) i++;
return i===I;
}
/**
* Checks if array has a permutation.
* @param {Array} x source
* @param {Array} y permutation?
* @returns {boolean} true if permutation
*/
function isPermutation(x, y) {
var xa = x.slice.sort();
var ya = y.slice.sort();
return compare(xa, ya)===0;
}

@@ -156,0 +95,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc