lodash.combinations
Advanced tools
Comparing version 1.0.0 to 17.7.22
(function(_) { | ||
_.mixin({combinations: function(array, n) { | ||
_.mixin({combinations: function(values, n) { | ||
values = _.values(values); | ||
var combinations = []; | ||
var func = function(combination, i) { | ||
(function f(combination, index) { | ||
if (combination.length < n) { | ||
_.findIndex(array, function(v, i) { | ||
func(combination.concat([v]), i + 1); | ||
}, i); | ||
_.find(values, function(value, index) { | ||
f(_.concat(combination, [value]), index + 1); | ||
}, index); | ||
} else { | ||
combinations.push(combination); | ||
} | ||
}; | ||
func([], 0); | ||
})([], 0); | ||
return combinations; | ||
@@ -19,3 +19,3 @@ }}); | ||
})((function() { | ||
if (typeof exports !== 'undefined' && this === exports) { | ||
if (typeof module !== 'undefined' && typeof exports !== 'undefined' && this === exports) { | ||
return require('lodash'); | ||
@@ -22,0 +22,0 @@ } else { |
{ | ||
"name": "lodash.combinations", | ||
"version": "1.0.0", | ||
"version": "17.7.22", | ||
"description": "Calculates all possible combinations of certain size.", | ||
"keywords": ["lodash", "plugin", "mixin", "array", "combinatorics"], | ||
"main": "lodash.combinations.js", | ||
"dependencies": { | ||
"lodash": ">=4.17.4" | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/SeregPie/lodash.combinations.git" | ||
}, | ||
"author": "Sergej Sintschilin", | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SeregPie/lodash.combinations.git" | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/SeregPie/lodash.combinations/issues" | ||
}, | ||
"homepage": "https://github.com/SeregPie/lodash.combinations#readme", | ||
"dependencies": { | ||
"lodash": "latest" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3758
6
0
0
51
Updatedlodash@latest