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

lodash.product

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.product - npm Package Compare versions

Comparing version 17.8.19 to 17.12.17

25

lodash.product.js

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

(function(_) {
_.mixin({product: function() {
var collections = _.map(arguments, _.values);
var product = [];
(function f(tuple) {
if (tuple.length < collections.length) {
_.forEach(collections[tuple.length], function(value) {
f(_.concat(tuple, [value]));
});
} else {
product.push(tuple);
}
})([]);
return product;
}});
})((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({product:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];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(e,f){f.length<t.length?n.forEach(t[f.length],function(t){e(n.concat(f,[t]))}):o.push(f)})([]),o}})});

53

package.json
{
"name": "lodash.product",
"version": "17.8.19",
"description": "Calculates the Cartesian product between multiple collections.",
"main": "lodash.product.js",
"repository": {
"type": "git",
"url": "git+https://github.com/SeregPie/lodash.product.git"
},
"author": "Sergej Sintschilin",
"license": "MIT",
"bugs": {
"url": "https://github.com/SeregPie/lodash.product/issues"
},
"homepage": "https://github.com/SeregPie/lodash.product#readme",
"dependencies": {
"lodash": "latest"
}
"name": "lodash.product",
"version": "17.12.17",
"description": "Calculates the Cartesian product between multiple collections.",
"main": "lodash.product.js",
"scripts": {
"build": "rollup -c",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SeregPie/lodash.product.git"
},
"keywords": [
"array",
"cartesian",
"collection",
"combinatorics",
"lodash",
"mixin",
"product"
],
"author": "Sergej Sintschilin",
"license": "MIT",
"bugs": {
"url": "https://github.com/SeregPie/lodash.product/issues"
},
"homepage": "https://github.com/SeregPie/lodash.product#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"
}
}

@@ -19,3 +19,3 @@ # lodash.product

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

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

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

@@ -49,11 +58,15 @@

```javascript
```js
let product = _.product([false, true], ['a', 'b', 'c'], [{}]);
// => [[false, 'a', {}], [false, 'b', {}], [false, 'c', {}], [true, 'a', {}], [true, 'b', {}], [true, 'c', {}]]
```
```javascript
```js
let array = [1, 2, 3];
let product = _.product(array, array);
// => [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]
```
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