js-combinatorics
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -14,3 +14,3 @@ /** | ||
*/ | ||
export declare const version = "1.2.2"; | ||
export declare const version = "1.2.3"; | ||
/** | ||
@@ -60,9 +60,9 @@ * BigInt Workaround | ||
*/ | ||
static make(...args: any[]): any; | ||
static of(...args: any[]): any; | ||
/** | ||
* Same as `make` but takes a single array `arg` | ||
* Same as `of` but takes a single array `arg` | ||
* | ||
* cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible | ||
*/ | ||
static vmake(arg: any): any; | ||
static from(arg: any): any; | ||
/** | ||
@@ -69,0 +69,0 @@ * Common iterator |
@@ -14,3 +14,3 @@ /** | ||
*/ | ||
export const version = '1.2.2'; | ||
export const version = '1.2.3'; | ||
const _BI = typeof BigInt == 'function' ? BigInt : Number; | ||
@@ -83,11 +83,11 @@ /** | ||
*/ | ||
static make(...args) { | ||
static of(...args) { | ||
return new (Function.prototype.bind.apply(this, [null].concat(args))); | ||
} | ||
/** | ||
* Same as `make` but takes a single array `arg` | ||
* Same as `of` but takes a single array `arg` | ||
* | ||
* cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible | ||
*/ | ||
static vmake(arg) { | ||
static from(arg) { | ||
return new (Function.prototype.bind.apply(this, [null].concat(arg))); | ||
@@ -94,0 +94,0 @@ } |
{ | ||
"name": "js-combinatorics", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Simple combinatorics like power set, combination, and permutation in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "combinatorics.js", |
@@ -53,3 +53,3 @@ [![build status](https://secure.travis-ci.org/dankogai/js-combinatorics.png)](http://travis-ci.org/dankogai/js-combinatorics) | ||
```javascript | ||
import * as $C from 'https://cdn.jsdelivr.net/npm/js-combinatorics@1.2.2/combinatorics.min.js'; | ||
import * as $C from 'https://cdn.jsdelivr.net/npm/js-combinatorics@1.2.3/combinatorics.min.js'; | ||
``` | ||
@@ -103,3 +103,3 @@ | ||
permutation: [Function: permutation], | ||
version: '1.2.2' | ||
version: '1.2.3' | ||
} | ||
@@ -473,7 +473,7 @@ > [...new $C.Permutation('abcd')] | ||
Since the number of arguments to `CartesianProduct` is variable, it is sometimes helpful to give a single array with all arguments. But you cannot `new ctor.apply(null, args)` this case. To mitigate that, you can use `.vmake()`. | ||
Since the number of arguments to `CartesianProduct` is variable, it is sometimes helpful to give a single array with all arguments. But you cannot `new ctor.apply(null, args)` this case. To mitigate that, you can use `.from()`. | ||
```javascript | ||
let a16 = Array(16).fill('0123456789abcdef'); | ||
it = CartesianProduct.vmake(a16); | ||
it = CartesianProduct.from(a16); | ||
it.length; // 18446744073709551616n | ||
@@ -480,0 +480,0 @@ it.nth(18446744073709551615n); /* [ |
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
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
28291