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

lodash.combinations

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.combinations - npm Package Compare versions

Comparing version 17.8.19 to 17.12.17

25

lodash.combinations.js

@@ -1,24 +0,1 @@

(function(_) {
_.mixin({combinations: function(values, n) {
values = _.values(values);
var combinations = [];
(function f(combination, index) {
if (combination.length < n) {
_.find(values, function(value, index) {
f(_.concat(combination, [value]), index + 1);
}, index);
} else {
combinations.push(combination);
}
})([], 0);
return combinations;
}});
})((function() {
if (typeof module !== 'undefined' && typeof exports !== 'undefined' && this === exports) {
return require('lodash');
} else {
return _;
}
}).call(this));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):t(n._)}(this,function(n){"use strict";(n=n&&n.hasOwnProperty("default")?n.default:n).mixin({combinations:function(t,e){t=n.values(t);var o=[];return function(n){var t=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];return n.call.apply(n,[this,t].concat(e))};return t}(function(i,f,u){f.length<e?n.find(t,function(t,e){i(n.concat(f,[t]),e+1)},u):o.push(f)})([],0),o}})});

51

package.json
{
"name": "lodash.combinations",
"version": "17.8.19",
"description": "Calculates all possible combinations of certain size.",
"main": "lodash.combinations.js",
"repository": {
"type": "git",
"url": "git+https://github.com/SeregPie/lodash.combinations.git"
},
"author": "Sergej Sintschilin",
"license": "MIT",
"bugs": {
"url": "https://github.com/SeregPie/lodash.combinations/issues"
},
"homepage": "https://github.com/SeregPie/lodash.combinations#readme",
"dependencies": {
"lodash": "latest"
}
"name": "lodash.combinations",
"version": "17.12.17",
"description": "Calculates all possible combinations of certain size.",
"main": "lodash.combinations.js",
"scripts": {
"build": "rollup -c",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SeregPie/lodash.combinations.git"
},
"keywords": [
"array",
"collection",
"combinatorics",
"lodash",
"mixin"
],
"author": "Sergej Sintschilin",
"license": "MIT",
"bugs": {
"url": "https://github.com/SeregPie/lodash.combinations/issues"
},
"homepage": "https://github.com/SeregPie/lodash.combinations#readme",
"dependencies": {
"lodash": "^4.17.4"
},
"devDependencies": {
"eslint": "^4.13.1",
"rollup": "^0.52.2",
"rollup-plugin-buble": "^0.18.0",
"rollup-plugin-uglify": "^2.0.1"
}
}

@@ -20,3 +20,3 @@ # lodash.combinations

Install the [package](https://www.npmjs.com/package/lodash.combinations) via npm.
### npm

@@ -29,13 +29,22 @@ ```sh

Import the module into your Node.js project.
### ES module
```javascript
```js
import _ from 'lodash';
import 'lodash.combinations';
```
### Node
```js
const _ = require('lodash');
require('lodash.combinations');
```
---
### browser
Include the code in your page via a CDN.
```html

@@ -50,5 +59,7 @@

```javascript
```js
let combinations = _.combinations([{a: 11}, {b: 22}, {c: 33}], 2);
// => [[{a: 11}, {b: 22}], [{a: 11}, {c: 33}], [{b: 22}, {c: 33}]]
```

@@ -60,5 +71,7 @@

```javascript
```js
let combinations = _.flatMap([1, 2, 3], (v, i, a) => _.combinations(a, i + 1));
// => [[1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
```

@@ -70,5 +83,7 @@

```javascript
```js
let combinations = _.combinations('abcde', 3);
// => [['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'b', 'e'], ['a', 'c', 'd'], ['a', 'c', 'e'], ['a', 'd', 'e'], ['b', 'c', 'd'], ['b', 'c', 'e'], ['b', 'd', 'e'], ['c', 'd', 'e']]
```
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