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.0.15 to 2.0.16

21

fresh.js

@@ -65,8 +65,24 @@ // PURE FUNCTIONS

/**
* Lists all permutations.
* Lists all possible partial sequences.
* @param {array} x array
* @returns {Iterable} 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 array
* @returns {Iterable} permutation ...
*/
function* permutations(x) {
if(x.length===0) yield [];
if(x.length===0) { yield []; return; }
for(var i=x.length-1; i>=0; i--) {

@@ -231,2 +247,3 @@ var y = splice(x, i);

exports.permutations = permutations;
exports.subsequences = subsequences;
exports.max = max;

@@ -233,0 +250,0 @@ exports.min = min;

2

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

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

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