join-variants

1.0.5 • Public • Published

Installation

Install this package

npm install join-variants

declare join varians in your js file.

const Variant = require(join-variants);

Usage

if you have 2 and up array of variant like this

let variant1 = ["red", "blue", "white", "orrange"];
let variant2 = ["XL", "L", "S", "XXL"];

using

Variant.join(variant1, variant2);
//Variant.join(variant1, variant2, variant3,variant4,...);

for many array as you can have a Decastian product array like below

[
  ["red", "XL"],
  ["red", "L"],
  ["red", "S"],
  ["red", "XXL"],
  ["blue", "XL"],
  ["blue", "L"],
  ["blue", "S"],
  ["blue", "XXL"],
  ["white", "XL"],
  ["white", "L"],
  ["white", "S"],
  ["white", "XXL"],
  ["orrange", "XL"],
  ["orrange", "L"],
  ["orrange", "S"],
  ["orrange", "XXL"],
];

or using Variant.joinTwo() for 2 array only

Variant.joinTwo(variant1, variant2);

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i join-variants

      Weekly Downloads

      0

      Version

      1.0.5

      License

      ISC

      Unpacked Size

      2.75 kB

      Total Files

      3

      Last publish

      Collaborators

      • hotrungnhan