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.0 to 2.1.1

2

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

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

@@ -82,65 +82,6 @@ /**

/**
* Lists all possible prefixes.
* @param {Array} x source
* @returns {Iterable<Array>} [prefix ...]
*/
function* prefixes(x) {
for(var i=0, I=x.length; i<I; i++)
yield x.slice(0, i);
}
/**
* Lists all possible suffixes.
* @param {Array} x source
* @returns {Iterable<Array>} [suffix ...]
*/
function* suffixes(x) {
for(var i=0, I=x.length; i<I; i++)
yield x.slice(i);
}
/**
* Lists all possible infixes.
* @param {Array} x source
* @returns {Iterable<Array>} [infix ...]
*/
function* infixes(x) {
for(var i=0, I=x.length; i<I; i++) {
for(var j=0; j<I; j++)
yield x.slice(i, j);
}
}
/**
* Lists all possible partial sequences.
* @param {Array} x source
* @returns {Iterable<Array>} subsequence ...
*/
function* subsequences(x) {
if(x.length===0) { yield []; return; }
var y = x.slice(0, -1);
for(var s of subsequences(y))
yield s;
for(var s of subsequences(y)) {
s.push(x[x.length-1]);
yield s;
}
}
/**
* Lists all possible arrangements.
* @param {Array} x source
* @returns {Iterable<Array>} permutation ...
*/
function* permutations(x) {
if(x.length===0) { yield []; return; }
for(var i=x.length-1; i>=0; i--) {
var y = splice(x, i);
for(var p of permutations(y)) {
p.push(x[i]);
yield p;
}
}
}

@@ -147,0 +88,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