idk anymore
This commit is contained in:
parent
8b0ed2c36f
commit
4164a9f836
194 changed files with 977404 additions and 7 deletions
2
.vscode/settings.json
vendored
Normal file
2
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
18
bot.js
18
bot.js
|
@ -13,16 +13,26 @@ const masto = await login({
|
|||
|
||||
console.log("selfcarebot starting...");
|
||||
|
||||
const M = await masto.v1.statuses.create ({
|
||||
status: 'Testing; coming soon! 🌸',
|
||||
const data1 = fspkg.readFile('dataset1.json', 'utf8', (error, data) => {
|
||||
if (error){
|
||||
console.log(error);
|
||||
return;
|
||||
}
|
||||
console.log(JSON.parse(data));
|
||||
})
|
||||
|
||||
|
||||
|
||||
const status = await masto.v1.statuses.create ({
|
||||
status: `${data1} selfcare! 🌸`,
|
||||
visibility: 'public',
|
||||
});
|
||||
|
||||
M.post('statuses', (error, data) => {
|
||||
console.log('masto.v1.statuses', 'utf8', (error, data) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
fs.writeFileSync('data.json', JSON.stringify(data, null, 2));
|
||||
fspkg.writeFileSync('data.json',JSON.stringify(data, null, 2));
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
|
|
34
bot2.js
Normal file
34
bot2.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
import * as dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
import { login } from 'masto';
|
||||
import expresspkg from 'express';
|
||||
const { jsonContent } = expresspkg;
|
||||
import * as fspkg from 'fs';
|
||||
const { fs } = fspkg;
|
||||
|
||||
console.log("selfcarebot is starting...");
|
||||
|
||||
|
||||
const masto = await login({
|
||||
url: process.env.URL,
|
||||
accessToken: process.env.ACCESS_TOKEN,
|
||||
});
|
||||
|
||||
const jsonData = JSON.parse(fspkg.readFileSync('dataset1.json', 'utf-8', (error, data, status) => {
|
||||
if (error){
|
||||
console.log(error);
|
||||
return;
|
||||
}
|
||||
console.log(JSON.parse(data));
|
||||
console.log(JSON.parse(status));
|
||||
}))
|
||||
|
||||
const stat = jsonData[stat];
|
||||
var random = jsonData[stat][Math.floor(Math.random()*jsonContent[stat].length)];
|
||||
|
||||
const stati = await masto.statuses.create({
|
||||
status: `${random} selfcare! 🌸`,
|
||||
visibility: 'public',
|
||||
});
|
||||
|
||||
console.log(stati.url);
|
2
clip
Normal file
2
clip
Normal file
|
@ -0,0 +1,2 @@
|
|||
"type": "module",
|
||||
|
10
dataset1.json
Normal file
10
dataset1.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"status":[
|
||||
"Yoga is",
|
||||
"Baths are",
|
||||
"Skin care routines are",
|
||||
"New nail polish is",
|
||||
"Meditation is",
|
||||
"Smoking weed is"
|
||||
]
|
||||
}
|
1
node_modules/.bin/tsc
generated
vendored
Symbolic link
1
node_modules/.bin/tsc
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../typescript/bin/tsc
|
1
node_modules/.bin/tsserver
generated
vendored
Symbolic link
1
node_modules/.bin/tsserver
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../typescript/bin/tsserver
|
33
node_modules/.package-lock.json
generated
vendored
33
node_modules/.package-lock.json
generated
vendored
|
@ -725,6 +725,17 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/random": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/random/-/random-4.1.0.tgz",
|
||||
"integrity": "sha512-6Ajb7XmMSE9EFAMGC3kg9mvE7fGlBip25mYYuSMzw/uUSrmGilvZo2qwX3RnTRjwXkwkS+4swse9otZ92VjAtQ==",
|
||||
"dependencies": {
|
||||
"seedrandom": "^3.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
|
@ -747,6 +758,11 @@
|
|||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/rl": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rl/-/rl-0.0.1.tgz",
|
||||
"integrity": "sha512-7o+240rp1NZJa/AZeGXOued16m3iERog/Ivay4KLa6D5QGxFmoAEi2IdkH79mAqmvUo5hFILJm/l1kGOcqOTUQ=="
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
|
@ -771,6 +787,11 @@
|
|||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/seedrandom": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
|
||||
"integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
|
||||
|
@ -902,6 +923,18 @@
|
|||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz",
|
||||
"integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
|
|
3
node_modules/random/dist/distributions/bates.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/bates.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, n?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/bernoulli.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/bernoulli.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, p?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/binomial.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/binomial.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, n?: number, p?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/exponential.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/exponential.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, lambda?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/geometric.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/geometric.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, p?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/irwin-hall.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/irwin-hall.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, n?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/log-normal.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/log-normal.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, mu?: number, sigma?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/normal.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/normal.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, mu?: number, sigma?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/pareto.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/pareto.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, alpha?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/poisson.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/poisson.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, lambda?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/uniform-boolean.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/uniform-boolean.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random) => () => boolean;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/uniform-int.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/uniform-int.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, min?: number, max?: number) => () => number;
|
||||
export default _default;
|
3
node_modules/random/dist/distributions/uniform.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/distributions/uniform.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Random } from '../random';
|
||||
declare const _default: (random: Random, min?: number, max?: number) => () => number;
|
||||
export default _default;
|
9
node_modules/random/dist/generators/function.d.ts
generated
vendored
Normal file
9
node_modules/random/dist/generators/function.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
import RNG, { SeedFn } from '../rng';
|
||||
export default class RNGFunction extends RNG {
|
||||
_rng: SeedFn;
|
||||
constructor(thunk: SeedFn, opts?: Record<string, unknown>);
|
||||
get name(): string;
|
||||
next(): number;
|
||||
seed(thunk: SeedFn, _opts?: Record<string, unknown>): void;
|
||||
clone(_: undefined, opts: Record<string, unknown>): RNGFunction;
|
||||
}
|
7
node_modules/random/dist/generators/math-random.d.ts
generated
vendored
Normal file
7
node_modules/random/dist/generators/math-random.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import RNG from '../rng';
|
||||
export default class RNGMathRandom extends RNG {
|
||||
get name(): string;
|
||||
next(): number;
|
||||
seed(_seed: unknown, _opts: Record<string, unknown>): void;
|
||||
clone(): RNGMathRandom;
|
||||
}
|
12
node_modules/random/dist/generators/xor128.d.ts
generated
vendored
Normal file
12
node_modules/random/dist/generators/xor128.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
import RNG from '../rng';
|
||||
export default class RNGXOR128 extends RNG {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
constructor(seed: number, opts?: Record<string, unknown>);
|
||||
get name(): string;
|
||||
next(): number;
|
||||
seed(seed: number, opts?: Record<string, unknown>): void;
|
||||
clone(seed: number, opts: Record<string, unknown>): RNGXOR128;
|
||||
}
|
3
node_modules/random/dist/index.d.ts
generated
vendored
Normal file
3
node_modules/random/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import random from './random';
|
||||
export * from './random';
|
||||
export default random;
|
267
node_modules/random/dist/random.d.ts
generated
vendored
Normal file
267
node_modules/random/dist/random.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,267 @@
|
|||
import RNG from './rng';
|
||||
import RNGFactory from './rng-factory';
|
||||
/**
|
||||
* Distribution function
|
||||
*/
|
||||
interface IDistFn<R> {
|
||||
(random: Random, ...argv: any): R;
|
||||
}
|
||||
/**
|
||||
* Distribution
|
||||
*/
|
||||
interface IDist<R> {
|
||||
(): R;
|
||||
}
|
||||
/**
|
||||
* Keyed cache entry
|
||||
*/
|
||||
interface ICacheEntry<T> {
|
||||
key: string;
|
||||
distribution: () => T;
|
||||
}
|
||||
export { RNG, RNGFactory };
|
||||
/**
|
||||
* Seedable random number generator supporting many common distributions.
|
||||
*
|
||||
* Defaults to Math.random as its underlying pseudorandom number generator.
|
||||
*
|
||||
* @name Random
|
||||
* @class
|
||||
*
|
||||
* @param {RNG|function} [rng=Math.random] - Underlying pseudorandom number generator.
|
||||
*/
|
||||
export declare class Random {
|
||||
protected _rng: RNG;
|
||||
protected _patch: typeof Math.random | undefined;
|
||||
protected _cache: {
|
||||
[k: string]: ICacheEntry<any>;
|
||||
};
|
||||
constructor(rng?: RNG);
|
||||
/**
|
||||
* @member {RNG} Underlying pseudo-random number generator
|
||||
*/
|
||||
get rng(): RNG;
|
||||
/**
|
||||
* Creates a new `Random` instance, optionally specifying parameters to
|
||||
* set a new seed.
|
||||
*
|
||||
* @see RNG.clone
|
||||
*
|
||||
* @param {string} [seed] - Optional seed for new RNG.
|
||||
* @param {object} [opts] - Optional config for new RNG options.
|
||||
* @return {Random}
|
||||
*/
|
||||
clone<T>(...args: [T]): Random;
|
||||
/**
|
||||
* Sets the underlying pseudorandom number generator used via
|
||||
* either an instance of `seedrandom`, a custom instance of RNG
|
||||
* (for PRNG plugins), or a string specifying the PRNG to use
|
||||
* along with an optional `seed` and `opts` to initialize the
|
||||
* RNG.
|
||||
*
|
||||
* @example
|
||||
* import random from 'random'
|
||||
*
|
||||
* random.use('example_seedrandom_string')
|
||||
* // or
|
||||
* random.use(seedrandom('kittens'))
|
||||
* // or
|
||||
* random.use(Math.random)
|
||||
*
|
||||
* @param {...*} args
|
||||
*/
|
||||
use(...args: [RNG]): void;
|
||||
/**
|
||||
* Patches `Math.random` with this Random instance's PRNG.
|
||||
*/
|
||||
patch(): void;
|
||||
/**
|
||||
* Restores a previously patched `Math.random` to its original value.
|
||||
*/
|
||||
unpatch(): void;
|
||||
/**
|
||||
* Convenience wrapper around `this.rng.next()`
|
||||
*
|
||||
* Returns a floating point number in [0, 1).
|
||||
*
|
||||
* @return {number}
|
||||
*/
|
||||
next: () => number;
|
||||
/**
|
||||
* Samples a uniform random floating point number, optionally specifying
|
||||
* lower and upper bounds.
|
||||
*
|
||||
* Convence wrapper around `random.uniform()`
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (float, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (float, exclusive)
|
||||
* @return {number}
|
||||
*/
|
||||
float: (min?: number, max?: number) => number;
|
||||
/**
|
||||
* Samples a uniform random integer, optionally specifying lower and upper
|
||||
* bounds.
|
||||
*
|
||||
* Convence wrapper around `random.uniformInt()`
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (integer, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (integer, inclusive)
|
||||
* @return {number}
|
||||
*/
|
||||
int: (min?: number, max?: number) => number;
|
||||
/**
|
||||
* Samples a uniform random integer, optionally specifying lower and upper
|
||||
* bounds.
|
||||
*
|
||||
* Convence wrapper around `random.uniformInt()`
|
||||
*
|
||||
* @alias `random.int`
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (integer, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (integer, inclusive)
|
||||
* @return {number}
|
||||
*/
|
||||
integer: (min?: number, max?: number) => number;
|
||||
/**
|
||||
* Samples a uniform random boolean value.
|
||||
*
|
||||
* Convence wrapper around `random.uniformBoolean()`
|
||||
*
|
||||
* @alias `random.boolean`
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
bool: () => boolean;
|
||||
/**
|
||||
* Samples a uniform random boolean value.
|
||||
*
|
||||
* Convence wrapper around `random.uniformBoolean()`
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
boolean: () => boolean;
|
||||
/**
|
||||
* Returns an item chosen uniformly at trandom from the given array.
|
||||
*
|
||||
* Convence wrapper around `random.uniformInt()`
|
||||
*
|
||||
* @param {Array<T>} [array] - Lower bound (integer, inclusive)
|
||||
* @return {T | undefined}
|
||||
*/
|
||||
choice<T>(array: Array<T>): T | undefined;
|
||||
/**
|
||||
* Generates a [Continuous uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)).
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (float, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (float, exclusive)
|
||||
* @return {function}
|
||||
*/
|
||||
uniform: (min?: number, max?: number) => IDist<number>;
|
||||
/**
|
||||
* Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution).
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (integer, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (integer, inclusive)
|
||||
* @return {function}
|
||||
*/
|
||||
uniformInt: (min?: number, max?: number) => IDist<number>;
|
||||
/**
|
||||
* Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution),
|
||||
* with two possible outcomes, `true` or `false.
|
||||
*
|
||||
* This method is analogous to flipping a coin.
|
||||
*
|
||||
* @return {function}
|
||||
*/
|
||||
uniformBoolean: () => IDist<boolean>;
|
||||
/**
|
||||
* Generates a [Normal distribution](https://en.wikipedia.org/wiki/Normal_distribution).
|
||||
*
|
||||
* @param {number} [mu=0] - Mean
|
||||
* @param {number} [sigma=1] - Standard deviation
|
||||
* @return {function}
|
||||
*/
|
||||
normal: (mu?: number, sigma?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution).
|
||||
*
|
||||
* @param {number} [mu=0] - Mean of underlying normal distribution
|
||||
* @param {number} [sigma=1] - Standard deviation of underlying normal distribution
|
||||
* @return {function}
|
||||
*/
|
||||
logNormal: (mu?: number, sigma?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Bernoulli distribution](https://en.wikipedia.org/wiki/Bernoulli_distribution).
|
||||
*
|
||||
* @param {number} [p=0.5] - Success probability of each trial.
|
||||
* @return {function}
|
||||
*/
|
||||
bernoulli: (p?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution).
|
||||
*
|
||||
* @param {number} [n=1] - Number of trials.
|
||||
* @param {number} [p=0.5] - Success probability of each trial.
|
||||
* @return {function}
|
||||
*/
|
||||
binomial: (n?: number, p?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Geometric distribution](https://en.wikipedia.org/wiki/Geometric_distribution).
|
||||
*
|
||||
* @param {number} [p=0.5] - Success probability of each trial.
|
||||
* @return {function}
|
||||
*/
|
||||
geometric: (p?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution).
|
||||
*
|
||||
* @param {number} [lambda=1] - Mean (lambda > 0)
|
||||
* @return {function}
|
||||
*/
|
||||
poisson: (lambda?: number) => () => number;
|
||||
/**
|
||||
* Generates an [Exponential distribution](https://en.wikipedia.org/wiki/Exponential_distribution).
|
||||
*
|
||||
* @param {number} [lambda=1] - Inverse mean (lambda > 0)
|
||||
* @return {function}
|
||||
*/
|
||||
exponential: (lambda?: number) => () => number;
|
||||
/**
|
||||
* Generates an [Irwin Hall distribution](https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution).
|
||||
*
|
||||
* @param {number} [n=1] - Number of uniform samples to sum (n >= 0)
|
||||
* @return {function}
|
||||
*/
|
||||
irwinHall: (n?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Bates distribution](https://en.wikipedia.org/wiki/Bates_distribution).
|
||||
*
|
||||
* @param {number} [n=1] - Number of uniform samples to average (n >= 1)
|
||||
* @return {function}
|
||||
*/
|
||||
bates: (n?: number) => () => number;
|
||||
/**
|
||||
* Generates a [Pareto distribution](https://en.wikipedia.org/wiki/Pareto_distribution).
|
||||
*
|
||||
* @param {number} [alpha=1] - Alpha
|
||||
* @return {function}
|
||||
*/
|
||||
pareto: (alpha?: number) => () => number;
|
||||
/**
|
||||
* Memoizes distributions to ensure they're only created when necessary.
|
||||
*
|
||||
* Returns a thunk which that returns independent, identically distributed
|
||||
* samples from the specified distribution.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {string} label - Name of distribution
|
||||
* @param {function} getter - Function which generates a new distribution
|
||||
* @param {...*} args - Distribution-specific arguments
|
||||
*
|
||||
* @return {function}
|
||||
*/
|
||||
_memoize<T>(label: string, getter: IDistFn<any>, ...args: any[]): IDist<T>;
|
||||
}
|
||||
declare const _default: Random;
|
||||
export default _default;
|
638
node_modules/random/dist/random.module.js
generated
vendored
Normal file
638
node_modules/random/dist/random.module.js
generated
vendored
Normal file
|
@ -0,0 +1,638 @@
|
|||
import seedrandom from 'seedrandom';
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
||||
}
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
function _inheritsLoose(subClass, superClass) {
|
||||
subClass.prototype = Object.create(superClass.prototype);
|
||||
subClass.prototype.constructor = subClass;
|
||||
_setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
function _toPrimitive(input, hint) {
|
||||
if (typeof input !== "object" || input === null) return input;
|
||||
var prim = input[Symbol.toPrimitive];
|
||||
if (prim !== undefined) {
|
||||
var res = prim.call(input, hint || "default");
|
||||
if (typeof res !== "object") return res;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (hint === "string" ? String : Number)(input);
|
||||
}
|
||||
function _toPropertyKey(arg) {
|
||||
var key = _toPrimitive(arg, "string");
|
||||
return typeof key === "symbol" ? key : String(key);
|
||||
}
|
||||
|
||||
var RNG = /*#__PURE__*/function () {
|
||||
function RNG() {}
|
||||
var _proto = RNG.prototype;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_proto._seed = function _seed(seed, _opts) {
|
||||
// TODO: add entropy and stuff
|
||||
if (seed === (seed || 0)) {
|
||||
return seed;
|
||||
} else {
|
||||
var strSeed = '' + seed;
|
||||
var s = 0;
|
||||
for (var k = 0; k < strSeed.length; ++k) {
|
||||
s ^= strSeed.charCodeAt(k) | 0;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
};
|
||||
return RNG;
|
||||
}();
|
||||
|
||||
var RNGFunction = /*#__PURE__*/function (_RNG) {
|
||||
_inheritsLoose(RNGFunction, _RNG);
|
||||
function RNGFunction(thunk, opts) {
|
||||
var _this;
|
||||
_this = _RNG.call(this) || this;
|
||||
_this._rng = void 0;
|
||||
_this.seed(thunk, opts);
|
||||
return _this;
|
||||
}
|
||||
var _proto = RNGFunction.prototype;
|
||||
_proto.next = function next() {
|
||||
return this._rng();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
;
|
||||
_proto.seed = function seed(thunk, _opts) {
|
||||
this._rng = thunk;
|
||||
};
|
||||
_proto.clone = function clone(_, opts) {
|
||||
return new RNGFunction(this._rng, opts);
|
||||
};
|
||||
_createClass(RNGFunction, [{
|
||||
key: "name",
|
||||
get: function get() {
|
||||
return 'function';
|
||||
}
|
||||
}]);
|
||||
return RNGFunction;
|
||||
}(RNG);
|
||||
|
||||
/**
|
||||
* Construct an RNG with variable inputs. Used in calls to Random constructor
|
||||
* @param {...*} args - Distribution-specific arguments
|
||||
* @return RNG
|
||||
*
|
||||
* @example
|
||||
* new Random(RNGFactory(...args))
|
||||
*/
|
||||
var RNGFactory = (function () {
|
||||
var args = [].slice.call(arguments);
|
||||
var _args = args,
|
||||
_args$ = _args[0],
|
||||
arg0 = _args$ === void 0 ? 'default' : _args$;
|
||||
switch (typeof arg0) {
|
||||
case 'object':
|
||||
if (arg0 instanceof RNG) {
|
||||
return arg0;
|
||||
}
|
||||
break;
|
||||
case 'function':
|
||||
return new RNGFunction(arg0);
|
||||
case 'number':
|
||||
case 'string':
|
||||
default:
|
||||
return new RNGFunction(seedrandom.apply(void 0, args));
|
||||
}
|
||||
throw new Error("invalid RNG \"" + arg0 + "\"");
|
||||
});
|
||||
|
||||
var uniform = (function (random, min, max) {
|
||||
if (min === void 0) {
|
||||
min = 0;
|
||||
}
|
||||
if (max === void 0) {
|
||||
max = 1;
|
||||
}
|
||||
return function () {
|
||||
return random.next() * (max - min) + min;
|
||||
};
|
||||
});
|
||||
|
||||
function numberValidator(num) {
|
||||
return new NumberValidator(num);
|
||||
}
|
||||
var NumberValidator = function NumberValidator(num) {
|
||||
var _this = this;
|
||||
this.n = void 0;
|
||||
this.isInt = function () {
|
||||
if (Number.isInteger(_this.n)) {
|
||||
return _this;
|
||||
}
|
||||
throw new Error("Expected number to be an integer, got " + _this.n);
|
||||
};
|
||||
this.isPositive = function () {
|
||||
if (_this.n > 0) {
|
||||
return _this;
|
||||
}
|
||||
throw new Error("Expected number to be positive, got " + _this.n);
|
||||
};
|
||||
this.lessThan = function (v) {
|
||||
if (_this.n < v) {
|
||||
return _this;
|
||||
}
|
||||
throw new Error("Expected number to be less than " + v + ", got " + _this.n);
|
||||
};
|
||||
this.greaterThanOrEqual = function (v) {
|
||||
if (_this.n >= v) {
|
||||
return _this;
|
||||
}
|
||||
throw new Error("Expected number to be greater than or equal to " + v + ", got " + _this.n);
|
||||
};
|
||||
this.greaterThan = function (v) {
|
||||
if (_this.n > v) {
|
||||
return _this;
|
||||
}
|
||||
throw new Error("Expected number to be greater than " + v + ", got " + _this.n);
|
||||
};
|
||||
this.n = num;
|
||||
};
|
||||
|
||||
var uniformInt = (function (random, min, max) {
|
||||
if (min === void 0) {
|
||||
min = 0;
|
||||
}
|
||||
if (max === void 0) {
|
||||
max = 1;
|
||||
}
|
||||
if (max === undefined) {
|
||||
max = min === undefined ? 1 : min;
|
||||
min = 0;
|
||||
}
|
||||
numberValidator(min).isInt();
|
||||
numberValidator(max).isInt();
|
||||
return function () {
|
||||
return Math.floor(random.next() * (max - min + 1) + min);
|
||||
};
|
||||
});
|
||||
|
||||
var uniformBoolean = (function (random) {
|
||||
return function () {
|
||||
return random.next() >= 0.5;
|
||||
};
|
||||
});
|
||||
|
||||
var normal = (function (random, mu, sigma) {
|
||||
if (mu === void 0) {
|
||||
mu = 0;
|
||||
}
|
||||
if (sigma === void 0) {
|
||||
sigma = 1;
|
||||
}
|
||||
return function () {
|
||||
var x, y, r;
|
||||
do {
|
||||
x = random.next() * 2 - 1;
|
||||
y = random.next() * 2 - 1;
|
||||
r = x * x + y * y;
|
||||
} while (!r || r > 1);
|
||||
return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
|
||||
};
|
||||
});
|
||||
|
||||
var logNormal = (function (random, mu, sigma) {
|
||||
if (mu === void 0) {
|
||||
mu = 0;
|
||||
}
|
||||
if (sigma === void 0) {
|
||||
sigma = 1;
|
||||
}
|
||||
var normal = random.normal(mu, sigma);
|
||||
return function () {
|
||||
return Math.exp(normal());
|
||||
};
|
||||
});
|
||||
|
||||
var bernoulli = (function (random, p) {
|
||||
if (p === void 0) {
|
||||
p = 0.5;
|
||||
}
|
||||
numberValidator(p).greaterThanOrEqual(0).lessThan(1);
|
||||
return function () {
|
||||
return Math.floor(random.next() + p);
|
||||
};
|
||||
});
|
||||
|
||||
var binomial = (function (random, n, p) {
|
||||
if (n === void 0) {
|
||||
n = 1;
|
||||
}
|
||||
if (p === void 0) {
|
||||
p = 0.5;
|
||||
}
|
||||
numberValidator(n).isInt().isPositive();
|
||||
numberValidator(p).greaterThanOrEqual(0).lessThan(1);
|
||||
return function () {
|
||||
var i = 0;
|
||||
var x = 0;
|
||||
while (i++ < n) {
|
||||
if (random.next() < p) {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
};
|
||||
});
|
||||
|
||||
var geometric = (function (random, p) {
|
||||
if (p === void 0) {
|
||||
p = 0.5;
|
||||
}
|
||||
numberValidator(p).greaterThan(0).lessThan(1);
|
||||
var invLogP = 1.0 / Math.log(1.0 - p);
|
||||
return function () {
|
||||
return Math.floor(1 + Math.log(random.next()) * invLogP);
|
||||
};
|
||||
});
|
||||
|
||||
var logFactorialTable = [0.0, 0.0, 0.69314718055994529, 1.791759469228055, 3.1780538303479458, 4.7874917427820458, 6.5792512120101012, 8.5251613610654147, 10.604602902745251, 12.801827480081469];
|
||||
var logFactorial = function logFactorial(k) {
|
||||
return logFactorialTable[k];
|
||||
};
|
||||
var logSqrt2PI = 0.91893853320467267;
|
||||
var poisson = (function (random, lambda) {
|
||||
if (lambda === void 0) {
|
||||
lambda = 1;
|
||||
}
|
||||
numberValidator(lambda).isPositive();
|
||||
if (lambda < 10) {
|
||||
// inversion method
|
||||
var expMean = Math.exp(-lambda);
|
||||
return function () {
|
||||
var p = expMean;
|
||||
var x = 0;
|
||||
var u = random.next();
|
||||
while (u > p) {
|
||||
u = u - p;
|
||||
p = lambda * p / ++x;
|
||||
}
|
||||
return x;
|
||||
};
|
||||
} else {
|
||||
// generative method
|
||||
var smu = Math.sqrt(lambda);
|
||||
var b = 0.931 + 2.53 * smu;
|
||||
var a = -0.059 + 0.02483 * b;
|
||||
var invAlpha = 1.1239 + 1.1328 / (b - 3.4);
|
||||
var vR = 0.9277 - 3.6224 / (b - 2);
|
||||
return function () {
|
||||
while (true) {
|
||||
var u = void 0;
|
||||
var v = random.next();
|
||||
if (v <= 0.86 * vR) {
|
||||
u = v / vR - 0.43;
|
||||
return Math.floor((2 * a / (0.5 - Math.abs(u)) + b) * u + lambda + 0.445);
|
||||
}
|
||||
if (v >= vR) {
|
||||
u = random.next() - 0.5;
|
||||
} else {
|
||||
u = v / vR - 0.93;
|
||||
u = (u < 0 ? -0.5 : 0.5) - u;
|
||||
v = random.next() * vR;
|
||||
}
|
||||
var us = 0.5 - Math.abs(u);
|
||||
if (us < 0.013 && v > us) {
|
||||
continue;
|
||||
}
|
||||
var k = Math.floor((2 * a / us + b) * u + lambda + 0.445);
|
||||
v = v * invAlpha / (a / (us * us) + b);
|
||||
if (k >= 10) {
|
||||
var t = (k + 0.5) * Math.log(lambda / k) - lambda - logSqrt2PI + k - (1 / 12.0 - (1 / 360.0 - 1 / (1260.0 * k * k)) / (k * k)) / k;
|
||||
if (Math.log(v * smu) <= t) {
|
||||
return k;
|
||||
}
|
||||
} else if (k >= 0) {
|
||||
var _logFactorial;
|
||||
var f = (_logFactorial = logFactorial(k)) != null ? _logFactorial : 0;
|
||||
if (Math.log(v) <= k * Math.log(lambda) - lambda - f) {
|
||||
return k;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var exponential = (function (random, lambda) {
|
||||
if (lambda === void 0) {
|
||||
lambda = 1;
|
||||
}
|
||||
numberValidator(lambda).isPositive();
|
||||
return function () {
|
||||
return -Math.log(1 - random.next()) / lambda;
|
||||
};
|
||||
});
|
||||
|
||||
var irwinHall = (function (random, n) {
|
||||
if (n === void 0) {
|
||||
n = 1;
|
||||
}
|
||||
numberValidator(n).isInt().greaterThanOrEqual(0);
|
||||
return function () {
|
||||
var sum = 0;
|
||||
for (var i = 0; i < n; ++i) {
|
||||
sum += random.next();
|
||||
}
|
||||
return sum;
|
||||
};
|
||||
});
|
||||
|
||||
var bates = (function (random, n) {
|
||||
if (n === void 0) {
|
||||
n = 1;
|
||||
}
|
||||
numberValidator(n).isInt().isPositive();
|
||||
var irwinHall = random.irwinHall(n);
|
||||
return function () {
|
||||
return irwinHall() / n;
|
||||
};
|
||||
});
|
||||
|
||||
var pareto = (function (random, alpha) {
|
||||
if (alpha === void 0) {
|
||||
alpha = 1;
|
||||
}
|
||||
numberValidator(alpha).greaterThanOrEqual(0);
|
||||
var invAlpha = 1.0 / alpha;
|
||||
return function () {
|
||||
return 1.0 / Math.pow(1.0 - random.next(), invAlpha);
|
||||
};
|
||||
});
|
||||
|
||||
var RNGMathRandom = /*#__PURE__*/function (_RNG) {
|
||||
_inheritsLoose(RNGMathRandom, _RNG);
|
||||
function RNGMathRandom() {
|
||||
return _RNG.apply(this, arguments) || this;
|
||||
}
|
||||
var _proto = RNGMathRandom.prototype;
|
||||
_proto.next = function next() {
|
||||
return Math.random();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
;
|
||||
_proto.seed = function seed(_seed, _opts) {
|
||||
// intentionally empty
|
||||
};
|
||||
_proto.clone = function clone() {
|
||||
return new RNGMathRandom();
|
||||
};
|
||||
_createClass(RNGMathRandom, [{
|
||||
key: "name",
|
||||
get: function get() {
|
||||
return 'default';
|
||||
}
|
||||
}]);
|
||||
return RNGMathRandom;
|
||||
}(RNG);
|
||||
|
||||
/**
|
||||
* Seedable random number generator supporting many common distributions.
|
||||
*
|
||||
* Defaults to Math.random as its underlying pseudorandom number generator.
|
||||
*
|
||||
* @name Random
|
||||
* @class
|
||||
*
|
||||
* @param {RNG|function} [rng=Math.random] - Underlying pseudorandom number generator.
|
||||
*/
|
||||
var Random = /*#__PURE__*/function () {
|
||||
function Random(rng) {
|
||||
var _this = this;
|
||||
this._rng = void 0;
|
||||
this._patch = void 0;
|
||||
this._cache = {};
|
||||
this.next = function () {
|
||||
return _this._rng.next();
|
||||
};
|
||||
this["float"] = function (min, max) {
|
||||
return _this.uniform(min, max)();
|
||||
};
|
||||
this["int"] = function (min, max) {
|
||||
return _this.uniformInt(min, max)();
|
||||
};
|
||||
this.integer = function (min, max) {
|
||||
return _this.uniformInt(min, max)();
|
||||
};
|
||||
this.bool = function () {
|
||||
return _this.uniformBoolean()();
|
||||
};
|
||||
this["boolean"] = function () {
|
||||
return _this.uniformBoolean()();
|
||||
};
|
||||
this.uniform = function (min, max) {
|
||||
return _this._memoize('uniform', uniform, min, max);
|
||||
};
|
||||
this.uniformInt = function (min, max) {
|
||||
return _this._memoize('uniformInt', uniformInt, min, max);
|
||||
};
|
||||
this.uniformBoolean = function () {
|
||||
return _this._memoize('uniformBoolean', uniformBoolean);
|
||||
};
|
||||
this.normal = function (mu, sigma) {
|
||||
return normal(_this, mu, sigma);
|
||||
};
|
||||
this.logNormal = function (mu, sigma) {
|
||||
return logNormal(_this, mu, sigma);
|
||||
};
|
||||
this.bernoulli = function (p) {
|
||||
return bernoulli(_this, p);
|
||||
};
|
||||
this.binomial = function (n, p) {
|
||||
return binomial(_this, n, p);
|
||||
};
|
||||
this.geometric = function (p) {
|
||||
return geometric(_this, p);
|
||||
};
|
||||
this.poisson = function (lambda) {
|
||||
return poisson(_this, lambda);
|
||||
};
|
||||
this.exponential = function (lambda) {
|
||||
return exponential(_this, lambda);
|
||||
};
|
||||
this.irwinHall = function (n) {
|
||||
return irwinHall(_this, n);
|
||||
};
|
||||
this.bates = function (n) {
|
||||
return bates(_this, n);
|
||||
};
|
||||
this.pareto = function (alpha) {
|
||||
return pareto(_this, alpha);
|
||||
};
|
||||
if (rng && rng instanceof RNG) {
|
||||
this.use(rng);
|
||||
} else {
|
||||
this.use(new RNGMathRandom());
|
||||
}
|
||||
this._cache = {};
|
||||
}
|
||||
/**
|
||||
* @member {RNG} Underlying pseudo-random number generator
|
||||
*/
|
||||
var _proto = Random.prototype;
|
||||
/**
|
||||
* Creates a new `Random` instance, optionally specifying parameters to
|
||||
* set a new seed.
|
||||
*
|
||||
* @see RNG.clone
|
||||
*
|
||||
* @param {string} [seed] - Optional seed for new RNG.
|
||||
* @param {object} [opts] - Optional config for new RNG options.
|
||||
* @return {Random}
|
||||
*/
|
||||
_proto.clone = function clone() {
|
||||
var args = [].slice.call(arguments);
|
||||
if (args.length) {
|
||||
return new Random(RNGFactory.apply(void 0, args));
|
||||
} else {
|
||||
return new Random(this.rng.clone());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the underlying pseudorandom number generator used via
|
||||
* either an instance of `seedrandom`, a custom instance of RNG
|
||||
* (for PRNG plugins), or a string specifying the PRNG to use
|
||||
* along with an optional `seed` and `opts` to initialize the
|
||||
* RNG.
|
||||
*
|
||||
* @example
|
||||
* import random from 'random'
|
||||
*
|
||||
* random.use('example_seedrandom_string')
|
||||
* // or
|
||||
* random.use(seedrandom('kittens'))
|
||||
* // or
|
||||
* random.use(Math.random)
|
||||
*
|
||||
* @param {...*} args
|
||||
*/;
|
||||
_proto.use = function use() {
|
||||
this._rng = RNGFactory.apply(void 0, [].slice.call(arguments));
|
||||
}
|
||||
/**
|
||||
* Patches `Math.random` with this Random instance's PRNG.
|
||||
*/;
|
||||
_proto.patch = function patch() {
|
||||
if (this._patch) {
|
||||
throw new Error('Math.random already patched');
|
||||
}
|
||||
this._patch = Math.random;
|
||||
Math.random = this.uniform();
|
||||
}
|
||||
/**
|
||||
* Restores a previously patched `Math.random` to its original value.
|
||||
*/;
|
||||
_proto.unpatch = function unpatch() {
|
||||
if (this._patch) {
|
||||
Math.random = this._patch;
|
||||
delete this._patch;
|
||||
}
|
||||
}
|
||||
// --------------------------------------------------------------------------
|
||||
// Uniform utility functions
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Convenience wrapper around `this.rng.next()`
|
||||
*
|
||||
* Returns a floating point number in [0, 1).
|
||||
*
|
||||
* @return {number}
|
||||
*/;
|
||||
/**
|
||||
* Returns an item chosen uniformly at trandom from the given array.
|
||||
*
|
||||
* Convence wrapper around `random.uniformInt()`
|
||||
*
|
||||
* @param {Array<T>} [array] - Lower bound (integer, inclusive)
|
||||
* @return {T | undefined}
|
||||
*/
|
||||
_proto.choice = function choice(array) {
|
||||
if (!Array.isArray(array)) {
|
||||
throw new Error("Random.choice expected input to be an array, got " + typeof array);
|
||||
}
|
||||
var length = array == null ? void 0 : array.length;
|
||||
if (length > 0) {
|
||||
var index = this.uniformInt(0, length - 1)();
|
||||
return array[index];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
// --------------------------------------------------------------------------
|
||||
// Uniform distributions
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Generates a [Continuous uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)).
|
||||
*
|
||||
* @param {number} [min=0] - Lower bound (float, inclusive)
|
||||
* @param {number} [max=1] - Upper bound (float, exclusive)
|
||||
* @return {function}
|
||||
*/;
|
||||
// --------------------------------------------------------------------------
|
||||
// Internal
|
||||
// --------------------------------------------------------------------------
|
||||
/**
|
||||
* Memoizes distributions to ensure they're only created when necessary.
|
||||
*
|
||||
* Returns a thunk which that returns independent, identically distributed
|
||||
* samples from the specified distribution.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {string} label - Name of distribution
|
||||
* @param {function} getter - Function which generates a new distribution
|
||||
* @param {...*} args - Distribution-specific arguments
|
||||
*
|
||||
* @return {function}
|
||||
*/
|
||||
_proto._memoize = function _memoize(label, getter) {
|
||||
var args = [].slice.call(arguments, 2);
|
||||
var key = "" + args.join(';');
|
||||
var value = this._cache[label];
|
||||
if (value === undefined || value.key !== key) {
|
||||
value = {
|
||||
key: key,
|
||||
distribution: getter.apply(void 0, [this].concat(args))
|
||||
};
|
||||
this._cache[label] = value;
|
||||
}
|
||||
return value.distribution;
|
||||
};
|
||||
_createClass(Random, [{
|
||||
key: "rng",
|
||||
get: function get() {
|
||||
return this._rng;
|
||||
}
|
||||
}]);
|
||||
return Random;
|
||||
}();
|
||||
// defaults to Math.random as its RNG
|
||||
var random = new Random();
|
||||
|
||||
export { RNG, RNGFactory, Random, random as default };
|
||||
//# sourceMappingURL=random.module.js.map
|
1
node_modules/random/dist/random.module.js.map
generated
vendored
Normal file
1
node_modules/random/dist/random.module.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
node_modules/random/dist/rng-factory.d.ts
generated
vendored
Normal file
11
node_modules/random/dist/rng-factory.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
import RNG from './rng';
|
||||
/**
|
||||
* Construct an RNG with variable inputs. Used in calls to Random constructor
|
||||
* @param {...*} args - Distribution-specific arguments
|
||||
* @return RNG
|
||||
*
|
||||
* @example
|
||||
* new Random(RNGFactory(...args))
|
||||
*/
|
||||
declare const _default: <T extends any[]>(...args: T) => RNG;
|
||||
export default _default;
|
9
node_modules/random/dist/rng.d.ts
generated
vendored
Normal file
9
node_modules/random/dist/rng.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export type SeedFn = () => number;
|
||||
export type SeedType = number | string | SeedFn | RNG;
|
||||
export default abstract class RNG {
|
||||
abstract get name(): string;
|
||||
abstract next(): number;
|
||||
abstract seed(_seed?: SeedType, _opts?: Record<string, unknown>): void;
|
||||
abstract clone(_seed?: SeedType, _opts?: Record<string, unknown>): RNG;
|
||||
_seed(seed: number, _opts?: Record<string, unknown>): number;
|
||||
}
|
10
node_modules/random/dist/validation.d.ts
generated
vendored
Normal file
10
node_modules/random/dist/validation.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
export declare function numberValidator(num: number): NumberValidator;
|
||||
export declare class NumberValidator {
|
||||
private n;
|
||||
constructor(num: number);
|
||||
isInt: () => this;
|
||||
isPositive: () => this;
|
||||
lessThan: (v: number) => this;
|
||||
greaterThanOrEqual: (v: number) => this;
|
||||
greaterThan: (v: number) => this;
|
||||
}
|
21
node_modules/random/license
generated
vendored
Normal file
21
node_modules/random/license
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 Travis Fischer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
89
node_modules/random/package.json
generated
vendored
Normal file
89
node_modules/random/package.json
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"name": "random",
|
||||
"version": "4.1.0",
|
||||
"description": "Seedable random number generator supporting many common distributions.",
|
||||
"repository": "transitive-bullshit/random",
|
||||
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"import": "./dist/random.module.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/random.module.js"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"source": "./src/index.ts",
|
||||
"module": "./dist/random.module.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "run-s build:watch",
|
||||
"build": "microbundle -f esm --no-compress",
|
||||
"build:watch": "microbundle -f esm --no-compress --watch",
|
||||
"prebuild": "run-s clean",
|
||||
"prebuild:watch": "run-s clean",
|
||||
"clean": "del dist",
|
||||
"prepublishOnly": "run-s build",
|
||||
"docs": "update-markdown-jsdoc -f dist/random.module.js --shallow",
|
||||
"pretest": "run-s build",
|
||||
"test": "run-s test:*",
|
||||
"test:unit": "ava -v",
|
||||
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check",
|
||||
"test:lint": "eslint ."
|
||||
},
|
||||
"keywords": [
|
||||
"random",
|
||||
"number",
|
||||
"generator",
|
||||
"rng",
|
||||
"prng",
|
||||
"stats",
|
||||
"d3-random",
|
||||
"seedrandom",
|
||||
"distribution",
|
||||
"pseudorandom",
|
||||
"uniform",
|
||||
"normal",
|
||||
"gaussian",
|
||||
"lognormal",
|
||||
"poisson",
|
||||
"exponential",
|
||||
"irwinhall",
|
||||
"bates"
|
||||
],
|
||||
"dependencies": {
|
||||
"seedrandom": "^3.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ava/typescript": "^3.0.1",
|
||||
"@esbuild-kit/esm-loader": "^2.5.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/seedrandom": "^3.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
||||
"@typescript-eslint/parser": "^5.42.1",
|
||||
"ava": "^5.0.1",
|
||||
"del-cli": "^5.0.0",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"microbundle": "^0.15.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.8.4",
|
||||
"update-markdown-jsdoc": "^1.0.11"
|
||||
},
|
||||
"ava": {
|
||||
"extensions": {
|
||||
"ts": "module"
|
||||
},
|
||||
"nodeArguments": [
|
||||
"--loader=@esbuild-kit/esm-loader"
|
||||
]
|
||||
}
|
||||
}
|
523
node_modules/random/readme.md
generated
vendored
Normal file
523
node_modules/random/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,523 @@
|
|||
# random <!-- omit in toc -->
|
||||
|
||||
> Seedable random number generator supporting many common distributions.
|
||||
|
||||
[](https://www.npmjs.com/package/random) [](https://github.com/transitive-bullshit/random/actions/workflows/test.yml) [](https://prettier.io)
|
||||
|
||||
Welcome to the most **random** module on npm! 😜
|
||||
|
||||
## Highlights <!-- omit in toc -->
|
||||
|
||||
- Simple API (_make easy things easy and hard things possible_)
|
||||
- TypeScript supported!
|
||||
- Seedable based on entropy or user input
|
||||
- Plugin support for different pseudo random number generators (PRNGs)
|
||||
- Sample from many common distributions
|
||||
- uniform, normal, poisson, bernoulli, etc
|
||||
- Validates all user input via [ow](https://github.com/sindresorhus/ow)
|
||||
- Integrates with [seedrandom](https://github.com/davidbau/seedrandom)
|
||||
- Supports node >= 14 and browser
|
||||
|
||||
## Install <!-- omit in toc -->
|
||||
|
||||
```bash
|
||||
npm install --save random
|
||||
# or
|
||||
yarn add random
|
||||
# or
|
||||
pnpm add random
|
||||
```
|
||||
|
||||
Note: this package uses ESM and no longer provides a CommonJS export. See [here](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) for more info on how to use ESM modules.
|
||||
|
||||
## Usage <!-- omit in toc -->
|
||||
|
||||
```ts
|
||||
import random from 'random'
|
||||
|
||||
// quick uniform shortcuts
|
||||
random.float((min = 0), (max = 1)) // uniform float in [ min, max )
|
||||
random.int((min = 0), (max = 1)) // uniform integer in [ min, max ]
|
||||
random.boolean() // true or false
|
||||
|
||||
// uniform distribution
|
||||
random.uniform((min = 0), (max = 1)) // () => [ min, max )
|
||||
random.uniformInt((min = 0), (max = 1)) // () => [ min, max ]
|
||||
random.uniformBoolean() // () => [ false, true ]
|
||||
|
||||
// normal distribution
|
||||
random.normal((mu = 0), (sigma = 1))
|
||||
random.logNormal((mu = 0), (sigma = 1))
|
||||
|
||||
// bernoulli distribution
|
||||
random.bernoulli((p = 0.5))
|
||||
random.binomial((n = 1), (p = 0.5))
|
||||
random.geometric((p = 0.5))
|
||||
|
||||
// poisson distribution
|
||||
random.poisson((lambda = 1))
|
||||
random.exponential((lambda = 1))
|
||||
|
||||
// misc distribution
|
||||
random.irwinHall(n)
|
||||
random.bates(n)
|
||||
random.pareto(alpha)
|
||||
```
|
||||
|
||||
For convenience, several common uniform samplers are exposed directly:
|
||||
|
||||
```ts
|
||||
random.float() // 0.2149383367670885
|
||||
random.int(0, 100) // 72
|
||||
random.boolean() // true
|
||||
|
||||
// random array item
|
||||
random.choice([1, true, 'foo']) // 'foo'
|
||||
```
|
||||
|
||||
**All distribution methods return a thunk** (function with no params), which will return a series of independent, identically distributed random variables from the specified distribution.
|
||||
|
||||
```ts
|
||||
// create a normal distribution with default params (mu=1 and sigma=0)
|
||||
const normal = random.normal()
|
||||
normal() // 0.4855465422678824
|
||||
normal() // -0.06696771815439678
|
||||
normal() // 0.7350852689834705
|
||||
|
||||
// create a poisson distribution with default params (lambda=1)
|
||||
const poisson = random.poisson()
|
||||
poisson() // 0
|
||||
poisson() // 4
|
||||
poisson() // 1
|
||||
```
|
||||
|
||||
Note that returning a thunk here is more efficient when generating multiple
|
||||
samples from the same distribution.
|
||||
|
||||
You can change the underlying PRNG or its seed as follows:
|
||||
|
||||
```ts
|
||||
import seedrandom from 'seedrandom'
|
||||
|
||||
// change the underlying pseudo random number generator
|
||||
// by default, Math.random is used as the underlying PRNG
|
||||
random.use(seedrandom('foobar'))
|
||||
|
||||
// create a new independent random number generator (uses seedrandom under the hood)
|
||||
const rng = random.clone('my-new-seed')
|
||||
|
||||
// create a second independent random number generator and use a seeded PRNG
|
||||
const rng2 = random.clone(seedrandom('kittyfoo'))
|
||||
|
||||
// replace Math.random with rng.uniform
|
||||
rng.patch()
|
||||
|
||||
// restore original Math.random
|
||||
rng.unpatch()
|
||||
```
|
||||
|
||||
You can also instantiate a fresh instance of `Random`:
|
||||
|
||||
```ts
|
||||
import { Random } from 'random'
|
||||
import seedrandom from 'seedrandom'
|
||||
|
||||
const rng = new Random()
|
||||
const rng2 = new Random(seedrandom('tinykittens'))
|
||||
```
|
||||
|
||||
## API <!-- omit in toc -->
|
||||
|
||||
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
||||
|
||||
#### Table of Contents <!-- omit in toc -->
|
||||
|
||||
<!-- no toc -->
|
||||
|
||||
- [Random](#random)
|
||||
- [rng](#rng)
|
||||
- [clone](#clone)
|
||||
- [use](#use)
|
||||
- [patch](#patch)
|
||||
- [unpatch](#unpatch)
|
||||
- [next](#next)
|
||||
- [float](#float)
|
||||
- [int](#int)
|
||||
- [integer](#integer)
|
||||
- [bool](#bool)
|
||||
- [boolean](#boolean)
|
||||
- [choice](#choice)
|
||||
- [uniform](#uniform)
|
||||
- [uniformInt](#uniformint)
|
||||
- [uniformBoolean](#uniformboolean)
|
||||
- [normal](#normal)
|
||||
- [logNormal](#lognormal)
|
||||
- [bernoulli](#bernoulli)
|
||||
- [binomial](#binomial)
|
||||
- [geometric](#geometric)
|
||||
- [poisson](#poisson)
|
||||
- [exponential](#exponential)
|
||||
- [irwinHall](#irwinhall)
|
||||
- [bates](#bates)
|
||||
- [pareto](#pareto)
|
||||
|
||||
### [Random](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L36-L382)
|
||||
|
||||
Seedable random number generator supporting many common distributions.
|
||||
|
||||
Defaults to Math.random as its underlying pseudorandom number generator.
|
||||
|
||||
Type: `function (rng)`
|
||||
|
||||
- `rng` **(RNG | [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function))** Underlying pseudorandom number generator. (optional, default `Math.random`)
|
||||
|
||||
---
|
||||
|
||||
#### [rng](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L47-L49)
|
||||
|
||||
Type: `function ()`
|
||||
|
||||
---
|
||||
|
||||
#### [clone](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L61-L67)
|
||||
|
||||
- **See: RNG.clone**
|
||||
|
||||
Creates a new `Random` instance, optionally specifying parameters to
|
||||
set a new seed.
|
||||
|
||||
Type: `function (args, seed, opts): Random`
|
||||
|
||||
- `args` **...any**
|
||||
- `seed` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Optional seed for new RNG.
|
||||
- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional config for new RNG options.
|
||||
|
||||
---
|
||||
|
||||
#### [use](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L87-L89)
|
||||
|
||||
Sets the underlying pseudorandom number generator used via
|
||||
either an instance of `seedrandom`, a custom instance of RNG
|
||||
(for PRNG plugins), or a string specifying the PRNG to use
|
||||
along with an optional `seed` and `opts` to initialize the
|
||||
RNG.
|
||||
|
||||
Type: `function (args)`
|
||||
|
||||
- `args` **...any**
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import random from 'random'
|
||||
|
||||
random.use('example_seedrandom_string')
|
||||
// or
|
||||
random.use(seedrandom('kittens'))
|
||||
// or
|
||||
random.use(Math.random)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### [patch](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L94-L101)
|
||||
|
||||
Patches `Math.random` with this Random instance's PRNG.
|
||||
|
||||
Type: `function ()`
|
||||
|
||||
---
|
||||
|
||||
#### [unpatch](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L106-L111)
|
||||
|
||||
Restores a previously patched `Math.random` to its original value.
|
||||
|
||||
Type: `function ()`
|
||||
|
||||
---
|
||||
|
||||
#### [next](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L124-L126)
|
||||
|
||||
Convenience wrapper around `this.rng.next()`
|
||||
|
||||
Returns a floating point number in \[0, 1).
|
||||
|
||||
Type: `function (): number`
|
||||
|
||||
---
|
||||
|
||||
#### [float](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L138-L140)
|
||||
|
||||
Samples a uniform random floating point number, optionally specifying
|
||||
lower and upper bounds.
|
||||
|
||||
Convence wrapper around `random.uniform()`
|
||||
|
||||
Type: `function (min, max): number`
|
||||
|
||||
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (float, inclusive) (optional, default `0`)
|
||||
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (float, exclusive) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [int](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L152-L154)
|
||||
|
||||
Samples a uniform random integer, optionally specifying lower and upper
|
||||
bounds.
|
||||
|
||||
Convence wrapper around `random.uniformInt()`
|
||||
|
||||
Type: `function (min, max): number`
|
||||
|
||||
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
|
||||
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [integer](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L168-L170)
|
||||
|
||||
Samples a uniform random integer, optionally specifying lower and upper
|
||||
bounds.
|
||||
|
||||
Convence wrapper around `random.uniformInt()`
|
||||
|
||||
Type: `function (min, max): number`
|
||||
|
||||
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
|
||||
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [bool](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L181-L183)
|
||||
|
||||
Samples a uniform random boolean value.
|
||||
|
||||
Convence wrapper around `random.uniformBoolean()`
|
||||
|
||||
Type: `function (): boolean`
|
||||
|
||||
---
|
||||
|
||||
#### [boolean](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L192-L194)
|
||||
|
||||
Samples a uniform random boolean value.
|
||||
|
||||
Convence wrapper around `random.uniformBoolean()`
|
||||
|
||||
Type: `function (): boolean`
|
||||
|
||||
---
|
||||
|
||||
#### [choice]()
|
||||
|
||||
Returns an item chosen uniformly at trandom from the given array.
|
||||
|
||||
Convence wrapper around `random.uniformInt()`
|
||||
|
||||
Type: `function choice <T> (array: Array<T>): T | undefined`
|
||||
|
||||
- `array` **[Array<T>](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of items to sample from
|
||||
|
||||
---
|
||||
|
||||
#### [uniform](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L207-L209)
|
||||
|
||||
Generates a [Continuous uniform distribution](<https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)>).
|
||||
|
||||
Type: `function (min, max): function`
|
||||
|
||||
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (float, inclusive) (optional, default `0`)
|
||||
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (float, exclusive) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [uniformInt](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L218-L220)
|
||||
|
||||
Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution).
|
||||
|
||||
Type: `function (min, max): function`
|
||||
|
||||
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
|
||||
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [uniformBoolean](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L230-L232)
|
||||
|
||||
Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution),
|
||||
with two possible outcomes, `true` or \`false.
|
||||
|
||||
This method is analogous to flipping a coin.
|
||||
|
||||
Type: `function (): function`
|
||||
|
||||
---
|
||||
|
||||
#### [normal](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L245-L247)
|
||||
|
||||
Generates a [Normal distribution](https://en.wikipedia.org/wiki/Normal_distribution).
|
||||
|
||||
Type: `function (mu, sigma): function`
|
||||
|
||||
- `mu` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean (optional, default `0`)
|
||||
- `sigma` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Standard deviation (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [logNormal](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L256-L258)
|
||||
|
||||
Generates a [Log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution).
|
||||
|
||||
Type: `function (mu, sigma): function`
|
||||
|
||||
- `mu` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean of underlying normal distribution (optional, default `0`)
|
||||
- `sigma` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Standard deviation of underlying normal distribution (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [bernoulli](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L270-L272)
|
||||
|
||||
Generates a [Bernoulli distribution](https://en.wikipedia.org/wiki/Bernoulli_distribution).
|
||||
|
||||
Type: `function (p): function`
|
||||
|
||||
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
|
||||
|
||||
---
|
||||
|
||||
#### [binomial](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L281-L283)
|
||||
|
||||
Generates a [Binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution).
|
||||
|
||||
Type: `function (n, p): function`
|
||||
|
||||
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of trials. (optional, default `1`)
|
||||
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
|
||||
|
||||
---
|
||||
|
||||
#### [geometric](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L291-L293)
|
||||
|
||||
Generates a [Geometric distribution](https://en.wikipedia.org/wiki/Geometric_distribution).
|
||||
|
||||
Type: `function (p): function`
|
||||
|
||||
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
|
||||
|
||||
---
|
||||
|
||||
#### [poisson](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L305-L307)
|
||||
|
||||
Generates a [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution).
|
||||
|
||||
Type: `function (lambda): function`
|
||||
|
||||
- `lambda` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean (lambda > 0) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [exponential](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L315-L317)
|
||||
|
||||
Generates an [Exponential distribution](https://en.wikipedia.org/wiki/Exponential_distribution).
|
||||
|
||||
Type: `function (lambda): function`
|
||||
|
||||
- `lambda` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Inverse mean (lambda > 0) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [irwinHall](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L329-L331)
|
||||
|
||||
Generates an [Irwin Hall distribution](https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution).
|
||||
|
||||
Type: `function (n): function`
|
||||
|
||||
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of uniform samples to sum (n >= 0) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [bates](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L339-L341)
|
||||
|
||||
Generates a [Bates distribution](https://en.wikipedia.org/wiki/Bates_distribution).
|
||||
|
||||
Type: `function (n): function`
|
||||
|
||||
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of uniform samples to average (n >= 1) (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
#### [pareto](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L349-L351)
|
||||
|
||||
Generates a [Pareto distribution](https://en.wikipedia.org/wiki/Pareto_distribution).
|
||||
|
||||
Type: `function (alpha): function`
|
||||
|
||||
- `alpha` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Alpha (optional, default `1`)
|
||||
|
||||
---
|
||||
|
||||
## Todo <!-- omit in toc -->
|
||||
|
||||
- Distributions
|
||||
|
||||
- [x] uniform
|
||||
- [x] uniformInt
|
||||
- [x] uniformBoolean
|
||||
- [x] normal
|
||||
- [x] logNormal
|
||||
- [ ] chiSquared
|
||||
- [ ] cauchy
|
||||
- [ ] fischerF
|
||||
- [ ] studentT
|
||||
- [x] bernoulli
|
||||
- [x] binomial
|
||||
- [ ] negativeBinomial
|
||||
- [x] geometric
|
||||
- [x] poisson
|
||||
- [x] exponential
|
||||
- [ ] gamma
|
||||
- [ ] hyperExponential
|
||||
- [ ] weibull
|
||||
- [ ] beta
|
||||
- [ ] laplace
|
||||
- [x] irwinHall
|
||||
- [x] bates
|
||||
- [x] pareto
|
||||
|
||||
- Generators
|
||||
|
||||
- [x] pluggable prng
|
||||
- [ ] port more prng from boost
|
||||
- [ ] custom entropy
|
||||
|
||||
- Misc
|
||||
- [x] browser support via rollup
|
||||
- [x] basic docs
|
||||
- [x] basic tests
|
||||
- [x] test suite
|
||||
- [x] initial release!
|
||||
- [x] typescript support
|
||||
|
||||
## Related <!-- omit in toc -->
|
||||
|
||||
- [d3-random](https://github.com/d3/d3-random) - D3's excellent random number generation library.
|
||||
- [seedrandom](https://github.com/davidbau/seedrandom) - Seedable pseudo random number generator.
|
||||
- [random-int](https://github.com/sindresorhus/random-int) - For the common use case of generating uniform random ints.
|
||||
- [random-float](https://github.com/sindresorhus/random-float) - For the common use case of generating uniform random floats.
|
||||
- [randombytes](https://github.com/crypto-browserify/randombytes) - Random crypto bytes for Node.js and the browser.
|
||||
|
||||
## Credit <!-- omit in toc -->
|
||||
|
||||
Thanks go to [Andrew Moss](https://github.com/agmoss) for the TypeScript port and for helping to maintain this package!
|
||||
|
||||
Shoutout to [Roger Combs](https://github.com/rcombs) for donating the `random` npm package for this project!
|
||||
|
||||
Lots of inspiration from [d3-random](https://github.com/d3/d3-random) ([@mbostock](https://github.com/mbostock) and [@svanschooten](https://github.com/svanschooten)).
|
||||
|
||||
Some distributions and PRNGs are ported from C++ [boost::random](https://www.boost.org/doc/libs/1_66_0/doc/html/boost_random/reference.html#boost_random.reference.distributions).
|
||||
|
||||
## License <!-- omit in toc -->
|
||||
|
||||
MIT © [Travis Fischer](https://transitivebullsh.it)
|
||||
|
||||
Support my OSS work by <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>
|
2
node_modules/rl/README.md
generated
vendored
Normal file
2
node_modules/rl/README.md
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
rl
|
||||
==
|
37
node_modules/rl/index.js
generated
vendored
Normal file
37
node_modules/rl/index.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
var util = require('util');
|
||||
var stream = require('stream');
|
||||
|
||||
var Transform = stream.Transform;
|
||||
|
||||
module.exports = StreamOfLines;
|
||||
|
||||
function StreamOfLines(options) {
|
||||
Transform.call(this, options);
|
||||
this._prevChunks = [];
|
||||
this._hasPrevChunks = false;
|
||||
}
|
||||
|
||||
util.inherits(StreamOfLines, Transform);
|
||||
|
||||
StreamOfLines.prototype._transform = function(chunk, encoding, callback) {
|
||||
chunk = chunk.toString();
|
||||
var fromIndex = 0;
|
||||
var newLineIndex;
|
||||
while ((newLineIndex = chunk.indexOf('\n', fromIndex)) != -1) {
|
||||
var line;
|
||||
if (this._hasPrevChunks) {
|
||||
line = this._prevChunks.join('') + chunk.substring(fromIndex, newLineIndex);
|
||||
this._prevChunks = [];
|
||||
this._hasPrevChunks = false;
|
||||
} else {
|
||||
line = chunk.substring(fromIndex, newLineIndex);
|
||||
}
|
||||
fromIndex = newLineIndex + 1;
|
||||
this.push(line);
|
||||
}
|
||||
if (fromIndex < chunk.length) {
|
||||
this._prevChunks.push(chunk.substring(fromIndex));
|
||||
this._hasPrevChunks = true;
|
||||
}
|
||||
callback();
|
||||
}
|
15
node_modules/rl/package.json
generated
vendored
Normal file
15
node_modules/rl/package.json
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "rl",
|
||||
"version": "0.0.1",
|
||||
"description": "Read line by line from a stream",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:grudzinski/rl.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/grudzinski/rl/issues"
|
||||
}
|
||||
}
|
1
node_modules/seedrandom/.coveralls.yml
generated
vendored
Normal file
1
node_modules/seedrandom/.coveralls.yml
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
service_name: travis-ci
|
1
node_modules/seedrandom/.nvmrc
generated
vendored
Normal file
1
node_modules/seedrandom/.nvmrc
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
6
|
1
node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json
generated
vendored
Normal file
1
node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json
generated
vendored
Normal file
1
node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"uuid":"f02e18a9-b1c7-4946-836e-c3dbfb9635a3","parent":null,"pid":8128,"argv":["/home/davidbau/.nvm/versions/node/v11.9.0/bin/node","/home/davidbau/git/seedrandom/node_modules/mocha/bin/_mocha","test/cryptotest.js","test/nodetest.js","test/prngtest.js"],"execArgv":[],"cwd":"/home/davidbau/git/seedrandom","time":1568716532937,"ppid":8121,"root":"23c2e786-6463-4b5a-9042-75ea3257640f","coverageFilename":"/home/davidbau/git/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json","files":["/home/davidbau/git/seedrandom/seedrandom.js","/home/davidbau/git/seedrandom/lib/xor128.js","/home/davidbau/git/seedrandom/lib/xorwow.js","/home/davidbau/git/seedrandom/lib/xorshift7.js","/home/davidbau/git/seedrandom/lib/xor4096.js","/home/davidbau/git/seedrandom/lib/tychei.js","/home/davidbau/git/seedrandom/lib/alea.js"]}
|
1
node_modules/seedrandom/.nyc_output/processinfo/index.json
generated
vendored
Normal file
1
node_modules/seedrandom/.nyc_output/processinfo/index.json
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"processes":{"f02e18a9-b1c7-4946-836e-c3dbfb9635a3":{"parent":null,"children":[]}},"files":{"/home/davidbau/git/seedrandom/seedrandom.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor128.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorwow.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorshift7.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor4096.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/tychei.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/alea.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"]},"externalIds":{}}
|
8
node_modules/seedrandom/.travis.yml
generated
vendored
Normal file
8
node_modules/seedrandom/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- '7'
|
||||
- '8'
|
||||
- '9'
|
||||
- '10'
|
||||
- '11'
|
97
node_modules/seedrandom/Gruntfile.js
generated
vendored
Normal file
97
node_modules/seedrandom/Gruntfile.js
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON("package.json"),
|
||||
copy: {
|
||||
browsertest: {
|
||||
files: [
|
||||
{ expand: true, cwd: 'node_modules/qunit/qunit', src: 'qunit.*' ,
|
||||
dest: 'test/lib'},
|
||||
{ expand: true, cwd: 'node_modules/requirejs', src: 'require.js',
|
||||
dest: 'test/lib'}
|
||||
],
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
all: {
|
||||
files: {
|
||||
"<%= pkg.name %>.min.js": [ "<%= pkg.name %>.js" ],
|
||||
"lib/alea.min.js": [ "lib/alea.js" ],
|
||||
"lib/tychei.min.js": [ "lib/tychei.js" ],
|
||||
"lib/xor4096.min.js": [ "lib/xor4096.js" ],
|
||||
"lib/xorshift7.min.js": [ "lib/xorshift7.js" ],
|
||||
"lib/xorwow.min.js": [ "lib/xorwow.js" ],
|
||||
"lib/xor128.min.js": [ "lib/xor128.js" ]
|
||||
},
|
||||
options: {
|
||||
preserveComments: false,
|
||||
report: "min",
|
||||
output: {
|
||||
ascii_only: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qunit: {
|
||||
options: {
|
||||
noGlobals: true,
|
||||
httpBase: 'http://localhost:8192'
|
||||
},
|
||||
all: ["test/*.html"]
|
||||
},
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 8192,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
},
|
||||
browserify: {
|
||||
test: {
|
||||
files: {
|
||||
'test/browserified.js': ['test/nodetest.js'],
|
||||
},
|
||||
options: {
|
||||
ignore: ['requirejs', 'process'],
|
||||
alias: {
|
||||
'assert': './test/qunitassert.js'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mocha_nyc: {
|
||||
coverage: {
|
||||
src: 'test/*test.js'
|
||||
},
|
||||
coveralls: {
|
||||
src: 'test/*test.js',
|
||||
options: {
|
||||
coverage: true
|
||||
}
|
||||
}
|
||||
},
|
||||
release: {
|
||||
options: {
|
||||
bump: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.event.on('coverage', require('coveralls').handleInput);
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-mocha-nyc');
|
||||
grunt.loadNpmTasks('grunt-release');
|
||||
grunt.loadNpmTasks('grunt-browserify');
|
||||
|
||||
grunt.registerTask("test", ["copy:browsertest", "browserify",
|
||||
"connect", "qunit", "mocha_nyc:coverage"]);
|
||||
grunt.registerTask("default", ["uglify", "test"]);
|
||||
grunt.registerTask("travis", ["default", "mocha_nyc:coveralls"]);
|
||||
};
|
||||
|
322
node_modules/seedrandom/README.md
generated
vendored
Normal file
322
node_modules/seedrandom/README.md
generated
vendored
Normal file
|
@ -0,0 +1,322 @@
|
|||
seedrandom.js
|
||||
=============
|
||||
[](https://travis-ci.org/davidbau/seedrandom)
|
||||
[](http://badge.fury.io/js/seedrandom)
|
||||
[](http://badge.fury.io/bo/seedrandom)
|
||||
|
||||
Seeded random number generator for JavaScript.
|
||||
|
||||
Version 3.0.5
|
||||
|
||||
Author: David Bau
|
||||
|
||||
Date: 2019-09-14
|
||||
|
||||
Can be used as a plain script, a Node.js module or an AMD module.
|
||||
|
||||
|
||||
Script tag usage
|
||||
----------------
|
||||
|
||||
```html
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js">
|
||||
</script>
|
||||
```
|
||||
|
||||
```js
|
||||
// Make a predictable pseudorandom number generator.
|
||||
var myrng = new Math.seedrandom('hello.');
|
||||
console.log(myrng()); // Always 0.9282578795792454
|
||||
console.log(myrng()); // Always 0.3752569768646784
|
||||
|
||||
// Use "quick" to get only 32 bits of randomness in a float.
|
||||
console.log(myrng.quick()); // Always 0.7316977467853576
|
||||
|
||||
// Use "int32" to get a 32 bit (signed) integer
|
||||
console.log(myrng.int32()); // Always 1966374204
|
||||
|
||||
// Calling seedrandom with no arguments creates an ARC4-based PRNG
|
||||
// that is autoseeded using the current time, dom state, and other
|
||||
// accumulated local entropy.
|
||||
var prng = new Math.seedrandom();
|
||||
console.log(prng()); // Reasonably unpredictable.
|
||||
|
||||
// Seeds using the given explicit seed mixed with accumulated entropy.
|
||||
prng = new Math.seedrandom('added entropy.', { entropy: true });
|
||||
console.log(prng()); // As unpredictable as added entropy.
|
||||
|
||||
// Warning: if you call Math.seedrandom without `new`, it replaces
|
||||
// Math.random with the predictable new Math.seedrandom(...), as follows:
|
||||
Math.seedrandom('hello.');
|
||||
console.log(Math.random()); // Always 0.9282578795792454
|
||||
console.log(Math.random()); // Always 0.3752569768646784
|
||||
|
||||
```
|
||||
|
||||
**Note**: calling `Math.seedrandom('constant')` without `new` will make
|
||||
`Math.random()` predictable globally, which is intended to be useful for
|
||||
derandomizing code for testing, but should not be done in a production library.
|
||||
If you need a local seeded PRNG, use `myrng = new Math.seedrandom('seed')`
|
||||
instead. For example, [cryptico](https://www.npmjs.com/package/cryptico),
|
||||
an RSA encryption package, [uses the wrong form](
|
||||
https://github.com/wwwtyro/cryptico/blob/9291ece6/api.js#L264),
|
||||
and thus secretly makes `Math.random()` perfectly predictable.
|
||||
The cryptico library (and any other library that does this)
|
||||
should not be trusted in a security-sensitive application.
|
||||
|
||||
|
||||
Other Fast PRNG Algorithms
|
||||
--------------------------
|
||||
|
||||
The package includes some other fast PRNGs. To use Johannes Baagøe's
|
||||
extremely fast Alea PRNG:
|
||||
|
||||
|
||||
```html
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/lib/alea.min.js">
|
||||
</script>
|
||||
```
|
||||
|
||||
```js
|
||||
// Use alea for Johannes Baagøe's clever and fast floating-point RNG.
|
||||
var arng = new alea('hello.');
|
||||
|
||||
// By default provides 32 bits of randomness in a float.
|
||||
console.log(arng()); // Always 0.4783254903741181
|
||||
|
||||
// Use "double" to get 56 bits of randomness.
|
||||
console.log(arng.double()); // Always 0.8297006866124559
|
||||
|
||||
// Use "int32" to get a 32 bit (signed) integer.
|
||||
console.log(arng.int32()); // Always 1076136327
|
||||
```
|
||||
|
||||
Besides alea, there are several other faster PRNGs available.
|
||||
Note that none of these fast PRNGs provide autoseeding: you
|
||||
need to provide your own seed (or use the default autoseeded
|
||||
seedrandom to make a seed).
|
||||
|
||||
|PRNG name | Time vs native | Period | Author |
|
||||
|-----------|----------------|-------------|----------------------|
|
||||
|`alea` | 1.95 ns, 0.9x | ~2^116 | Baagøe |
|
||||
|`xor128` | 2.04 ns, 0.9x | 2^128-1 | Marsaglia |
|
||||
|`tychei` | 2.32 ns, 1.1x | ~2^127 | Neves/Araujo (ChaCha)|
|
||||
|`xorwow` | 2.40 ns, 1.1x | 2^192-2^32 | Marsaglia |
|
||||
|`xor4096` | 2.40 ns, 1.1x | 2^4096-2^32 | Brent (xorgens) |
|
||||
|`xorshift7`| 2.64 ns, 1.3x | 2^256-1 | Panneton/L'ecuyer |
|
||||
|`quick` | 3.80 ns, 1.8x | ~2^1600 | Bau (ARC4) |
|
||||
|
||||
(Timings were done on node v0.12.2 on a single-core Google Compute Engine
|
||||
instance. `quick` is just the 32-bit version of the RC4-based PRNG
|
||||
originally packaged with seedrandom.)
|
||||
|
||||
|
||||
CJS / Node.js usage
|
||||
-------------------
|
||||
|
||||
```
|
||||
npm install seedrandom
|
||||
```
|
||||
|
||||
```js
|
||||
// Local PRNG: does not affect Math.random.
|
||||
var seedrandom = require('seedrandom');
|
||||
var rng = seedrandom('hello.');
|
||||
console.log(rng()); // Always 0.9282578795792454
|
||||
|
||||
// Global PRNG: set Math.random.
|
||||
seedrandom('hello.', { global: true });
|
||||
console.log(Math.random()); // Always 0.9282578795792454
|
||||
|
||||
// Autoseeded ARC4-based PRNG.
|
||||
rng = seedrandom();
|
||||
console.log(rng()); // Reasonably unpredictable.
|
||||
|
||||
// Mixing accumulated entropy.
|
||||
rng = seedrandom('added entropy.', { entropy: true });
|
||||
console.log(rng()); // As unpredictable as added entropy.
|
||||
|
||||
// Using alternate algorithms, as listed above.
|
||||
var rng2 = seedrandom.xor4096('hello.')
|
||||
console.log(rng2());
|
||||
```
|
||||
|
||||
Starting in version 3, when using via require('seedrandom'), the global
|
||||
`Math.seedrandom` is no longer available.
|
||||
|
||||
|
||||
Require.js usage
|
||||
----------------
|
||||
|
||||
Similar to Node.js usage:
|
||||
|
||||
```
|
||||
bower install seedrandom
|
||||
```
|
||||
|
||||
```
|
||||
require(['seedrandom'], function(seedrandom) {
|
||||
var rng = seedrandom('hello.');
|
||||
console.log(rng()); // Always 0.9282578795792454
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Network seeding
|
||||
---------------
|
||||
|
||||
```html
|
||||
<script src=//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js>
|
||||
</script>
|
||||
<!-- Seeds using urandom bits from a server. -->
|
||||
<script src=//jsonlib.appspot.com/urandom?callback=Math.seedrandom>
|
||||
</script>
|
||||
|
||||
<!-- Seeds mixing in random.org bits -->
|
||||
<script>
|
||||
(function(x, u, s){
|
||||
try {
|
||||
// Make a synchronous request to random.org.
|
||||
x.open('GET', u, false);
|
||||
x.send();
|
||||
s = unescape(x.response.trim().replace(/^|\s/g, '%'));
|
||||
} finally {
|
||||
// Seed with the response, or autoseed on failure.
|
||||
Math.seedrandom(s, !!s);
|
||||
}
|
||||
})(new XMLHttpRequest, 'https://www.random.org/integers/' +
|
||||
'?num=256&min=0&max=255&col=1&base=16&format=plain&rnd=new');
|
||||
</script>
|
||||
```
|
||||
|
||||
Reseeding using user input
|
||||
--------------------------
|
||||
|
||||
```js
|
||||
var seed = Math.seedrandom(); // Use prng with an automatic seed.
|
||||
document.write(Math.random()); // Pretty much unpredictable x.
|
||||
|
||||
var rng = new Math.seedrandom(seed); // A new prng with the same seed.
|
||||
document.write(rng()); // Repeat the 'unpredictable' x.
|
||||
|
||||
function reseed(event, count) { // Define a custom entropy collector.
|
||||
var t = [];
|
||||
function w(e) {
|
||||
t.push([e.pageX, e.pageY, +new Date]);
|
||||
if (t.length < count) { return; }
|
||||
document.removeEventListener(event, w);
|
||||
Math.seedrandom(t, { entropy: true });
|
||||
}
|
||||
document.addEventListener(event, w);
|
||||
}
|
||||
reseed('mousemove', 100); // Reseed after 100 mouse moves.
|
||||
```
|
||||
|
||||
The "pass" option can be used to get both the prng and the seed.
|
||||
The following returns both an autoseeded prng and the seed as an object,
|
||||
without mutating Math.random:
|
||||
|
||||
```js
|
||||
var obj = Math.seedrandom(null, { pass: function(prng, seed) {
|
||||
return { random: prng, seed: seed };
|
||||
}});
|
||||
```
|
||||
|
||||
|
||||
Saving and Restoring PRNG state
|
||||
-------------------------------
|
||||
|
||||
```js
|
||||
var seedrandom = Math.seedrandom;
|
||||
var saveable = seedrandom("secret-seed", {state: true});
|
||||
for (var j = 0; j < 1e5; ++j) saveable();
|
||||
var saved = saveable.state();
|
||||
var replica = seedrandom("", {state: saved});
|
||||
assert(replica() == saveable());
|
||||
```
|
||||
|
||||
In normal use the prng is opaque and its internal state cannot be accessed.
|
||||
However, if the "state" option is specified, the prng gets a state() method
|
||||
that returns a plain object the can be used to reconstruct a prng later in
|
||||
the same state (by passing that saved object back as the state option).
|
||||
|
||||
|
||||
Version notes
|
||||
-------------
|
||||
|
||||
The random number sequence is the same as version 1.0 for string seeds.
|
||||
|
||||
* Version 2.0 changed the sequence for non-string seeds.
|
||||
* Version 2.1 speeds seeding and uses window.crypto to autoseed if present.
|
||||
* Version 2.2 alters non-crypto autoseeding to sweep up entropy from plugins.
|
||||
* Version 2.3 adds support for "new", module loading, and a null seed arg.
|
||||
* Version 2.3.1 adds a build environment, module packaging, and tests.
|
||||
* Version 2.3.4 fixes bugs on IE8, and switches to MIT license.
|
||||
* Version 2.3.6 adds a readable options object argument.
|
||||
* Version 2.3.10 adds support for node.js crypto (contributed by ctd1500).
|
||||
* Version 2.3.11 adds an option to load and save internal state.
|
||||
* Version 2.4.0 adds implementations of several other fast PRNGs.
|
||||
* Version 2.4.2 adds an implementation of Baagoe's very fast Alea PRNG.
|
||||
* Version 2.4.3 ignores nodejs crypto when under browserify.
|
||||
* Version 2.4.4 avoids strict mode problem with global this reference.
|
||||
* Version 3.0.1 removes Math.seedrandom for require('seedrandom') users.
|
||||
* Version 3.0.3 updates package.json for CDN entrypoints.
|
||||
* Version 3.0.5 removes eval to avoid triggering content-security policy.
|
||||
|
||||
The standard ARC4 key scheduler cycles short keys, which means that
|
||||
seedrandom('ab') is equivalent to seedrandom('abab') and 'ababab'.
|
||||
Therefore it is a good idea to add a terminator to avoid trivial
|
||||
equivalences on short string seeds, e.g., Math.seedrandom(str + '\0').
|
||||
Starting with version 2.0, a terminator is added automatically for
|
||||
non-string seeds, so seeding with the number 111 is the same as seeding
|
||||
with '111\0'.
|
||||
|
||||
When seedrandom() is called with zero args or a null seed, it uses a
|
||||
seed drawn from the browser crypto object if present. If there is no
|
||||
crypto support, seedrandom() uses the current time, the native rng,
|
||||
and a walk of several DOM objects to collect a few bits of entropy.
|
||||
|
||||
Each time the one- or two-argument forms of seedrandom are called,
|
||||
entropy from the passed seed is accumulated in a pool to help generate
|
||||
future seeds for the zero- and two-argument forms of seedrandom.
|
||||
|
||||
On speed - This javascript implementation of Math.random() is several
|
||||
times slower than the built-in Math.random() because it is not native
|
||||
code, but that is typically fast enough. Some details (timings on
|
||||
Chrome 25 on a 2010 vintage macbook):
|
||||
|
||||
* seeded Math.random() - avg less than 0.0002 milliseconds per call
|
||||
* seedrandom('explicit.') - avg less than 0.2 milliseconds per call
|
||||
* seedrandom('explicit.', true) - avg less than 0.2 milliseconds per call
|
||||
* seedrandom() with crypto - avg less than 0.2 milliseconds per call
|
||||
|
||||
Autoseeding without crypto is somewhat slow, about 20-30 milliseconds on
|
||||
a 2012 windows 7 1.5ghz i5 laptop, as seen on Firefox 19, IE 10, and Opera.
|
||||
Seeded rng calls themselves are fast across these browsers, with slowest
|
||||
numbers on Opera at about 0.0005 ms per seeded Math.random().
|
||||
|
||||
|
||||
LICENSE (MIT)
|
||||
-------------
|
||||
|
||||
Copyright 2019 David Bau.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
16
node_modules/seedrandom/bower.json
generated
vendored
Normal file
16
node_modules/seedrandom/bower.json
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "seedrandom",
|
||||
"description": "Seeded random number generator for Javascript.",
|
||||
"main": "seedrandom.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"random",
|
||||
"seed",
|
||||
"crypto"
|
||||
],
|
||||
"ignore": [],
|
||||
"devDependencies": {
|
||||
"qunit": "latest",
|
||||
"requirejs": "latest"
|
||||
}
|
||||
}
|
10
node_modules/seedrandom/component.json
generated
vendored
Normal file
10
node_modules/seedrandom/component.json
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "seedrandom",
|
||||
"version": "3.0.0",
|
||||
"description": "Seeded random number generator for Javascript",
|
||||
"repository": "davidbau/seedrandom",
|
||||
"main": "seedrandom.js",
|
||||
"scripts": [ "seedrandom.js" ],
|
||||
"keywords": [ "random", "seed", "crypto" ],
|
||||
"license": "MIT"
|
||||
}
|
1
node_modules/seedrandom/coverage/coverage.json
generated
vendored
Normal file
1
node_modules/seedrandom/coverage/coverage.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
224
node_modules/seedrandom/coverage/lcov-report/base.css
generated
vendored
Normal file
224
node_modules/seedrandom/coverage/lcov-report/base.css
generated
vendored
Normal file
|
@ -0,0 +1,224 @@
|
|||
body, html {
|
||||
margin:0; padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica Neue, Helvetica, Arial;
|
||||
font-size: 14px;
|
||||
color:#333;
|
||||
}
|
||||
.small { font-size: 12px; }
|
||||
*, *:after, *:before {
|
||||
-webkit-box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
h1 { font-size: 20px; margin: 0;}
|
||||
h2 { font-size: 14px; }
|
||||
pre {
|
||||
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-moz-tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
a { color:#0074D9; text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
.strong { font-weight: bold; }
|
||||
.space-top1 { padding: 10px 0 0 0; }
|
||||
.pad2y { padding: 20px 0; }
|
||||
.pad1y { padding: 10px 0; }
|
||||
.pad2x { padding: 0 20px; }
|
||||
.pad2 { padding: 20px; }
|
||||
.pad1 { padding: 10px; }
|
||||
.space-left2 { padding-left:55px; }
|
||||
.space-right2 { padding-right:20px; }
|
||||
.center { text-align:center; }
|
||||
.clearfix { display:block; }
|
||||
.clearfix:after {
|
||||
content:'';
|
||||
display:block;
|
||||
height:0;
|
||||
clear:both;
|
||||
visibility:hidden;
|
||||
}
|
||||
.fl { float: left; }
|
||||
@media only screen and (max-width:640px) {
|
||||
.col3 { width:100%; max-width:100%; }
|
||||
.hide-mobile { display:none!important; }
|
||||
}
|
||||
|
||||
.quiet {
|
||||
color: #7f7f7f;
|
||||
color: rgba(0,0,0,0.5);
|
||||
}
|
||||
.quiet a { opacity: 0.7; }
|
||||
|
||||
.fraction {
|
||||
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
font-size: 10px;
|
||||
color: #555;
|
||||
background: #E8E8E8;
|
||||
padding: 4px 5px;
|
||||
border-radius: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.path a:link, div.path a:visited { color: #333; }
|
||||
table.coverage {
|
||||
border-collapse: collapse;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.coverage td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.coverage td.line-count {
|
||||
text-align: right;
|
||||
padding: 0 5px 0 20px;
|
||||
}
|
||||
table.coverage td.line-coverage {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
min-width:20px;
|
||||
}
|
||||
|
||||
table.coverage td span.cline-any {
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.missing-if-branch {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #333;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
.skip-if-branch {
|
||||
display: none;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
background: #ccc;
|
||||
color: white;
|
||||
}
|
||||
.missing-if-branch .typ, .skip-if-branch .typ {
|
||||
color: inherit !important;
|
||||
}
|
||||
.coverage-summary {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
||||
.keyline-all { border: 1px solid #ddd; }
|
||||
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
||||
.coverage-summary tbody { border: 1px solid #bbb; }
|
||||
.coverage-summary td { border-right: 1px solid #bbb; }
|
||||
.coverage-summary td:last-child { border-right: none; }
|
||||
.coverage-summary th {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.coverage-summary th.file { border-right: none !important; }
|
||||
.coverage-summary th.pct { }
|
||||
.coverage-summary th.pic,
|
||||
.coverage-summary th.abs,
|
||||
.coverage-summary td.pct,
|
||||
.coverage-summary td.abs { text-align: right; }
|
||||
.coverage-summary td.file { white-space: nowrap; }
|
||||
.coverage-summary td.pic { min-width: 120px !important; }
|
||||
.coverage-summary tfoot td { }
|
||||
|
||||
.coverage-summary .sorter {
|
||||
height: 10px;
|
||||
width: 7px;
|
||||
display: inline-block;
|
||||
margin-left: 0.5em;
|
||||
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
||||
}
|
||||
.coverage-summary .sorted .sorter {
|
||||
background-position: 0 -20px;
|
||||
}
|
||||
.coverage-summary .sorted-desc .sorter {
|
||||
background-position: 0 -10px;
|
||||
}
|
||||
.status-line { height: 10px; }
|
||||
/* yellow */
|
||||
.cbranch-no { background: yellow !important; color: #111; }
|
||||
/* dark red */
|
||||
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
||||
.low .chart { border:1px solid #C21F39 }
|
||||
.highlighted,
|
||||
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
|
||||
background: #C21F39 !important;
|
||||
}
|
||||
/* medium red */
|
||||
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
||||
/* light red */
|
||||
.low, .cline-no { background:#FCE1E5 }
|
||||
/* light green */
|
||||
.high, .cline-yes { background:rgb(230,245,208) }
|
||||
/* medium green */
|
||||
.cstat-yes { background:rgb(161,215,106) }
|
||||
/* dark green */
|
||||
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
||||
.high .chart { border:1px solid rgb(77,146,33) }
|
||||
/* dark yellow (gold) */
|
||||
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
||||
.medium .chart { border:1px solid #f9cd0b; }
|
||||
/* light yellow */
|
||||
.medium { background: #fff4c2; }
|
||||
|
||||
.cstat-skip { background: #ddd; color: #111; }
|
||||
.fstat-skip { background: #ddd; color: #111 !important; }
|
||||
.cbranch-skip { background: #ddd !important; color: #111; }
|
||||
|
||||
span.cline-neutral { background: #eaeaea; }
|
||||
|
||||
.coverage-summary td.empty {
|
||||
opacity: .5;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
line-height: 1;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.cover-fill, .cover-empty {
|
||||
display:inline-block;
|
||||
height: 12px;
|
||||
}
|
||||
.chart {
|
||||
line-height: 0;
|
||||
}
|
||||
.cover-empty {
|
||||
background: white;
|
||||
}
|
||||
.cover-full {
|
||||
border-right: none !important;
|
||||
}
|
||||
pre.prettyprint {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.com { color: #999 !important; }
|
||||
.ignore-none { color: #999; font-weight: normal; }
|
||||
|
||||
.wrapper {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
margin: 0 auto -48px;
|
||||
}
|
||||
.footer, .push {
|
||||
height: 48px;
|
||||
}
|
79
node_modules/seedrandom/coverage/lcov-report/block-navigation.js
generated
vendored
Normal file
79
node_modules/seedrandom/coverage/lcov-report/block-navigation.js
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* eslint-disable */
|
||||
var jumpToCode = (function init() {
|
||||
// Classes of code we would like to highlight in the file view
|
||||
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
||||
|
||||
// Elements to highlight in the file listing view
|
||||
var fileListingElements = ['td.pct.low'];
|
||||
|
||||
// We don't want to select elements that are direct descendants of another match
|
||||
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
||||
|
||||
// Selecter that finds elements on the page to which we can jump
|
||||
var selector =
|
||||
fileListingElements.join(', ') +
|
||||
', ' +
|
||||
notSelector +
|
||||
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
||||
|
||||
// The NodeList of matching elements
|
||||
var missingCoverageElements = document.querySelectorAll(selector);
|
||||
|
||||
var currentIndex;
|
||||
|
||||
function toggleClass(index) {
|
||||
missingCoverageElements
|
||||
.item(currentIndex)
|
||||
.classList.remove('highlighted');
|
||||
missingCoverageElements.item(index).classList.add('highlighted');
|
||||
}
|
||||
|
||||
function makeCurrent(index) {
|
||||
toggleClass(index);
|
||||
currentIndex = index;
|
||||
missingCoverageElements.item(index).scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center',
|
||||
inline: 'center'
|
||||
});
|
||||
}
|
||||
|
||||
function goToPrevious() {
|
||||
var nextIndex = 0;
|
||||
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
||||
nextIndex = missingCoverageElements.length - 1;
|
||||
} else if (missingCoverageElements.length > 1) {
|
||||
nextIndex = currentIndex - 1;
|
||||
}
|
||||
|
||||
makeCurrent(nextIndex);
|
||||
}
|
||||
|
||||
function goToNext() {
|
||||
var nextIndex = 0;
|
||||
|
||||
if (
|
||||
typeof currentIndex === 'number' &&
|
||||
currentIndex < missingCoverageElements.length - 1
|
||||
) {
|
||||
nextIndex = currentIndex + 1;
|
||||
}
|
||||
|
||||
makeCurrent(nextIndex);
|
||||
}
|
||||
|
||||
return function jump(event) {
|
||||
switch (event.which) {
|
||||
case 78: // n
|
||||
case 74: // j
|
||||
goToNext();
|
||||
break;
|
||||
case 66: // b
|
||||
case 75: // k
|
||||
case 80: // p
|
||||
goToPrevious();
|
||||
break;
|
||||
}
|
||||
};
|
||||
})();
|
||||
window.addEventListener('keydown', jumpToCode);
|
110
node_modules/seedrandom/coverage/lcov-report/index.html
generated
vendored
Normal file
110
node_modules/seedrandom/coverage/lcov-report/index.html
generated
vendored
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for All files</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
All files
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.21% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>439/471</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">73.2% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>142/194</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">90.41% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>66/73</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.44% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>374/396</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="seedrandom"><a href="seedrandom/index.html">seedrandom</a></td>
|
||||
<td data-value="96" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
|
||||
<td data-value="96" class="pct high">96%</td>
|
||||
<td data-value="100" class="abs high">96/100</td>
|
||||
<td data-value="85.11" class="pct high">85.11%</td>
|
||||
<td data-value="47" class="abs high">40/47</td>
|
||||
<td data-value="93.33" class="pct high">93.33%</td>
|
||||
<td data-value="15" class="abs high">14/15</td>
|
||||
<td data-value="96.39" class="pct high">96.39%</td>
|
||||
<td data-value="83" class="abs high">80/83</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="seedrandom/lib"><a href="seedrandom/lib/index.html">seedrandom/lib</a></td>
|
||||
<td data-value="92.45" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
|
||||
<td data-value="92.45" class="pct high">92.45%</td>
|
||||
<td data-value="371" class="abs high">343/371</td>
|
||||
<td data-value="69.39" class="pct medium">69.39%</td>
|
||||
<td data-value="147" class="abs medium">102/147</td>
|
||||
<td data-value="89.66" class="pct high">89.66%</td>
|
||||
<td data-value="58" class="abs high">52/58</td>
|
||||
<td data-value="93.93" class="pct high">93.93%</td>
|
||||
<td data-value="313" class="abs high">294/313</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
<script src="block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
1
node_modules/seedrandom/coverage/lcov-report/prettify.css
generated
vendored
Normal file
1
node_modules/seedrandom/coverage/lcov-report/prettify.css
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
2
node_modules/seedrandom/coverage/lcov-report/prettify.js
generated
vendored
Normal file
2
node_modules/seedrandom/coverage/lcov-report/prettify.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html
generated
vendored
Normal file
97
node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">All files</a> seedrandom
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">96% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>96/100</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">85.11% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>40/47</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.33% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>14/15</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">96.39% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>80/83</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="seedrandom.js"><a href="seedrandom.js.html">seedrandom.js</a></td>
|
||||
<td data-value="96" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
|
||||
<td data-value="96" class="pct high">96%</td>
|
||||
<td data-value="100" class="abs high">96/100</td>
|
||||
<td data-value="85.11" class="pct high">85.11%</td>
|
||||
<td data-value="47" class="abs high">40/47</td>
|
||||
<td data-value="93.33" class="pct high">93.33%</td>
|
||||
<td data-value="15" class="abs high">14/15</td>
|
||||
<td data-value="96.39" class="pct high">96.39%</td>
|
||||
<td data-value="83" class="abs high">80/83</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
<script src="../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
411
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html
generated
vendored
Normal file
411
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html
generated
vendored
Normal file
|
@ -0,0 +1,411 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/alea.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> alea.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">91.94% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>57/62</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">66.67% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>16/24</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">90.91% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>10/11</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.34% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>50/53</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">18x</span>
|
||||
<span class="cline-any cline-yes">18x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-yes">33x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">18x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010
|
||||
// http://baagoe.com/en/RandomMusings/javascript/
|
||||
// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror
|
||||
// Original work is under MIT license -
|
||||
|
||||
// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function Alea(seed) {
|
||||
var me = this, mash = Mash();
|
||||
|
||||
me.next = function() {
|
||||
var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32
|
||||
me.s0 = me.s1;
|
||||
me.s1 = me.s2;
|
||||
return me.s2 = t - (me.c = t | 0);
|
||||
};
|
||||
|
||||
// Apply the seeding algorithm from Baagoe.
|
||||
me.c = 1;
|
||||
me.s0 = mash(' ');
|
||||
me.s1 = mash(' ');
|
||||
me.s2 = mash(' ');
|
||||
me.s0 -= mash(seed);
|
||||
if (me.s0 < 0) { me.s0 += 1; }
|
||||
me.s1 -= mash(seed);
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (me.s1 < 0) { me.s1 += 1; }
|
||||
me.s2 -= mash(seed);
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if (me.s2 < 0) { <span class="cstat-no" title="statement not covered" >me.s2 += 1; </span>}
|
||||
mash = null;
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.c = f.c;
|
||||
t.s0 = f.s0;
|
||||
t.s1 = f.s1;
|
||||
t.s2 = f.s2;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new Alea(seed),
|
||||
state = opts && opts.state,
|
||||
prng = xg.next;
|
||||
prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }
|
||||
prng.double = function() {
|
||||
return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53
|
||||
};
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
function Mash() {
|
||||
var n = 0xefc8249d;
|
||||
|
||||
var mash = function(data) {
|
||||
data = String(data);
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
n += data.charCodeAt(i);
|
||||
var h = 0.02519603282416938 * n;
|
||||
n = h >>> 0;
|
||||
h -= n;
|
||||
h *= n;
|
||||
n = h >>> 0;
|
||||
h -= n;
|
||||
n += h * 0x100000000; // 2^32
|
||||
}
|
||||
return (n >>> 0) * 2.3283064365386963e-10; // 2^-32
|
||||
};
|
||||
|
||||
return mash;
|
||||
}
|
||||
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.alea = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
162
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html
generated
vendored
Normal file
162
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html
generated
vendored
Normal file
|
@ -0,0 +1,162 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> seedrandom/lib
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">92.45% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>343/371</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">69.39% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>102/147</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">89.66% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>52/58</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.93% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>294/313</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="alea.js"><a href="alea.js.html">alea.js</a></td>
|
||||
<td data-value="91.94" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
|
||||
<td data-value="91.94" class="pct high">91.94%</td>
|
||||
<td data-value="62" class="abs high">57/62</td>
|
||||
<td data-value="66.67" class="pct medium">66.67%</td>
|
||||
<td data-value="24" class="abs medium">16/24</td>
|
||||
<td data-value="90.91" class="pct high">90.91%</td>
|
||||
<td data-value="11" class="abs high">10/11</td>
|
||||
<td data-value="94.34" class="pct high">94.34%</td>
|
||||
<td data-value="53" class="abs high">50/53</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="tychei.js"><a href="tychei.js.html">tychei.js</a></td>
|
||||
<td data-value="92.98" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
|
||||
<td data-value="92.98" class="pct high">92.98%</td>
|
||||
<td data-value="57" class="abs high">53/57</td>
|
||||
<td data-value="70" class="pct medium">70%</td>
|
||||
<td data-value="20" class="abs medium">14/20</td>
|
||||
<td data-value="88.89" class="pct high">88.89%</td>
|
||||
<td data-value="9" class="abs high">8/9</td>
|
||||
<td data-value="93.75" class="pct high">93.75%</td>
|
||||
<td data-value="48" class="abs high">45/48</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="xor128.js"><a href="xor128.js.html">xor128.js</a></td>
|
||||
<td data-value="91.84" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
|
||||
<td data-value="91.84" class="pct high">91.84%</td>
|
||||
<td data-value="49" class="abs high">45/49</td>
|
||||
<td data-value="70" class="pct medium">70%</td>
|
||||
<td data-value="20" class="abs medium">14/20</td>
|
||||
<td data-value="88.89" class="pct high">88.89%</td>
|
||||
<td data-value="9" class="abs high">8/9</td>
|
||||
<td data-value="93.02" class="pct high">93.02%</td>
|
||||
<td data-value="43" class="abs high">40/43</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="xor4096.js"><a href="xor4096.js.html">xor4096.js</a></td>
|
||||
<td data-value="92.68" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
|
||||
<td data-value="92.68" class="pct high">92.68%</td>
|
||||
<td data-value="82" class="abs high">76/82</td>
|
||||
<td data-value="65.71" class="pct medium">65.71%</td>
|
||||
<td data-value="35" class="abs medium">23/35</td>
|
||||
<td data-value="90" class="pct high">90%</td>
|
||||
<td data-value="10" class="abs high">9/10</td>
|
||||
<td data-value="94.52" class="pct high">94.52%</td>
|
||||
<td data-value="73" class="abs high">69/73</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="xorshift7.js"><a href="xorshift7.js.html">xorshift7.js</a></td>
|
||||
<td data-value="92.42" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
|
||||
<td data-value="92.42" class="pct high">92.42%</td>
|
||||
<td data-value="66" class="abs high">61/66</td>
|
||||
<td data-value="73.08" class="pct medium">73.08%</td>
|
||||
<td data-value="26" class="abs medium">19/26</td>
|
||||
<td data-value="90" class="pct high">90%</td>
|
||||
<td data-value="10" class="abs high">9/10</td>
|
||||
<td data-value="94" class="pct high">94%</td>
|
||||
<td data-value="50" class="abs high">47/50</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="xorwow.js"><a href="xorwow.js.html">xorwow.js</a></td>
|
||||
<td data-value="92.73" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
|
||||
<td data-value="92.73" class="pct high">92.73%</td>
|
||||
<td data-value="55" class="abs high">51/55</td>
|
||||
<td data-value="72.73" class="pct medium">72.73%</td>
|
||||
<td data-value="22" class="abs medium">16/22</td>
|
||||
<td data-value="88.89" class="pct high">88.89%</td>
|
||||
<td data-value="9" class="abs high">8/9</td>
|
||||
<td data-value="93.48" class="pct high">93.48%</td>
|
||||
<td data-value="46" class="abs high">43/46</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
378
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html
generated
vendored
Normal file
378
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html
generated
vendored
Normal file
|
@ -0,0 +1,378 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/tychei.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> tychei.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">92.98% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>53/57</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">70% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>14/20</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">88.89% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>8/9</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.75% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>45/48</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-yes">4105195x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-yes">66x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4102054x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "Tyche-i" prng algorithm by
|
||||
// Samuel Neves and Filipe Araujo.
|
||||
// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var b = me.b, c = me.c, d = me.d, a = me.a;
|
||||
b = (b << 25) ^ (b >>> 7) ^ c;
|
||||
c = (c - d) | 0;
|
||||
d = (d << 24) ^ (d >>> 8) ^ a;
|
||||
a = (a - b) | 0;
|
||||
me.b = b = (b << 20) ^ (b >>> 12) ^ c;
|
||||
me.c = c = (c - d) | 0;
|
||||
me.d = (d << 16) ^ (c >>> 16) ^ a;
|
||||
return me.a = (a - b) | 0;
|
||||
};
|
||||
|
||||
/* The following is non-inverted tyche, which has better internal
|
||||
* bit diffusion, but which is about 25% slower than tyche-i in JS.
|
||||
me.next = function() {
|
||||
var a = me.a, b = me.b, c = me.c, d = me.d;
|
||||
a = (me.a + me.b | 0) >>> 0;
|
||||
d = me.d ^ a; d = d << 16 ^ d >>> 16;
|
||||
c = me.c + d | 0;
|
||||
b = me.b ^ c; b = b << 12 ^ d >>> 20;
|
||||
me.a = a = a + b | 0;
|
||||
d = d ^ a; me.d = d = d << 8 ^ d >>> 24;
|
||||
me.c = c = c + d | 0;
|
||||
b = b ^ c;
|
||||
return me.b = (b << 7 ^ b >>> 25);
|
||||
}
|
||||
*/
|
||||
|
||||
me.a = 0;
|
||||
me.b = 0;
|
||||
me.c = 2654435769 | 0;
|
||||
me.d = 1367130551;
|
||||
|
||||
if (seed === Math.floor(seed)) {
|
||||
// Integer seed.
|
||||
me.a = (seed / 0x100000000) | 0;
|
||||
me.b = seed | 0;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 20; k++) {
|
||||
me.b ^= strseed.charCodeAt(k) | 0;
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.a = f.a;
|
||||
t.b = f.b;
|
||||
t.c = f.c;
|
||||
t.d = f.d;
|
||||
return t;
|
||||
};
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.tychei = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
312
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html
generated
vendored
Normal file
312
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html
generated
vendored
Normal file
|
@ -0,0 +1,312 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/xor128.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xor128.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">91.84% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>45/49</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">70% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>14/20</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">88.89% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>8/9</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.02% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>40/43</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">198x</span>
|
||||
<span class="cline-any cline-yes">198x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4102054x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "xor128" prng algorithm by
|
||||
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
me.x = 0;
|
||||
me.y = 0;
|
||||
me.z = 0;
|
||||
me.w = 0;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var t = me.x ^ (me.x << 11);
|
||||
me.x = me.y;
|
||||
me.y = me.z;
|
||||
me.z = me.w;
|
||||
return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);
|
||||
};
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Integer seed.
|
||||
me.x = seed;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 64; k++) {
|
||||
me.x ^= strseed.charCodeAt(k) | 0;
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x;
|
||||
t.y = f.y;
|
||||
t.z = f.z;
|
||||
t.w = f.w;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.xor128 = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
507
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html
generated
vendored
Normal file
507
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html
generated
vendored
Normal file
|
@ -0,0 +1,507 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/xor4096.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xor4096.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">92.68% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>76/82</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">65.71% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>23/35</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">90% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>9/10</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94.52% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>69/73</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a>
|
||||
<a name='L116'></a><a href='#L116'>116</a>
|
||||
<a name='L117'></a><a href='#L117'>117</a>
|
||||
<a name='L118'></a><a href='#L118'>118</a>
|
||||
<a name='L119'></a><a href='#L119'>119</a>
|
||||
<a name='L120'></a><a href='#L120'>120</a>
|
||||
<a name='L121'></a><a href='#L121'>121</a>
|
||||
<a name='L122'></a><a href='#L122'>122</a>
|
||||
<a name='L123'></a><a href='#L123'>123</a>
|
||||
<a name='L124'></a><a href='#L124'>124</a>
|
||||
<a name='L125'></a><a href='#L125'>125</a>
|
||||
<a name='L126'></a><a href='#L126'>126</a>
|
||||
<a name='L127'></a><a href='#L127'>127</a>
|
||||
<a name='L128'></a><a href='#L128'>128</a>
|
||||
<a name='L129'></a><a href='#L129'>129</a>
|
||||
<a name='L130'></a><a href='#L130'>130</a>
|
||||
<a name='L131'></a><a href='#L131'>131</a>
|
||||
<a name='L132'></a><a href='#L132'>132</a>
|
||||
<a name='L133'></a><a href='#L133'>133</a>
|
||||
<a name='L134'></a><a href='#L134'>134</a>
|
||||
<a name='L135'></a><a href='#L135'>135</a>
|
||||
<a name='L136'></a><a href='#L136'>136</a>
|
||||
<a name='L137'></a><a href='#L137'>137</a>
|
||||
<a name='L138'></a><a href='#L138'>138</a>
|
||||
<a name='L139'></a><a href='#L139'>139</a>
|
||||
<a name='L140'></a><a href='#L140'>140</a>
|
||||
<a name='L141'></a><a href='#L141'>141</a>
|
||||
<a name='L142'></a><a href='#L142'>142</a>
|
||||
<a name='L143'></a><a href='#L143'>143</a>
|
||||
<a name='L144'></a><a href='#L144'>144</a>
|
||||
<a name='L145'></a><a href='#L145'>145</a>
|
||||
<a name='L146'></a><a href='#L146'>146</a>
|
||||
<a name='L147'></a><a href='#L147'>147</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4105129x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">480x</span>
|
||||
<span class="cline-any cline-yes">384x</span>
|
||||
<span class="cline-any cline-yes">384x</span>
|
||||
<span class="cline-any cline-yes">384x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-yes">1536x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4102054x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.
|
||||
//
|
||||
// This fast non-cryptographic random number generator is designed for
|
||||
// use in Monte-Carlo algorithms. It combines a long-period xorshift
|
||||
// generator with a Weyl generator, and it passes all common batteries
|
||||
// of stasticial tests for randomness while consuming only a few nanoseconds
|
||||
// for each prng generated. For background on the generator, see Brent's
|
||||
// paper: "Some long-period random number generators using shifts and xors."
|
||||
// http://arxiv.org/pdf/1004.3115v1.pdf
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// var xor4096 = require('xor4096');
|
||||
// random = xor4096(1); // Seed with int32 or string.
|
||||
// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.
|
||||
// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.
|
||||
//
|
||||
// For nonzero numeric keys, this impelementation provides a sequence
|
||||
// identical to that by Brent's xorgens 3 implementaion in C. This
|
||||
// implementation also provides for initalizing the generator with
|
||||
// string seeds, or for saving and restoring the state of the generator.
|
||||
//
|
||||
// On Chrome, this prng benchmarks about 2.1 times slower than
|
||||
// Javascript's built-in Math.random().
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var w = me.w,
|
||||
X = me.X, i = me.i, t, v;
|
||||
// Update Weyl generator.
|
||||
me.w = w = (w + 0x61c88647) | 0;
|
||||
// Update xor generator.
|
||||
v = X[(i + 34) & 127];
|
||||
t = X[i = ((i + 1) & 127)];
|
||||
v ^= v << 13;
|
||||
t ^= t << 17;
|
||||
v ^= v >>> 15;
|
||||
t ^= t >>> 12;
|
||||
// Update Xor generator array state.
|
||||
v = X[i] = v ^ t;
|
||||
me.i = i;
|
||||
// Result is the combination.
|
||||
return (v + (w ^ (w >>> 16))) | 0;
|
||||
};
|
||||
|
||||
function init(me, seed) {
|
||||
var t, v, i, j, w, X = [], limit = 128;
|
||||
if (seed === (seed | 0)) {
|
||||
// Numeric seeds initialize v, which is used to generates X.
|
||||
v = seed;
|
||||
seed = null;
|
||||
} else {
|
||||
// String seeds are mixed into v and X one character at a time.
|
||||
seed = seed + '\0';
|
||||
v = 0;
|
||||
limit = Math.max(limit, seed.length);
|
||||
}
|
||||
// Initialize circular array and weyl value.
|
||||
for (i = 0, j = -32; j < limit; ++j) {
|
||||
// Put the unicode characters into the array, and shuffle them.
|
||||
if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);
|
||||
// After 32 shuffles, take v as the starting w value.
|
||||
if (j === 0) w = v;
|
||||
v ^= v << 10;
|
||||
v ^= v >>> 15;
|
||||
v ^= v << 4;
|
||||
v ^= v >>> 13;
|
||||
if (j >= 0) {
|
||||
w = (w + 0x61c88647) | 0; // Weyl.
|
||||
t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.
|
||||
i = (0 == t) ? <span class="branch-0 cbranch-no" title="branch not covered" >i + 1 </span>: 0; // Count zeroes.
|
||||
}
|
||||
}
|
||||
// We have detected all zeroes; make the key nonzero.
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if (i >= 128) {
|
||||
<span class="cstat-no" title="statement not covered" > X[(seed && seed.length || 0) & 127] = -1;</span>
|
||||
}
|
||||
// Run the generator 512 times to further mix the state before using it.
|
||||
// Factoring this as a function slows the main generator, so it is just
|
||||
// unrolled here. The weyl generator is not advanced while warming up.
|
||||
i = 127;
|
||||
for (j = 4 * 128; j > 0; --j) {
|
||||
v = X[(i + 34) & 127];
|
||||
t = X[i = ((i + 1) & 127)];
|
||||
v ^= v << 13;
|
||||
t ^= t << 17;
|
||||
v ^= v >>> 15;
|
||||
t ^= t >>> 12;
|
||||
X[i] = v ^ t;
|
||||
}
|
||||
// Storing state as object members is faster than using closure variables.
|
||||
me.w = w;
|
||||
me.X = X;
|
||||
me.i = i;
|
||||
}
|
||||
|
||||
init(me, seed);
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.i = f.i;
|
||||
t.w = f.w;
|
||||
t.X = f.X.slice();
|
||||
return t;
|
||||
};
|
||||
|
||||
function impl(seed, opts) {
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if (seed == null) <span class="cstat-no" title="statement not covered" >seed = +(new Date);</span>
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (state.X) copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.xor4096 = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this, // window object or global
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
360
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html
generated
vendored
Normal file
360
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html
generated
vendored
Normal file
|
@ -0,0 +1,360 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/xorshift7.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xorshift7.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">92.42% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>61/66</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">73.08% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>19/26</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">90% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>9/10</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">94% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>47/50</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-yes">4105897x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">16x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">768x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4102054x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "xorshift7" algorithm by
|
||||
// François Panneton and Pierre L'ecuyer:
|
||||
// "On the Xorgshift Random Number Generators"
|
||||
// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
// Update xor generator.
|
||||
var X = me.x, i = me.i, t, v, w;
|
||||
t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);
|
||||
t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);
|
||||
t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);
|
||||
t = X[(i + 4) & 7]; v ^= t ^ (t << 7);
|
||||
t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);
|
||||
X[i] = v;
|
||||
me.i = (i + 1) & 7;
|
||||
return v;
|
||||
};
|
||||
|
||||
function init(me, seed) {
|
||||
var j, w, X = [];
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Seed state array using a 32-bit integer.
|
||||
w = X[0] = seed;
|
||||
} else {
|
||||
// Seed state using a string.
|
||||
seed = '' + seed;
|
||||
for (j = 0; j < seed.length; ++j) {
|
||||
X[j & 7] = (X[j & 7] << 15) ^
|
||||
(seed.charCodeAt(j) + X[(j + 1) & 7] << 13);
|
||||
}
|
||||
}
|
||||
// Enforce an array length of 8, not all zeroes.
|
||||
while (X.length < 8) X.push(0);
|
||||
for (j = 0; j < 8 && X[j] === 0; ++j);
|
||||
if (j == 8) w = X[7] = -1; else w = X[j];
|
||||
|
||||
me.x = X;
|
||||
me.i = 0;
|
||||
|
||||
// Discard an initial 256 values.
|
||||
for (j = 256; j > 0; --j) {
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
init(me, seed);
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x.slice();
|
||||
t.i = f.i;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
<span class="missing-if-branch" title="if path not taken" >I</span>if (seed == null) <span class="cstat-no" title="statement not covered" >seed = +(new Date);</span>
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (state.x) copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.xorshift7 = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
327
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html
generated
vendored
Normal file
327
node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html
generated
vendored
Normal file
|
@ -0,0 +1,327 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/lib/xorwow.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xorwow.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">92.73% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>51/55</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">72.73% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>16/22</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">88.89% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>8/9</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.48% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>43/46</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-yes">4105327x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">198x</span>
|
||||
<span class="cline-any cline-yes">198x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">198x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">4102054x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "xorwow" prng algorithm by
|
||||
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var t = (me.x ^ (me.x >>> 2));
|
||||
me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;
|
||||
return (me.d = (me.d + 362437 | 0)) +
|
||||
(me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;
|
||||
};
|
||||
|
||||
me.x = 0;
|
||||
me.y = 0;
|
||||
me.z = 0;
|
||||
me.w = 0;
|
||||
me.v = 0;
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Integer seed.
|
||||
me.x = seed;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 64; k++) {
|
||||
me.x ^= strseed.charCodeAt(k) | 0;
|
||||
if (k == strseed.length) {
|
||||
me.d = me.x << 10 ^ me.x >>> 4;
|
||||
}
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x;
|
||||
t.y = f.y;
|
||||
t.z = f.z;
|
||||
t.w = f.w;
|
||||
t.v = f.v;
|
||||
t.d = f.d;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else <span class="cstat-no" title="statement not covered" >if (define && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
|
||||
} else {
|
||||
<span class="cstat-no" title="statement not covered" > this.xorwow = impl;</span>
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
828
node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html
generated
vendored
Normal file
828
node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html
generated
vendored
Normal file
|
@ -0,0 +1,828 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for seedrandom/seedrandom.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../prettify.css" />
|
||||
<link rel="stylesheet" href="../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../index.html">All files</a> / <a href="index.html">seedrandom</a> seedrandom.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">96% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>96/100</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">85.11% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>40/47</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.33% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>14/15</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">96.39% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>80/83</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a>
|
||||
<a name='L116'></a><a href='#L116'>116</a>
|
||||
<a name='L117'></a><a href='#L117'>117</a>
|
||||
<a name='L118'></a><a href='#L118'>118</a>
|
||||
<a name='L119'></a><a href='#L119'>119</a>
|
||||
<a name='L120'></a><a href='#L120'>120</a>
|
||||
<a name='L121'></a><a href='#L121'>121</a>
|
||||
<a name='L122'></a><a href='#L122'>122</a>
|
||||
<a name='L123'></a><a href='#L123'>123</a>
|
||||
<a name='L124'></a><a href='#L124'>124</a>
|
||||
<a name='L125'></a><a href='#L125'>125</a>
|
||||
<a name='L126'></a><a href='#L126'>126</a>
|
||||
<a name='L127'></a><a href='#L127'>127</a>
|
||||
<a name='L128'></a><a href='#L128'>128</a>
|
||||
<a name='L129'></a><a href='#L129'>129</a>
|
||||
<a name='L130'></a><a href='#L130'>130</a>
|
||||
<a name='L131'></a><a href='#L131'>131</a>
|
||||
<a name='L132'></a><a href='#L132'>132</a>
|
||||
<a name='L133'></a><a href='#L133'>133</a>
|
||||
<a name='L134'></a><a href='#L134'>134</a>
|
||||
<a name='L135'></a><a href='#L135'>135</a>
|
||||
<a name='L136'></a><a href='#L136'>136</a>
|
||||
<a name='L137'></a><a href='#L137'>137</a>
|
||||
<a name='L138'></a><a href='#L138'>138</a>
|
||||
<a name='L139'></a><a href='#L139'>139</a>
|
||||
<a name='L140'></a><a href='#L140'>140</a>
|
||||
<a name='L141'></a><a href='#L141'>141</a>
|
||||
<a name='L142'></a><a href='#L142'>142</a>
|
||||
<a name='L143'></a><a href='#L143'>143</a>
|
||||
<a name='L144'></a><a href='#L144'>144</a>
|
||||
<a name='L145'></a><a href='#L145'>145</a>
|
||||
<a name='L146'></a><a href='#L146'>146</a>
|
||||
<a name='L147'></a><a href='#L147'>147</a>
|
||||
<a name='L148'></a><a href='#L148'>148</a>
|
||||
<a name='L149'></a><a href='#L149'>149</a>
|
||||
<a name='L150'></a><a href='#L150'>150</a>
|
||||
<a name='L151'></a><a href='#L151'>151</a>
|
||||
<a name='L152'></a><a href='#L152'>152</a>
|
||||
<a name='L153'></a><a href='#L153'>153</a>
|
||||
<a name='L154'></a><a href='#L154'>154</a>
|
||||
<a name='L155'></a><a href='#L155'>155</a>
|
||||
<a name='L156'></a><a href='#L156'>156</a>
|
||||
<a name='L157'></a><a href='#L157'>157</a>
|
||||
<a name='L158'></a><a href='#L158'>158</a>
|
||||
<a name='L159'></a><a href='#L159'>159</a>
|
||||
<a name='L160'></a><a href='#L160'>160</a>
|
||||
<a name='L161'></a><a href='#L161'>161</a>
|
||||
<a name='L162'></a><a href='#L162'>162</a>
|
||||
<a name='L163'></a><a href='#L163'>163</a>
|
||||
<a name='L164'></a><a href='#L164'>164</a>
|
||||
<a name='L165'></a><a href='#L165'>165</a>
|
||||
<a name='L166'></a><a href='#L166'>166</a>
|
||||
<a name='L167'></a><a href='#L167'>167</a>
|
||||
<a name='L168'></a><a href='#L168'>168</a>
|
||||
<a name='L169'></a><a href='#L169'>169</a>
|
||||
<a name='L170'></a><a href='#L170'>170</a>
|
||||
<a name='L171'></a><a href='#L171'>171</a>
|
||||
<a name='L172'></a><a href='#L172'>172</a>
|
||||
<a name='L173'></a><a href='#L173'>173</a>
|
||||
<a name='L174'></a><a href='#L174'>174</a>
|
||||
<a name='L175'></a><a href='#L175'>175</a>
|
||||
<a name='L176'></a><a href='#L176'>176</a>
|
||||
<a name='L177'></a><a href='#L177'>177</a>
|
||||
<a name='L178'></a><a href='#L178'>178</a>
|
||||
<a name='L179'></a><a href='#L179'>179</a>
|
||||
<a name='L180'></a><a href='#L180'>180</a>
|
||||
<a name='L181'></a><a href='#L181'>181</a>
|
||||
<a name='L182'></a><a href='#L182'>182</a>
|
||||
<a name='L183'></a><a href='#L183'>183</a>
|
||||
<a name='L184'></a><a href='#L184'>184</a>
|
||||
<a name='L185'></a><a href='#L185'>185</a>
|
||||
<a name='L186'></a><a href='#L186'>186</a>
|
||||
<a name='L187'></a><a href='#L187'>187</a>
|
||||
<a name='L188'></a><a href='#L188'>188</a>
|
||||
<a name='L189'></a><a href='#L189'>189</a>
|
||||
<a name='L190'></a><a href='#L190'>190</a>
|
||||
<a name='L191'></a><a href='#L191'>191</a>
|
||||
<a name='L192'></a><a href='#L192'>192</a>
|
||||
<a name='L193'></a><a href='#L193'>193</a>
|
||||
<a name='L194'></a><a href='#L194'>194</a>
|
||||
<a name='L195'></a><a href='#L195'>195</a>
|
||||
<a name='L196'></a><a href='#L196'>196</a>
|
||||
<a name='L197'></a><a href='#L197'>197</a>
|
||||
<a name='L198'></a><a href='#L198'>198</a>
|
||||
<a name='L199'></a><a href='#L199'>199</a>
|
||||
<a name='L200'></a><a href='#L200'>200</a>
|
||||
<a name='L201'></a><a href='#L201'>201</a>
|
||||
<a name='L202'></a><a href='#L202'>202</a>
|
||||
<a name='L203'></a><a href='#L203'>203</a>
|
||||
<a name='L204'></a><a href='#L204'>204</a>
|
||||
<a name='L205'></a><a href='#L205'>205</a>
|
||||
<a name='L206'></a><a href='#L206'>206</a>
|
||||
<a name='L207'></a><a href='#L207'>207</a>
|
||||
<a name='L208'></a><a href='#L208'>208</a>
|
||||
<a name='L209'></a><a href='#L209'>209</a>
|
||||
<a name='L210'></a><a href='#L210'>210</a>
|
||||
<a name='L211'></a><a href='#L211'>211</a>
|
||||
<a name='L212'></a><a href='#L212'>212</a>
|
||||
<a name='L213'></a><a href='#L213'>213</a>
|
||||
<a name='L214'></a><a href='#L214'>214</a>
|
||||
<a name='L215'></a><a href='#L215'>215</a>
|
||||
<a name='L216'></a><a href='#L216'>216</a>
|
||||
<a name='L217'></a><a href='#L217'>217</a>
|
||||
<a name='L218'></a><a href='#L218'>218</a>
|
||||
<a name='L219'></a><a href='#L219'>219</a>
|
||||
<a name='L220'></a><a href='#L220'>220</a>
|
||||
<a name='L221'></a><a href='#L221'>221</a>
|
||||
<a name='L222'></a><a href='#L222'>222</a>
|
||||
<a name='L223'></a><a href='#L223'>223</a>
|
||||
<a name='L224'></a><a href='#L224'>224</a>
|
||||
<a name='L225'></a><a href='#L225'>225</a>
|
||||
<a name='L226'></a><a href='#L226'>226</a>
|
||||
<a name='L227'></a><a href='#L227'>227</a>
|
||||
<a name='L228'></a><a href='#L228'>228</a>
|
||||
<a name='L229'></a><a href='#L229'>229</a>
|
||||
<a name='L230'></a><a href='#L230'>230</a>
|
||||
<a name='L231'></a><a href='#L231'>231</a>
|
||||
<a name='L232'></a><a href='#L232'>232</a>
|
||||
<a name='L233'></a><a href='#L233'>233</a>
|
||||
<a name='L234'></a><a href='#L234'>234</a>
|
||||
<a name='L235'></a><a href='#L235'>235</a>
|
||||
<a name='L236'></a><a href='#L236'>236</a>
|
||||
<a name='L237'></a><a href='#L237'>237</a>
|
||||
<a name='L238'></a><a href='#L238'>238</a>
|
||||
<a name='L239'></a><a href='#L239'>239</a>
|
||||
<a name='L240'></a><a href='#L240'>240</a>
|
||||
<a name='L241'></a><a href='#L241'>241</a>
|
||||
<a name='L242'></a><a href='#L242'>242</a>
|
||||
<a name='L243'></a><a href='#L243'>243</a>
|
||||
<a name='L244'></a><a href='#L244'>244</a>
|
||||
<a name='L245'></a><a href='#L245'>245</a>
|
||||
<a name='L246'></a><a href='#L246'>246</a>
|
||||
<a name='L247'></a><a href='#L247'>247</a>
|
||||
<a name='L248'></a><a href='#L248'>248</a>
|
||||
<a name='L249'></a><a href='#L249'>249</a>
|
||||
<a name='L250'></a><a href='#L250'>250</a>
|
||||
<a name='L251'></a><a href='#L251'>251</a>
|
||||
<a name='L252'></a><a href='#L252'>252</a>
|
||||
<a name='L253'></a><a href='#L253'>253</a>
|
||||
<a name='L254'></a><a href='#L254'>254</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-yes">3917x</span>
|
||||
<span class="cline-any cline-yes">3917x</span>
|
||||
<span class="cline-any cline-yes">3917x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-yes">9249x</span>
|
||||
<span class="cline-any cline-yes">9249x</span>
|
||||
<span class="cline-any cline-yes">9249x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3694x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1025x</span>
|
||||
<span class="cline-any cline-yes">4100001x</span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">20x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">19x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">5888x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-yes">5888x</span>
|
||||
<span class="cline-any cline-yes">5888x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">23x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4108660x</span>
|
||||
<span class="cline-any cline-yes">4108660x</span>
|
||||
<span class="cline-any cline-yes">4108660x</span>
|
||||
<span class="cline-any cline-yes">16436073x</span>
|
||||
<span class="cline-any cline-yes">16436073x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4108660x</span>
|
||||
<span class="cline-any cline-yes">4108660x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32x</span>
|
||||
<span class="cline-any cline-yes">32x</span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">9x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">32x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">52x</span>
|
||||
<span class="cline-any cline-yes">52x</span>
|
||||
<span class="cline-any cline-yes">7735x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">52x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">3x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">81x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/*
|
||||
Copyright 2019 David Bau.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
(function (global, pool, math) {
|
||||
//
|
||||
// The following constants are related to IEEE 754 limits.
|
||||
//
|
||||
|
||||
var width = 256, // each RC4 output is 0 <= x < 256
|
||||
chunks = 6, // at least six RC4 outputs for each double
|
||||
digits = 52, // there are 52 significant digits in a double
|
||||
rngname = 'random', // rngname: name for Math.random and Math.seedrandom
|
||||
startdenom = math.pow(width, chunks),
|
||||
significance = math.pow(2, digits),
|
||||
overflow = significance * 2,
|
||||
mask = width - 1,
|
||||
nodecrypto; // node.js crypto module, initialized at the bottom.
|
||||
|
||||
//
|
||||
// seedrandom()
|
||||
// This is the seedrandom function described above.
|
||||
//
|
||||
function seedrandom(seed, options, callback) {
|
||||
var key = [];
|
||||
options = (options == true) ? { entropy: true } : (options || {});
|
||||
|
||||
// Flatten the seed string or build one from local entropy if needed.
|
||||
var shortseed = mixkey(flatten(
|
||||
options.entropy ? [seed, tostring(pool)] :
|
||||
(seed == null) ? autoseed() : seed, 3), key);
|
||||
|
||||
// Use the seed to initialize an ARC4 generator.
|
||||
var arc4 = new ARC4(key);
|
||||
|
||||
// This function returns a random double in [0, 1) that contains
|
||||
// randomness in every bit of the mantissa of the IEEE 754 value.
|
||||
var prng = function() {
|
||||
var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48
|
||||
d = startdenom, // and denominator d = 2 ^ 48.
|
||||
x = 0; // and no 'extra last byte'.
|
||||
while (n < significance) { // Fill up all significant digits by
|
||||
n = (n + x) * width; // shifting numerator and
|
||||
d *= width; // denominator and generating a
|
||||
x = arc4.g(1); // new least-significant-byte.
|
||||
}
|
||||
while (n >= overflow) { // To avoid rounding up, before adding
|
||||
n /= 2; // last byte, shift everything
|
||||
d /= 2; // right using integer math until
|
||||
x >>>= 1; // we have exactly the desired bits.
|
||||
}
|
||||
return (n + x) / d; // Form the number within [0, 1).
|
||||
};
|
||||
|
||||
prng.int32 = function() { return arc4.g(4) | 0; }
|
||||
prng.quick = function() { return arc4.g(4) / 0x100000000; }
|
||||
prng.double = prng;
|
||||
|
||||
// Mix the randomness into accumulated entropy.
|
||||
mixkey(tostring(arc4.S), pool);
|
||||
|
||||
// Calling convention: what to return as a function of prng, seed, is_math.
|
||||
return (options.pass || callback ||
|
||||
function(prng, seed, is_math_call, state) {
|
||||
if (state) {
|
||||
// Load the arc4 state from the given state if it has an S array.
|
||||
if (state.S) { copy(state, arc4); }
|
||||
// Only provide the .state method if requested via options.state.
|
||||
prng.state = function() { return copy(arc4, {}); }
|
||||
}
|
||||
|
||||
// If called as a method of Math (Math.seedrandom()), mutate
|
||||
// Math.random because that is how seedrandom.js has worked since v1.0.
|
||||
if (is_math_call) { math[rngname] = prng; return seed; }
|
||||
|
||||
// Otherwise, it is a newer calling convention, so return the
|
||||
// prng directly.
|
||||
else return prng;
|
||||
})(
|
||||
prng,
|
||||
shortseed,
|
||||
'global' in options ? options.global : (this == math),
|
||||
options.state);
|
||||
}
|
||||
|
||||
//
|
||||
// ARC4
|
||||
//
|
||||
// An ARC4 implementation. The constructor takes a key in the form of
|
||||
// an array of at most (width) integers that should be 0 <= x < (width).
|
||||
//
|
||||
// The g(count) method returns a pseudorandom integer that concatenates
|
||||
// the next (count) outputs from ARC4. Its return value is a number x
|
||||
// that is in the range 0 <= x < (width ^ count).
|
||||
//
|
||||
function ARC4(key) {
|
||||
var t, keylen = key.length,
|
||||
me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
|
||||
|
||||
// The empty key [] is treated as [0].
|
||||
if (!keylen) { key = [keylen++]; }
|
||||
|
||||
// Set up S using the standard key scheduling algorithm.
|
||||
while (i < width) {
|
||||
s[i] = i++;
|
||||
}
|
||||
for (i = 0; i < width; i++) {
|
||||
s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
|
||||
s[j] = t;
|
||||
}
|
||||
|
||||
// The "g" method returns the next (count) outputs as one number.
|
||||
(me.g = function(count) {
|
||||
// Using instance members instead of closure state nearly doubles speed.
|
||||
var t, r = 0,
|
||||
i = me.i, j = me.j, s = me.S;
|
||||
while (count--) {
|
||||
t = s[i = mask & (i + 1)];
|
||||
r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
|
||||
}
|
||||
me.i = i; me.j = j;
|
||||
return r;
|
||||
// For robust unpredictability, the function call below automatically
|
||||
// discards an initial batch of values. This is called RC4-drop[256].
|
||||
// See http://google.com/search?q=rsa+fluhrer+response&btnI
|
||||
})(width);
|
||||
}
|
||||
|
||||
//
|
||||
// copy()
|
||||
// Copies internal state of ARC4 to or from a plain object.
|
||||
//
|
||||
function copy(f, t) {
|
||||
t.i = f.i;
|
||||
t.j = f.j;
|
||||
t.S = f.S.slice();
|
||||
return t;
|
||||
};
|
||||
|
||||
//
|
||||
// flatten()
|
||||
// Converts an object tree to nested arrays of strings.
|
||||
//
|
||||
function flatten(obj, depth) {
|
||||
var result = [], typ = (typeof obj), prop;
|
||||
if (depth && typ == 'object') {
|
||||
for (prop in obj) {
|
||||
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
|
||||
}
|
||||
}
|
||||
return (result.length ? result : typ == 'string' ? obj : obj + '\0');
|
||||
}
|
||||
|
||||
//
|
||||
// mixkey()
|
||||
// Mixes a string seed into a key that is an array of integers, and
|
||||
// returns a shortened string seed that is equivalent to the result key.
|
||||
//
|
||||
function mixkey(seed, key) {
|
||||
var stringseed = seed + '', smear, j = 0;
|
||||
while (j < stringseed.length) {
|
||||
key[mask & j] =
|
||||
mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
|
||||
}
|
||||
return tostring(key);
|
||||
}
|
||||
|
||||
//
|
||||
// autoseed()
|
||||
// Returns an object for autoseeding, using window.crypto and Node crypto
|
||||
// module if available.
|
||||
//
|
||||
function autoseed() {
|
||||
try {
|
||||
var out;
|
||||
if (nodecrypto && (out = nodecrypto.randomBytes)) {
|
||||
// The use of 'out' to remember randomBytes makes tight minified code.
|
||||
out = out(width);
|
||||
} else {
|
||||
out = new Uint8Array(width);
|
||||
(global.crypto || global.msCrypto).getRandomValues(out);
|
||||
}
|
||||
return tostring(out);
|
||||
} catch (e) {
|
||||
var browser = global.navigator,
|
||||
plugins = browser && <span class="branch-1 cbranch-no" title="branch not covered" >browser.plugins;</span>
|
||||
return [+new Date, global, plugins, global.screen, tostring(pool)];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// tostring()
|
||||
// Converts an array of charcodes to a string
|
||||
//
|
||||
function tostring(a) {
|
||||
return String.fromCharCode.apply(0, a);
|
||||
}
|
||||
|
||||
//
|
||||
// When seedrandom.js is loaded, we immediately mix a few bits
|
||||
// from the built-in RNG into the entropy pool. Because we do
|
||||
// not want to interfere with deterministic PRNG state later,
|
||||
// seedrandom will not call math.random on its own again after
|
||||
// initialization.
|
||||
//
|
||||
mixkey(math.random(), pool);
|
||||
|
||||
//
|
||||
// Nodejs and AMD support: export the implementation as a module using
|
||||
// either convention.
|
||||
//
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if ((typeof module) == 'object' && module.exports) {
|
||||
module.exports = seedrandom;
|
||||
// When in node.js, try using crypto package for autoseeding.
|
||||
try {
|
||||
nodecrypto = require('crypto');
|
||||
} catch (ex) {}
|
||||
} else <span class="cstat-no" title="statement not covered" >if ((typeof define) == 'function' && define.amd) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return seedrandom; </span>});</span>
|
||||
} else {
|
||||
// When included as a plain script, set up Math.seedrandom global.
|
||||
<span class="cstat-no" title="statement not covered" > math['seed' + rngname] = seedrandom;</span>
|
||||
}
|
||||
|
||||
|
||||
// End anonymous scope, and pass initial values.
|
||||
})(
|
||||
// global: `self` in browsers (including strict mode and web workers),
|
||||
// otherwise `this` in Node and other environments
|
||||
(typeof self !== 'undefined') ? <span class="branch-0 cbranch-no" title="branch not covered" >self </span>: this,
|
||||
[], // pool: entropy pool starts empty
|
||||
Math // math: package containing random, pow, and seedrandom
|
||||
);
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../sorter.js"></script>
|
||||
<script src="../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
BIN
node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
BIN
node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
170
node_modules/seedrandom/coverage/lcov-report/sorter.js
generated
vendored
Normal file
170
node_modules/seedrandom/coverage/lcov-report/sorter.js
generated
vendored
Normal file
|
@ -0,0 +1,170 @@
|
|||
/* eslint-disable */
|
||||
var addSorting = (function() {
|
||||
'use strict';
|
||||
var cols,
|
||||
currentSort = {
|
||||
index: 0,
|
||||
desc: false
|
||||
};
|
||||
|
||||
// returns the summary table element
|
||||
function getTable() {
|
||||
return document.querySelector('.coverage-summary');
|
||||
}
|
||||
// returns the thead element of the summary table
|
||||
function getTableHeader() {
|
||||
return getTable().querySelector('thead tr');
|
||||
}
|
||||
// returns the tbody element of the summary table
|
||||
function getTableBody() {
|
||||
return getTable().querySelector('tbody');
|
||||
}
|
||||
// returns the th element for nth column
|
||||
function getNthColumn(n) {
|
||||
return getTableHeader().querySelectorAll('th')[n];
|
||||
}
|
||||
|
||||
// loads all columns
|
||||
function loadColumns() {
|
||||
var colNodes = getTableHeader().querySelectorAll('th'),
|
||||
colNode,
|
||||
cols = [],
|
||||
col,
|
||||
i;
|
||||
|
||||
for (i = 0; i < colNodes.length; i += 1) {
|
||||
colNode = colNodes[i];
|
||||
col = {
|
||||
key: colNode.getAttribute('data-col'),
|
||||
sortable: !colNode.getAttribute('data-nosort'),
|
||||
type: colNode.getAttribute('data-type') || 'string'
|
||||
};
|
||||
cols.push(col);
|
||||
if (col.sortable) {
|
||||
col.defaultDescSort = col.type === 'number';
|
||||
colNode.innerHTML =
|
||||
colNode.innerHTML + '<span class="sorter"></span>';
|
||||
}
|
||||
}
|
||||
return cols;
|
||||
}
|
||||
// attaches a data attribute to every tr element with an object
|
||||
// of data values keyed by column name
|
||||
function loadRowData(tableRow) {
|
||||
var tableCols = tableRow.querySelectorAll('td'),
|
||||
colNode,
|
||||
col,
|
||||
data = {},
|
||||
i,
|
||||
val;
|
||||
for (i = 0; i < tableCols.length; i += 1) {
|
||||
colNode = tableCols[i];
|
||||
col = cols[i];
|
||||
val = colNode.getAttribute('data-value');
|
||||
if (col.type === 'number') {
|
||||
val = Number(val);
|
||||
}
|
||||
data[col.key] = val;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
// loads all row data
|
||||
function loadData() {
|
||||
var rows = getTableBody().querySelectorAll('tr'),
|
||||
i;
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
rows[i].data = loadRowData(rows[i]);
|
||||
}
|
||||
}
|
||||
// sorts the table using the data for the ith column
|
||||
function sortByIndex(index, desc) {
|
||||
var key = cols[index].key,
|
||||
sorter = function(a, b) {
|
||||
a = a.data[key];
|
||||
b = b.data[key];
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
},
|
||||
finalSorter = sorter,
|
||||
tableBody = document.querySelector('.coverage-summary tbody'),
|
||||
rowNodes = tableBody.querySelectorAll('tr'),
|
||||
rows = [],
|
||||
i;
|
||||
|
||||
if (desc) {
|
||||
finalSorter = function(a, b) {
|
||||
return -1 * sorter(a, b);
|
||||
};
|
||||
}
|
||||
|
||||
for (i = 0; i < rowNodes.length; i += 1) {
|
||||
rows.push(rowNodes[i]);
|
||||
tableBody.removeChild(rowNodes[i]);
|
||||
}
|
||||
|
||||
rows.sort(finalSorter);
|
||||
|
||||
for (i = 0; i < rows.length; i += 1) {
|
||||
tableBody.appendChild(rows[i]);
|
||||
}
|
||||
}
|
||||
// removes sort indicators for current column being sorted
|
||||
function removeSortIndicators() {
|
||||
var col = getNthColumn(currentSort.index),
|
||||
cls = col.className;
|
||||
|
||||
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
||||
col.className = cls;
|
||||
}
|
||||
// adds sort indicators for current column being sorted
|
||||
function addSortIndicators() {
|
||||
getNthColumn(currentSort.index).className += currentSort.desc
|
||||
? ' sorted-desc'
|
||||
: ' sorted';
|
||||
}
|
||||
// adds event listeners for all sorter widgets
|
||||
function enableUI() {
|
||||
var i,
|
||||
el,
|
||||
ithSorter = function ithSorter(i) {
|
||||
var col = cols[i];
|
||||
|
||||
return function() {
|
||||
var desc = col.defaultDescSort;
|
||||
|
||||
if (currentSort.index === i) {
|
||||
desc = !currentSort.desc;
|
||||
}
|
||||
sortByIndex(i, desc);
|
||||
removeSortIndicators();
|
||||
currentSort.index = i;
|
||||
currentSort.desc = desc;
|
||||
addSortIndicators();
|
||||
};
|
||||
};
|
||||
for (i = 0; i < cols.length; i += 1) {
|
||||
if (cols[i].sortable) {
|
||||
// add the click event handler on the th so users
|
||||
// dont have to click on those tiny arrows
|
||||
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener('click', ithSorter(i));
|
||||
} else {
|
||||
el.attachEvent('onclick', ithSorter(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// adds sorting functionality to the UI
|
||||
return function() {
|
||||
if (!getTable()) {
|
||||
return;
|
||||
}
|
||||
cols = loadColumns();
|
||||
loadData();
|
||||
addSortIndicators();
|
||||
enableUI();
|
||||
};
|
||||
})();
|
||||
|
||||
window.addEventListener('load', addSorting);
|
799
node_modules/seedrandom/coverage/lcov.info
generated
vendored
Normal file
799
node_modules/seedrandom/coverage/lcov.info
generated
vendored
Normal file
|
@ -0,0 +1,799 @@
|
|||
TN:
|
||||
SF:/home/davidbau/git/seedrandom/seedrandom.js
|
||||
FN:25,(anonymous_0)
|
||||
FN:44,seedrandom
|
||||
FN:58,(anonymous_2)
|
||||
FN:75,(anonymous_3)
|
||||
FN:76,(anonymous_4)
|
||||
FN:84,(anonymous_5)
|
||||
FN:89,(anonymous_6)
|
||||
FN:116,ARC4
|
||||
FN:133,(anonymous_8)
|
||||
FN:153,copy
|
||||
FN:164,flatten
|
||||
FN:179,mixkey
|
||||
FN:193,autoseed
|
||||
FN:215,tostring
|
||||
FN:239,(anonymous_14)
|
||||
FNF:15
|
||||
FNH:14
|
||||
FNDA:6,(anonymous_0)
|
||||
FNDA:23,seedrandom
|
||||
FNDA:3694,(anonymous_2)
|
||||
FNDA:1025,(anonymous_3)
|
||||
FNDA:4100001,(anonymous_4)
|
||||
FNDA:20,(anonymous_5)
|
||||
FNDA:2,(anonymous_6)
|
||||
FNDA:23,ARC4
|
||||
FNDA:4108660,(anonymous_8)
|
||||
FNDA:4,copy
|
||||
FNDA:32,flatten
|
||||
FNDA:52,mixkey
|
||||
FNDA:4,autoseed
|
||||
FNDA:81,tostring
|
||||
FNDA:0,(anonymous_14)
|
||||
DA:25,6
|
||||
DA:30,6
|
||||
DA:31,6
|
||||
DA:32,6
|
||||
DA:33,6
|
||||
DA:34,6
|
||||
DA:35,6
|
||||
DA:36,6
|
||||
DA:37,6
|
||||
DA:45,23
|
||||
DA:46,23
|
||||
DA:49,23
|
||||
DA:54,23
|
||||
DA:58,23
|
||||
DA:59,3694
|
||||
DA:60,3694
|
||||
DA:61,3694
|
||||
DA:62,3694
|
||||
DA:63,3917
|
||||
DA:64,3917
|
||||
DA:65,3917
|
||||
DA:67,3694
|
||||
DA:68,9249
|
||||
DA:69,9249
|
||||
DA:70,9249
|
||||
DA:72,3694
|
||||
DA:75,1025
|
||||
DA:76,4100001
|
||||
DA:77,23
|
||||
DA:80,23
|
||||
DA:83,23
|
||||
DA:85,20
|
||||
DA:87,4
|
||||
DA:89,4
|
||||
DA:94,20
|
||||
DA:98,19
|
||||
DA:117,23
|
||||
DA:118,23
|
||||
DA:121,23
|
||||
DA:124,23
|
||||
DA:125,5888
|
||||
DA:127,23
|
||||
DA:128,5888
|
||||
DA:129,5888
|
||||
DA:133,23
|
||||
DA:135,4108660
|
||||
DA:136,4108660
|
||||
DA:137,4108660
|
||||
DA:138,16436073
|
||||
DA:139,16436073
|
||||
DA:141,4108660
|
||||
DA:142,4108660
|
||||
DA:154,4
|
||||
DA:155,4
|
||||
DA:156,4
|
||||
DA:157,4
|
||||
DA:165,32
|
||||
DA:166,32
|
||||
DA:167,4
|
||||
DA:168,9
|
||||
DA:171,32
|
||||
DA:180,52
|
||||
DA:181,52
|
||||
DA:182,7735
|
||||
DA:185,52
|
||||
DA:194,4
|
||||
DA:196,4
|
||||
DA:198,3
|
||||
DA:200,1
|
||||
DA:201,1
|
||||
DA:203,3
|
||||
DA:205,1
|
||||
DA:206,1
|
||||
DA:207,1
|
||||
DA:216,81
|
||||
DA:226,6
|
||||
DA:232,6
|
||||
DA:233,6
|
||||
DA:235,6
|
||||
DA:236,6
|
||||
DA:238,0
|
||||
DA:239,0
|
||||
DA:242,0
|
||||
LF:83
|
||||
LH:80
|
||||
BRDA:46,0,0,1
|
||||
BRDA:46,0,1,22
|
||||
BRDA:46,1,0,22
|
||||
BRDA:46,1,1,11
|
||||
BRDA:50,2,0,2
|
||||
BRDA:50,2,1,21
|
||||
BRDA:51,3,0,4
|
||||
BRDA:51,3,1,17
|
||||
BRDA:83,4,0,23
|
||||
BRDA:83,4,1,21
|
||||
BRDA:83,4,2,20
|
||||
BRDA:85,5,0,4
|
||||
BRDA:85,5,1,16
|
||||
BRDA:87,6,0,2
|
||||
BRDA:87,6,1,2
|
||||
BRDA:94,7,0,1
|
||||
BRDA:94,7,1,19
|
||||
BRDA:102,8,0,4
|
||||
BRDA:102,8,1,19
|
||||
BRDA:121,9,0,1
|
||||
BRDA:121,9,1,22
|
||||
BRDA:166,10,0,4
|
||||
BRDA:166,10,1,28
|
||||
BRDA:166,11,0,32
|
||||
BRDA:166,11,1,32
|
||||
BRDA:171,12,0,3
|
||||
BRDA:171,12,1,29
|
||||
BRDA:171,13,0,23
|
||||
BRDA:171,13,1,6
|
||||
BRDA:196,14,0,3
|
||||
BRDA:196,14,1,1
|
||||
BRDA:196,15,0,4
|
||||
BRDA:196,15,1,3
|
||||
BRDA:201,16,0,1
|
||||
BRDA:201,16,1,1
|
||||
BRDA:206,17,0,1
|
||||
BRDA:206,17,1,0
|
||||
BRDA:232,18,0,6
|
||||
BRDA:232,18,1,0
|
||||
BRDA:232,19,0,6
|
||||
BRDA:232,19,1,6
|
||||
BRDA:238,20,0,0
|
||||
BRDA:238,20,1,0
|
||||
BRDA:238,21,0,0
|
||||
BRDA:238,21,1,0
|
||||
BRDA:250,22,0,0
|
||||
BRDA:250,22,1,6
|
||||
BRF:47
|
||||
BRH:40
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/davidbau/git/seedrandom/lib/alea.js
|
||||
FN:28,(anonymous_0)
|
||||
FN:30,Alea
|
||||
FN:33,(anonymous_2)
|
||||
FN:54,copy
|
||||
FN:62,impl
|
||||
FN:66,(anonymous_5)
|
||||
FN:67,(anonymous_6)
|
||||
FN:73,(anonymous_7)
|
||||
FN:78,Mash
|
||||
FN:81,(anonymous_9)
|
||||
FN:103,(anonymous_10)
|
||||
FNF:11
|
||||
FNH:10
|
||||
FNDA:1,(anonymous_0)
|
||||
FNDA:3,Alea
|
||||
FNDA:4105129,(anonymous_2)
|
||||
FNDA:2,copy
|
||||
FNDA:3,impl
|
||||
FNDA:1025,(anonymous_5)
|
||||
FNDA:1025,(anonymous_6)
|
||||
FNDA:1,(anonymous_7)
|
||||
FNDA:3,Mash
|
||||
FNDA:18,(anonymous_9)
|
||||
FNDA:0,(anonymous_10)
|
||||
DA:28,1
|
||||
DA:31,3
|
||||
DA:33,3
|
||||
DA:34,4105129
|
||||
DA:35,4105129
|
||||
DA:36,4105129
|
||||
DA:37,4105129
|
||||
DA:41,3
|
||||
DA:42,3
|
||||
DA:43,3
|
||||
DA:44,3
|
||||
DA:45,3
|
||||
DA:46,3
|
||||
DA:47,3
|
||||
DA:48,3
|
||||
DA:49,3
|
||||
DA:50,3
|
||||
DA:51,3
|
||||
DA:55,2
|
||||
DA:56,2
|
||||
DA:57,2
|
||||
DA:58,2
|
||||
DA:59,2
|
||||
DA:63,3
|
||||
DA:64,3
|
||||
DA:65,3
|
||||
DA:66,1025
|
||||
DA:67,3
|
||||
DA:68,1025
|
||||
DA:70,3
|
||||
DA:71,3
|
||||
DA:72,2
|
||||
DA:73,2
|
||||
DA:75,3
|
||||
DA:79,3
|
||||
DA:81,3
|
||||
DA:82,18
|
||||
DA:83,18
|
||||
DA:84,33
|
||||
DA:85,33
|
||||
DA:86,33
|
||||
DA:87,33
|
||||
DA:88,33
|
||||
DA:89,33
|
||||
DA:90,33
|
||||
DA:91,33
|
||||
DA:93,18
|
||||
DA:96,3
|
||||
DA:100,1
|
||||
DA:101,1
|
||||
DA:102,0
|
||||
DA:103,0
|
||||
DA:105,0
|
||||
LF:53
|
||||
LH:50
|
||||
BRDA:46,0,0,1
|
||||
BRDA:46,0,1,2
|
||||
BRDA:48,1,0,3
|
||||
BRDA:48,1,1,0
|
||||
BRDA:50,2,0,0
|
||||
BRDA:50,2,1,3
|
||||
BRDA:64,3,0,3
|
||||
BRDA:64,3,1,2
|
||||
BRDA:71,4,0,2
|
||||
BRDA:71,4,1,1
|
||||
BRDA:72,5,0,1
|
||||
BRDA:72,5,1,1
|
||||
BRDA:100,6,0,1
|
||||
BRDA:100,6,1,0
|
||||
BRDA:100,7,0,1
|
||||
BRDA:100,7,1,1
|
||||
BRDA:102,8,0,0
|
||||
BRDA:102,8,1,0
|
||||
BRDA:102,9,0,0
|
||||
BRDA:102,9,1,0
|
||||
BRDA:110,10,0,1
|
||||
BRDA:110,10,1,1
|
||||
BRDA:111,11,0,1
|
||||
BRDA:111,11,1,0
|
||||
BRF:24
|
||||
BRH:16
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/davidbau/git/seedrandom/lib/tychei.js
|
||||
FN:5,(anonymous_0)
|
||||
FN:7,XorGen
|
||||
FN:11,(anonymous_2)
|
||||
FN:60,copy
|
||||
FN:68,impl
|
||||
FN:71,(anonymous_5)
|
||||
FN:72,(anonymous_6)
|
||||
FN:84,(anonymous_7)
|
||||
FN:92,(anonymous_8)
|
||||
FNF:9
|
||||
FNH:8
|
||||
FNDA:1,(anonymous_0)
|
||||
FNDA:3,XorGen
|
||||
FNDA:4105195,(anonymous_2)
|
||||
FNDA:2,copy
|
||||
FNDA:3,impl
|
||||
FNDA:4102054,(anonymous_5)
|
||||
FNDA:1025,(anonymous_6)
|
||||
FNDA:1,(anonymous_7)
|
||||
FNDA:0,(anonymous_8)
|
||||
DA:5,1
|
||||
DA:8,3
|
||||
DA:11,3
|
||||
DA:12,4105195
|
||||
DA:13,4105195
|
||||
DA:14,4105195
|
||||
DA:15,4105195
|
||||
DA:16,4105195
|
||||
DA:17,4105195
|
||||
DA:18,4105195
|
||||
DA:19,4105195
|
||||
DA:20,4105195
|
||||
DA:39,3
|
||||
DA:40,3
|
||||
DA:41,3
|
||||
DA:42,3
|
||||
DA:44,3
|
||||
DA:46,2
|
||||
DA:47,2
|
||||
DA:50,1
|
||||
DA:54,3
|
||||
DA:55,66
|
||||
DA:56,66
|
||||
DA:61,2
|
||||
DA:62,2
|
||||
DA:63,2
|
||||
DA:64,2
|
||||
DA:65,2
|
||||
DA:69,3
|
||||
DA:70,3
|
||||
DA:71,4102054
|
||||
DA:72,3
|
||||
DA:73,1025
|
||||
DA:74,1025
|
||||
DA:75,1025
|
||||
DA:76,1025
|
||||
DA:78,1025
|
||||
DA:80,3
|
||||
DA:81,3
|
||||
DA:82,3
|
||||
DA:83,2
|
||||
DA:84,2
|
||||
DA:86,3
|
||||
DA:89,1
|
||||
DA:90,1
|
||||
DA:91,0
|
||||
DA:92,0
|
||||
DA:94,0
|
||||
LF:48
|
||||
LH:45
|
||||
BRDA:44,0,0,2
|
||||
BRDA:44,0,1,1
|
||||
BRDA:70,1,0,3
|
||||
BRDA:70,1,1,2
|
||||
BRDA:82,2,0,2
|
||||
BRDA:82,2,1,1
|
||||
BRDA:83,3,0,1
|
||||
BRDA:83,3,1,1
|
||||
BRDA:89,4,0,1
|
||||
BRDA:89,4,1,0
|
||||
BRDA:89,5,0,1
|
||||
BRDA:89,5,1,1
|
||||
BRDA:91,6,0,0
|
||||
BRDA:91,6,1,0
|
||||
BRDA:91,7,0,0
|
||||
BRDA:91,7,1,0
|
||||
BRDA:99,8,0,1
|
||||
BRDA:99,8,1,1
|
||||
BRDA:100,9,0,1
|
||||
BRDA:100,9,1,0
|
||||
BRF:20
|
||||
BRH:14
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/davidbau/git/seedrandom/lib/xor128.js
|
||||
FN:4,(anonymous_0)
|
||||
FN:6,XorGen
|
||||
FN:15,(anonymous_2)
|
||||
FN:38,copy
|
||||
FN:46,impl
|
||||
FN:49,(anonymous_5)
|
||||
FN:50,(anonymous_6)
|
||||
FN:62,(anonymous_7)
|
||||
FN:70,(anonymous_8)
|
||||
FNF:9
|
||||
FNH:8
|
||||
FNDA:1,(anonymous_0)
|
||||
FNDA:3,XorGen
|
||||
FNDA:4105327,(anonymous_2)
|
||||
FNDA:2,copy
|
||||
FNDA:3,impl
|
||||
FNDA:4102054,(anonymous_5)
|
||||
FNDA:1025,(anonymous_6)
|
||||
FNDA:1,(anonymous_7)
|
||||
FNDA:0,(anonymous_8)
|
||||
DA:4,1
|
||||
DA:7,3
|
||||
DA:9,3
|
||||
DA:10,3
|
||||
DA:11,3
|
||||
DA:12,3
|
||||
DA:15,3
|
||||
DA:16,4105327
|
||||
DA:17,4105327
|
||||
DA:18,4105327
|
||||
DA:19,4105327
|
||||
DA:20,4105327
|
||||
DA:23,3
|
||||
DA:25,2
|
||||
DA:28,1
|
||||
DA:32,3
|
||||
DA:33,198
|
||||
DA:34,198
|
||||
DA:39,2
|
||||
DA:40,2
|
||||
DA:41,2
|
||||
DA:42,2
|
||||
DA:43,2
|
||||
DA:47,3
|
||||
DA:48,3
|
||||
DA:49,4102054
|
||||
DA:50,3
|
||||
DA:51,1025
|
||||
DA:52,1025
|
||||
DA:53,1025
|
||||
DA:54,1025
|
||||
DA:56,1025
|
||||
DA:58,3
|
||||
DA:59,3
|
||||
DA:60,3
|
||||
DA:61,2
|
||||
DA:62,2
|
||||
DA:64,3
|
||||
DA:67,1
|
||||
DA:68,1
|
||||
DA:69,0
|
||||
DA:70,0
|
||||
DA:72,0
|
||||
LF:43
|
||||
LH:40
|
||||
BRDA:23,0,0,2
|
||||
BRDA:23,0,1,1
|
||||
BRDA:48,1,0,3
|
||||
BRDA:48,1,1,2
|
||||
BRDA:60,2,0,2
|
||||
BRDA:60,2,1,1
|
||||
BRDA:61,3,0,1
|
||||
BRDA:61,3,1,1
|
||||
BRDA:67,4,0,1
|
||||
BRDA:67,4,1,0
|
||||
BRDA:67,5,0,1
|
||||
BRDA:67,5,1,1
|
||||
BRDA:69,6,0,0
|
||||
BRDA:69,6,1,0
|
||||
BRDA:69,7,0,0
|
||||
BRDA:69,7,1,0
|
||||
BRDA:77,8,0,1
|
||||
BRDA:77,8,1,1
|
||||
BRDA:78,9,0,1
|
||||
BRDA:78,9,1,0
|
||||
BRF:20
|
||||
BRH:14
|
||||
end_of_record
|
||||
TN:
|
||||
SF:/home/davidbau/git/seedrandom/lib/xor4096.js
|
||||
FN:26,(anonymous_0)
|
||||
FN:28,XorGen
|
||||
FN:32,(anonymous_2)
|
||||
FN:51,init
|
||||
FN:105,copy
|