master
Valerie 2021-07-05 20:32:57 -04:00
commit 01d68878bf
9 changed files with 4933 additions and 0 deletions

2
.gitignore vendored 100644
View File

@ -0,0 +1,2 @@
node_modules
test.png

3378
package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

15
package.json 100644
View File

@ -0,0 +1,15 @@
{
"name": "noise",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"canvas": "^2.8.0",
"chalk": "^4.0.0",
"color": "^3.1.3",
"fast-simplex-noise": "^3.2.1",
"seedrandom": "^3.0.5",
"signale": "^1.4.0",
"simplex-noise": "^2.4.0"
}
}

69
src/Image.js 100644
View File

@ -0,0 +1,69 @@
class Image {
constructor(width, height) {
this._width = width;
this._height = height;
this._buffer = new Array(height);
for(let i = 0; i < height; i ++) {
this._buffer[i] = new Array(width).fill(null);
}
}
get width() {
return this._width;
}
get height() {
return this._height;
}
// render(x, y) {
// // console.log(this._buffer[0][10] == this._buffer[10][10]);
// // process.stdout.cursorTo(0, 0);
// process.stdout.cursorTo(x, y);
// let buffer = '';
// for(let dy = 0; dy < this.height; dy ++) {
// for(let dx = 0; dx < this.width; dx ++) {
// buffer += this._buffer[dy][dx];
// }
// buffer += '\n';
// }
// process.stdout.write(buffer.trim());
// }
addLayer(image, originX, originY) {
for(let y = originY; y < image.height; y ++) {
const previousLine = this._buffer[y]
const left = previousLine.substr(0, originX);
const right = previousLine.substr(originX + image.width);
const newLine = left + image.getRow(y - originY) + right;
}
}
set(x, y, char) {
this._buffer[y][x] = char;
// console.log(y, x, char);
}
get(x, y) {
}
}
class BlankImage extends Image {
constructor(width, height, char) {
super(width, height);
this.char = char
}
get() {
return this.char;
}
}
module.exports = {
Image,
BlankImage
};

View File

@ -0,0 +1,40 @@
const width = process.stdout.getWindowSize()[0];
module.exports.fromBuckets = fromBuckets;
function fromBuckets(buckets) {
return function(num) {
let char;
for(const [min, character] of buckets) {
if(num > min) char = character;
}
return char;
}
}
module.exports.fromDistribution = fromDistribution;
function fromDistribution(min, max, chars) {
const n = chars.length;
const bucketMins = chars.map((_, i) => {
if(i === 0) return -Infinity
return ((i / n) * (max - min)) + min
});
const buckets = bucketMins.map((v, i) => {
return [v, chars[i]]
});
const mapping = fromBuckets(buckets);
return mapping;
}
module.exports.printMapping = printMapping;
function printMapping(mapping, min, max) {
let buffer = '';
for(let i = 0; i < width; i ++) {
const val = ((i / width) * (max - min)) + min;
buffer += mapping(val);
}
console.log(buffer)
console.log(buffer)
}

171
src/generators.js 100644
View File

@ -0,0 +1,171 @@
const FastSimplexNoise = require('./noise').default
const seedrandom = require('seedrandom');
const noiseGen2 = new FastSimplexNoise({
frequency: 1,
max: 1,
min: -1,
octaves: 1
});
const noiseGen3 = new FastSimplexNoise({
frequency: 0.1,
max: 1,
min: 0,
octaves: 4
});
const noiseGen4 = new FastSimplexNoise({
frequency: 1,
max: 1,
min: -1,
octaves: 1
});
const poleHeight = 1.3;
const timeStart = Date.now();
function dTime() {
return (Date.now() - timeStart) / 10000
}
module.exports.terrainGen = function terrainGen(x, y) {
if(Math.sqrt((x / 2)**2 + y**2) > 2) return null;
const mapHeight = noiseGen.scaled([ x, y ]);
//fragmentation, start at .3 ish
const fragmentation = noiseGen.scaled([126734, 345678]) * 3
const size = noiseGen.scaled([3670, 35]) ** 2 * 2;
const distance = (Math.sqrt((x / 2)**2 + y**2));
const continentBase = Math.atan((size - distance)/fragmentation);
const lowFNoise = noiseGen3.scaled([x, y]);
// return
return (continentBase * lowFNoise) + mapHeight;
// return mapHeight;
}
module.exports.testGen = function testGen(x, y) {
if(Math.sqrt((x / 2)**2 + y**2) > 2) return null;
const topPadding = .8;
const gradientTension = 1/2;
const baselineOffset = dTime();
const baselineAmplitude = 0.3;
const baseline = (Math.sin(((x + baselineOffset) / 4) * Math.PI) * baselineAmplitude);
const baseGradient = (1-((Math.abs((y + baseline) * topPadding) / 2) ** gradientTension)) * 100;
const kRandom = 20;
const randomTension = 1;
const randomness1 = noiseGen2.scaled([ x + dTime(), y ]) ** randomTension * kRandom;
const randomness2 = noiseGen4.scaled([ x - dTime(), y ]) ** randomTension * kRandom;
const animRandom = (randomness1 * randomness2) / kRandom;
return baseGradient + animRandom;
// return mapHeight;
}
const masterng = seedrandom('terra');
const rngs = [
seedrandom(Math.floor(masterng() * 100000)),
seedrandom(Math.floor(masterng() * 100000)),
seedrandom(Math.floor(masterng() * 100000)),
seedrandom(Math.floor(masterng() * 100000)),
];
const plateGen = new FastSimplexNoise({
frequency: .003,
max: 1,
min: 0,
octaves: 10,
random: rngs[0]
});
const riverGen = new FastSimplexNoise({
frequency: .01,
max: 1,
min: 0,
octaves: 40,
random: rngs[1]
});
const basinGen = new FastSimplexNoise({
frequency: .01,
max: 1,
min: 0,
octaves: 8,
random: rngs[1]
});
const terrainGen = new FastSimplexNoise({
frequency: .1,
max: 1,
min: 0,
octaves: 3,
random: rngs[2]
});
module.exports.biomes = function biomes(x, y) {
x += dTime() * 10;
const plate = Math.E ** (-1 * ((20 * (plateGen.scaled([x/2, y + 100]) - 0.5)) ** 2));
const basin = 1 - (Math.atan((basinGen.scaled([x/2, y]) - 0.5) * 32) + (Math.PI / 2)) / Math.PI
const terrain = terrainGen.scaled([x/2, y + 100]);
return ((
basin +
(plate * (basin ** (1/7))) +
terrain
) / 3) * 8;
return terrain * 8
}
module.exports.plates = function plates(x, y) {
const input = plateGen.scaled([x, y]);
const shelfPoint = 0.5;
const shelfHigh = 0.5;
const shelfLow = 0.05;
const ridgeHeight = 0.1;
const ridgeEnd = 0.1;
const output = map(input,
[0, ridgeHeight],
[ridgeEnd, 0],
[shelfPoint, shelfLow],
[shelfPoint, shelfHigh],
[1, 1]
);
// const output = map2(x / 1000, .4, .6, 0, 1);
return Math.round(output * 255);
}
module.exports.rivers = function(x, y) {
// const plate = Math.E ** (-1 * ((7 * riverGen.scaled([x, y])) ** 2));
const input = riverGen.scaled([x, y]);
const midpoint = 0.5
const widthConstant = 0.05
const output = input < midpoint - widthConstant ? 0
: input < midpoint ? (input - (midpoint - widthConstant)) / widthConstant
: input < midpoint + widthConstant ? 1 - (input - midpoint) / widthConstant
: 0
return Math.round(output * 255);
}
function map(number, ...points) {
let previousY = points[0][0];
let previousX = points[0][1];
for(const [x, y] of points) {
if(number <= x) {
// console.log(
// 'mapping',
// number.toFixed(2),
// 'from range',
// previousX.toFixed(2), '-', x.toFixed(2),
// 'to',
// previousY.toFixed(2), '-', y.toFixed(2)
// );
return number = map2(number, previousX, x, previousY, y);
}
previousY = y;
previousX = x;
}
return number;
}
function map2(num, inMin, inMax, outMin, outMax) {
return (num - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}
// for(let input = 0; input < 1; input += 0.05)
// console.log(input, map(input, [0, 0], [0.9, 1], [1, 1]))

229
src/index.js 100644
View File

@ -0,0 +1,229 @@
console.log('booting generators...');
const width = process.stdout.getWindowSize()[0];
const height = process.stdout.getWindowSize()[1];
const chalk = require('chalk');
const characterMapping = require('./characterMapping');
const gen = require('./generators');
// process.stdout.write('\x1b[?25l');
const { Image, BlankImage } = require('./Image');
const {Canvas} = require('canvas');
const w = 800, h = w / 2;
const canvas = new Canvas(w, h);
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'magenta';
ctx.fillRect(0, 0, w, h);
const { createWriteStream } = require('fs');
const { EventEmitter } = require('stream');
function lerp(min, max, val) {
return val*(max-min) + min;
}
const terrainMap = characterMapping.fromBuckets([
[Number.NEGATIVE_INFINITY, chalk.bgBlue.cyan('~')],
[lerp(0, 1, 0.30), chalk.bgBlue.cyan(' ')],
[lerp(0, 1, 0.35), chalk.bgYellow(' ')],
[lerp(0, 1, 0.40), chalk.bgGreen.greenBright(' ')],
[lerp(0, 1, 0.50), chalk.bgGreenBright(' ')],
[lerp(0, 1, 0.65), chalk.bgGreenBright.whiteBright(' ')],
[lerp(0, 1, 0.70), chalk.bgWhiteBright(' ')]
]);
function rainbowMap(min, max) {
return characterMapping.fromDistribution(min, max, [
chalk.bgHex('#396FE2')(' '),
chalk.bgHex('#89DDFF')(' '),
chalk.bgHex('#9ECE58')(' '),
chalk.bgHex('#FAED70')(' '),
chalk.bgHex('#FFCB6B')(' '),
chalk.bgHex('#FF8F6E')(' '),
chalk.bgHex('#FF5370')(' '),
chalk.bgHex('#D62341')(' ')
]);
}
function numberMap(min, max) {
return characterMapping.fromDistribution(min, max, [
chalk.bgHex('#396FE2').black('0'),
chalk.bgHex('#89DDFF').black('1'),
chalk.bgHex('#9ECE58').black('2'),
chalk.bgHex('#FAED70').black('3'),
chalk.bgHex('#FFCB6B').black('4'),
chalk.bgHex('#FF8F6E').black('5'),
chalk.bgHex('#FF5370').black('6'),
chalk.bgHex('#D62341').black('7')
]);
}
const tempMapAlt = characterMapping.fromDistribution(0, 100, [
chalk.bgHex('#396FE2')(' '),
chalk.bgHex('#89DDFF')(' '),
chalk.bgHex('#9ECE58')(' '),
chalk.bgHex('#FAED70')(' '),
chalk.bgHex('#FFCB6B')(' '),
chalk.bgHex('#FF5370')(' '),
chalk.bgHex('#D62341')(' ')
]);
// const heightMap = rangeToCharacter([
// [Number.NEGATIVE_INFINITY, chalk.bgBlue.cyan('~')],
// [lerp(min, max, 0.3), chalk.bgBlue.cyan(' ')],
// [lerp(min, max, 0.35), chalk.bgYellow(' ')],
// [lerp(min, max, 0.4), chalk.bgGreen(' ')],
// [lerp(min, max, 0.45), chalk.bgGreen.greenBright('/')],
// [lerp(min, max, 0.5), chalk.bgGreenBright.green('X')],
// [lerp(min, max, 0.55), chalk.bgGreenBright.green('/')],
// [lerp(min, max, 0.6), chalk.bgGreenBright(' ')],
// [lerp(min, max, 0.65), chalk.bgGreenBright.whiteBright('/')],
// [lerp(min, max, 0.7), chalk.bgWhiteBright(' ')]
// ])
let statMin = Number.POSITIVE_INFINITY, statMax = Number.NEGATIVE_INFINITY;
function draw(generator, charMap) {
let image = new Image(width, height);
for(let y = 0; y < height; y ++) {
for(let x = 0; x < width; x ++) {
const mapX = (x - width / 2), mapY = (y - height / 2);
const value2d = generator(mapX, mapY);
if(value2d == null) image.set(x, y, chalk.reset(' '));
else image.set(x, y, (charMap(value2d)));
}
}
image.render(0, 0)
}
function imageDraw(generator) {
for(let y = 0; y < h; y ++) {
for(let x = 0; x < w; x ++) {
const mapX = (x) * (800 / w);
const mapY = ((y) * (800 / w)) + 9283457;
const value2d = generator(mapX, mapY);
ctx.fillStyle = value2d;
ctx.fillRect(x, y, 1, 1);
}
const progress = (((y + 1) * w)) / (w * h);
process.stdout.write('[' + '='.repeat(progress * (process.stdout.columns - 2)).padEnd(process.stdout.columns - 2, '-') + ']\r');
}
console.log();
}
async function animateZoom(generator, mappingFn) {
for(let i = 0; i < 8; i += 0.2) {
draw(generator, i, mappingFn);
await new Promise(res => setTimeout(res, 0));
}
}
async function animate(generator, zoom, mappingFn) {
while(true) {
draw(generator, zoom, mappingFn);
await new Promise(res => setTimeout(res, 0));
}
}
// animate(terrainGen, 2, terrainbowMap)
// animate(terrainGen, 2, terrainMap)
// animate(testGen, 2, rainbowMap(-20, 20))
// console.log('statMin', statMin);
// console.log('statMax', statMax);
// draw((x, y) => {
// return gen.plates(x, y) - (gen.rivers(x, y))
// }, numberMap(-1, 1));
// draw(gen.rivers, numberMap(-1, 1));
// draw(gen.plates, numberMap(-1, 1));
class World {
voxels = null;
events = new EventEmitter();
w;
h;
emitCounter = 0;
constructor(w, h) {
this.w = w;
this.h = h;
this.voxels = [];
setTimeout(() => {
this.events.emit('task', 'initial formation');
for(x = 0; x < w; x ++) {
voxels[x] = [];
for(y = 0; y < h; y ++) {
voxels[x][y] = [];
}
}
}, 0)
}
emitTask(name) {
}
emitProgress(total, current) {
if((this.emitCounter % 100) === 0) {
this.events.emit('progress', (current + 1) / total);
}
this.emitCounter ++;
}
getTop(x, y) {
}
getVoxel() {
}
getHeight(x, y) {
return
}
}
class Voxel {
}
class Magma extends Voxel {
makeup;
constructor() {}
}
class Material {
}
// const world = new World();
// world.events.on('task', (taskName) => {
// })
console.log('generating image');
imageDraw((x, y) => {
gen.plates(x, y)
const color = '#' + .toString(16).padStart(2, '0').repeat(3);
// console.log(color);
return color;
});
console.log('writing image');
canvas.createPNGStream().pipe(createWriteStream('test.png'));
console.log('done');

444
src/noise.js 100644
View File

@ -0,0 +1,444 @@
"use strict";
/*
* A speed-improved simplex noise algorithm for 2D, 3D and 4D in JavaScript.
*
* Based on example code by Stefan Gustavson (stegu@itn.liu.se).
* Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).
* Better rank ordering method by Stefan Gustavson in 2012.
*
* This code was placed in the public domain by its original author,
* Stefan Gustavson. You may use it as you see fit, but
* attribution is appreciated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var FastSimplexNoise = /** @class */ (function () {
function FastSimplexNoise(options) {
if (options === void 0) { options = {}; }
if (options.hasOwnProperty('amplitude')) {
if (typeof options.amplitude !== 'number')
throw new Error('options.amplitude must be a number');
this.amplitude = options.amplitude;
}
else
this.amplitude = 1.0;
if (options.hasOwnProperty('frequency')) {
if (typeof options.frequency !== 'number')
throw new Error('options.frequency must be a number');
this.frequency = options.frequency;
}
else
this.frequency = 1.0;
if (options.hasOwnProperty('octaves')) {
if (typeof options.octaves !== 'number' ||
!isFinite(options.octaves) ||
Math.floor(options.octaves) !== options.octaves) {
throw new Error('options.octaves must be an integer');
}
this.octaves = options.octaves;
}
else
this.octaves = 1;
if (options.hasOwnProperty('persistence')) {
if (typeof options.persistence !== 'number')
throw new Error('options.persistence must be a number');
this.persistence = options.persistence;
}
else
this.persistence = 0.5;
if (options.hasOwnProperty('random')) {
if (typeof options.random !== 'function')
throw new Error('options.random must be a function');
this.random = options.random;
}
else
this.random = Math.random;
var min;
if (options.hasOwnProperty('min')) {
if (typeof options.min !== 'number')
throw new Error('options.min must be a number');
min = options.min;
}
else
min = -1;
var max;
if (options.hasOwnProperty('max')) {
if (typeof options.max !== 'number')
throw new Error('options.max must be a number');
max = options.max;
}
else
max = 1;
if (min >= max)
throw new Error("options.min (" + min + ") must be less than options.max (" + max + ")");
this.scale = min === -1 && max === 1
? function (value) { return value; }
: function (value) { return min + ((value + 1) / 2) * (max - min); };
var p = new Uint8Array(256);
for (var i = 0; i < 256; i++)
p[i] = i;
var n;
var q;
for (var i = 255; i > 0; i--) {
n = Math.floor((i + 1) * this.random());
q = p[i];
p[i] = p[n];
p[n] = q;
}
this.perm = new Uint8Array(512);
this.permMod12 = new Uint8Array(512);
for (var i = 0; i < 512; i++) {
this.perm[i] = p[i & 255];
this.permMod12[i] = this.perm[i] % 12;
}
}
FastSimplexNoise.prototype.cylindrical = function (circumference, coords) {
switch (coords.length) {
case 2: return this.cylindrical2D(circumference, coords[0], coords[1]);
case 3: return this.cylindrical3D(circumference, coords[0], coords[1], coords[2]);
default: return null;
}
};
FastSimplexNoise.prototype.cylindrical2D = function (circumference, x, y) {
var nx = x / circumference;
var r = circumference / (2 * Math.PI);
var rdx = nx * 2 * Math.PI;
var a = r * Math.sin(rdx);
var b = r * Math.cos(rdx);
return this.scaled3D(a, b, y);
};
FastSimplexNoise.prototype.cylindrical3D = function (circumference, x, y, z) {
var nx = x / circumference;
var r = circumference / (2 * Math.PI);
var rdx = nx * 2 * Math.PI;
var a = r * Math.sin(rdx);
var b = r * Math.cos(rdx);
return this.scaled4D(a, b, y, z);
};
FastSimplexNoise.prototype.dot = function (gs, coords) {
return gs
.slice(0, Math.min(gs.length, coords.length))
.reduce(function (total, g, i) { return total + (g * coords[i]); }, 0);
};
FastSimplexNoise.prototype.raw = function (coords) {
switch (coords.length) {
case 2: return this.raw2D(coords[0], coords[1]);
case 3: return this.raw3D(coords[0], coords[1], coords[2]);
case 4: return this.raw4D(coords[0], coords[1], coords[2], coords[3]);
default: return null;
}
};
FastSimplexNoise.prototype.raw2D = function (x, y) {
// Skew the input space to determine which simplex cell we're in
var s = (x + y) * 0.5 * (Math.sqrt(3.0) - 1.0); // Hairy factor for 2D
var i = Math.floor(x + s);
var j = Math.floor(y + s);
var t = (i + j) * FastSimplexNoise.G2;
var X0 = i - t; // Unskew the cell origin back to (x,y) space
var Y0 = j - t;
var x0 = x - X0; // The x,y distances from the cell origin
var y0 = y - Y0;
// Determine which simplex we are in.
var i1 = x0 > y0 ? 1 : 0;
var j1 = x0 > y0 ? 0 : 1;
// Offsets for corners
var x1 = x0 - i1 + FastSimplexNoise.G2;
var y1 = y0 - j1 + FastSimplexNoise.G2;
var x2 = x0 - 1.0 + 2.0 * FastSimplexNoise.G2;
var y2 = y0 - 1.0 + 2.0 * FastSimplexNoise.G2;
// Work out the hashed gradient indices of the three simplex corners
var ii = i & 255;
var jj = j & 255;
var gi0 = this.permMod12[ii + this.perm[jj]];
var gi1 = this.permMod12[ii + i1 + this.perm[jj + j1]];
var gi2 = this.permMod12[ii + 1 + this.perm[jj + 1]];
// Calculate the contribution from the three corners
var t0 = 0.5 - x0 * x0 - y0 * y0;
var n0 = t0 < 0 ? 0.0 : Math.pow(t0, 4) * this.dot(FastSimplexNoise.GRAD3D[gi0], [x0, y0]);
var t1 = 0.5 - x1 * x1 - y1 * y1;
var n1 = t1 < 0 ? 0.0 : Math.pow(t1, 4) * this.dot(FastSimplexNoise.GRAD3D[gi1], [x1, y1]);
var t2 = 0.5 - x2 * x2 - y2 * y2;
var n2 = t2 < 0 ? 0.0 : Math.pow(t2, 4) * this.dot(FastSimplexNoise.GRAD3D[gi2], [x2, y2]);
// Add contributions from each corner to get the final noise value.
// The result is scaled to return values in the interval [-1, 1]
return 70.14805770653952 * (n0 + n1 + n2);
};
FastSimplexNoise.prototype.raw3D = function (x, y, z) {
// Skew the input space to determine which simplex cell we're in
var s = (x + y + z) / 3.0; // Very nice and simple skew factor for 3D
var i = Math.floor(x + s);
var j = Math.floor(y + s);
var k = Math.floor(z + s);
var t = (i + j + k) * FastSimplexNoise.G3;
var X0 = i - t; // Unskew the cell origin back to (x,y,z) space
var Y0 = j - t;
var Z0 = k - t;
var x0 = x - X0; // The x,y,z distances from the cell origin
var y0 = y - Y0;
var z0 = z - Z0;
// Deterine which simplex we are in
var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords
var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords
if (x0 >= y0) {
if (y0 >= z0) {
i1 = i2 = j2 = 1;
j1 = k1 = k2 = 0;
}
else if (x0 >= z0) {
i1 = i2 = k2 = 1;
j1 = k1 = j2 = 0;
}
else {
k1 = i2 = k2 = 1;
i1 = j1 = j2 = 0;
}
}
else {
if (y0 < z0) {
k1 = j2 = k2 = 1;
i1 = j1 = i2 = 0;
}
else if (x0 < z0) {
j1 = j2 = k2 = 1;
i1 = k1 = i2 = 0;
}
else {
j1 = i2 = j2 = 1;
i1 = k1 = k2 = 0;
}
}
var x1 = x0 - i1 + FastSimplexNoise.G3; // Offsets for second corner in (x,y,z) coords
var y1 = y0 - j1 + FastSimplexNoise.G3;
var z1 = z0 - k1 + FastSimplexNoise.G3;
var x2 = x0 - i2 + 2.0 * FastSimplexNoise.G3; // Offsets for third corner in (x,y,z) coords
var y2 = y0 - j2 + 2.0 * FastSimplexNoise.G3;
var z2 = z0 - k2 + 2.0 * FastSimplexNoise.G3;
var x3 = x0 - 1.0 + 3.0 * FastSimplexNoise.G3; // Offsets for last corner in (x,y,z) coords
var y3 = y0 - 1.0 + 3.0 * FastSimplexNoise.G3;
var z3 = z0 - 1.0 + 3.0 * FastSimplexNoise.G3;
// Work out the hashed gradient indices of the four simplex corners
var ii = i & 255;
var jj = j & 255;
var kk = k & 255;
var gi0 = this.permMod12[ii + this.perm[jj + this.perm[kk]]];
var gi1 = this.permMod12[ii + i1 + this.perm[jj + j1 + this.perm[kk + k1]]];
var gi2 = this.permMod12[ii + i2 + this.perm[jj + j2 + this.perm[kk + k2]]];
var gi3 = this.permMod12[ii + 1 + this.perm[jj + 1 + this.perm[kk + 1]]];
// Calculate the contribution from the four corners
var t0 = 0.5 - x0 * x0 - y0 * y0 - z0 * z0;
var n0 = t0 < 0 ? 0.0 : Math.pow(t0, 4) * this.dot(FastSimplexNoise.GRAD3D[gi0], [x0, y0, z0]);
var t1 = 0.5 - x1 * x1 - y1 * y1 - z1 * z1;
var n1 = t1 < 0 ? 0.0 : Math.pow(t1, 4) * this.dot(FastSimplexNoise.GRAD3D[gi1], [x1, y1, z1]);
var t2 = 0.5 - x2 * x2 - y2 * y2 - z2 * z2;
var n2 = t2 < 0 ? 0.0 : Math.pow(t2, 4) * this.dot(FastSimplexNoise.GRAD3D[gi2], [x2, y2, z2]);
var t3 = 0.5 - x3 * x3 - y3 * y3 - z3 * z3;
var n3 = t3 < 0 ? 0.0 : Math.pow(t3, 4) * this.dot(FastSimplexNoise.GRAD3D[gi3], [x3, y3, z3]);
// Add contributions from each corner to get the final noise value.
// The result is scaled to stay just inside [-1,1]
return 94.68493150681972 * (n0 + n1 + n2 + n3);
};
FastSimplexNoise.prototype.raw4D = function (x, y, z, w) {
// Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in
var s = (x + y + z + w) * (Math.sqrt(5.0) - 1.0) / 4.0; // Factor for 4D skewing
var i = Math.floor(x + s);
var j = Math.floor(y + s);
var k = Math.floor(z + s);
var l = Math.floor(w + s);
var t = (i + j + k + l) * FastSimplexNoise.G4; // Factor for 4D unskewing
var X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space
var Y0 = j - t;
var Z0 = k - t;
var W0 = l - t;
var x0 = x - X0; // The x,y,z,w distances from the cell origin
var y0 = y - Y0;
var z0 = z - Z0;
var w0 = w - W0;
// To find out which of the 24 possible simplices we're in, we need to determine the magnitude ordering of x0, y0,
// z0 and w0. Six pair-wise comparisons are performed between each possible pair of the four coordinates, and the
// results are used to rank the numbers.
var rankx = 0;
var ranky = 0;
var rankz = 0;
var rankw = 0;
if (x0 > y0)
rankx++;
else
ranky++;
if (x0 > z0)
rankx++;
else
rankz++;
if (x0 > w0)
rankx++;
else
rankw++;
if (y0 > z0)
ranky++;
else
rankz++;
if (y0 > w0)
ranky++;
else
rankw++;
if (z0 > w0)
rankz++;
else
rankw++;
// simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.
// Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w
// impossible. Only the 24 indices which have non-zero entries make any sense.
// We use a thresholding to set the coordinates in turn from the largest magnitude.
// Rank 3 denotes the largest coordinate.
var i1 = rankx >= 3 ? 1 : 0;
var j1 = ranky >= 3 ? 1 : 0;
var k1 = rankz >= 3 ? 1 : 0;
var l1 = rankw >= 3 ? 1 : 0;
// Rank 2 denotes the second largest coordinate.
var i2 = rankx >= 2 ? 1 : 0;
var j2 = ranky >= 2 ? 1 : 0;
var k2 = rankz >= 2 ? 1 : 0;
var l2 = rankw >= 2 ? 1 : 0;
// Rank 1 denotes the second smallest coordinate.
var i3 = rankx >= 1 ? 1 : 0;
var j3 = ranky >= 1 ? 1 : 0;
var k3 = rankz >= 1 ? 1 : 0;
var l3 = rankw >= 1 ? 1 : 0;
// The fifth corner has all coordinate offsets = 1, so no need to compute that.
var x1 = x0 - i1 + FastSimplexNoise.G4; // Offsets for second corner in (x,y,z,w) coords
var y1 = y0 - j1 + FastSimplexNoise.G4;
var z1 = z0 - k1 + FastSimplexNoise.G4;
var w1 = w0 - l1 + FastSimplexNoise.G4;
var x2 = x0 - i2 + 2.0 * FastSimplexNoise.G4; // Offsets for third corner in (x,y,z,w) coords
var y2 = y0 - j2 + 2.0 * FastSimplexNoise.G4;
var z2 = z0 - k2 + 2.0 * FastSimplexNoise.G4;
var w2 = w0 - l2 + 2.0 * FastSimplexNoise.G4;
var x3 = x0 - i3 + 3.0 * FastSimplexNoise.G4; // Offsets for fourth corner in (x,y,z,w) coords
var y3 = y0 - j3 + 3.0 * FastSimplexNoise.G4;
var z3 = z0 - k3 + 3.0 * FastSimplexNoise.G4;
var w3 = w0 - l3 + 3.0 * FastSimplexNoise.G4;
var x4 = x0 - 1.0 + 4.0 * FastSimplexNoise.G4; // Offsets for last corner in (x,y,z,w) coords
var y4 = y0 - 1.0 + 4.0 * FastSimplexNoise.G4;
var z4 = z0 - 1.0 + 4.0 * FastSimplexNoise.G4;
var w4 = w0 - 1.0 + 4.0 * FastSimplexNoise.G4;
// Work out the hashed gradient indices of the five simplex corners
var ii = i & 255;
var jj = j & 255;
var kk = k & 255;
var ll = l & 255;
var gi0 = this.perm[ii + this.perm[jj + this.perm[kk + this.perm[ll]]]] % 32;
var gi1 = this.perm[ii + i1 + this.perm[jj + j1 + this.perm[kk + k1 + this.perm[ll + l1]]]] % 32;
var gi2 = this.perm[ii + i2 + this.perm[jj + j2 + this.perm[kk + k2 + this.perm[ll + l2]]]] % 32;
var gi3 = this.perm[ii + i3 + this.perm[jj + j3 + this.perm[kk + k3 + this.perm[ll + l3]]]] % 32;
var gi4 = this.perm[ii + 1 + this.perm[jj + 1 + this.perm[kk + 1 + this.perm[ll + 1]]]] % 32;
// Calculate the contribution from the five corners
var t0 = 0.5 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;
var n0 = t0 < 0 ? 0.0 : Math.pow(t0, 4) * this.dot(FastSimplexNoise.GRAD4D[gi0], [x0, y0, z0, w0]);
var t1 = 0.5 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;
var n1 = t1 < 0 ? 0.0 : Math.pow(t1, 4) * this.dot(FastSimplexNoise.GRAD4D[gi1], [x1, y1, z1, w1]);
var t2 = 0.5 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;
var n2 = t2 < 0 ? 0.0 : Math.pow(t2, 4) * this.dot(FastSimplexNoise.GRAD4D[gi2], [x2, y2, z2, w2]);
var t3 = 0.5 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;
var n3 = t3 < 0 ? 0.0 : Math.pow(t3, 4) * this.dot(FastSimplexNoise.GRAD4D[gi3], [x3, y3, z3, w3]);
var t4 = 0.5 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;
var n4 = t4 < 0 ? 0.0 : Math.pow(t4, 4) * this.dot(FastSimplexNoise.GRAD4D[gi4], [x4, y4, z4, w4]);
// Sum up and scale the result to cover the range [-1,1]
return 72.37855765153665 * (n0 + n1 + n2 + n3 + n4);
};
FastSimplexNoise.prototype.scaled = function (coords) {
switch (coords.length) {
case 2: return this.scaled2D(coords[0], coords[1]);
case 3: return this.scaled3D(coords[0], coords[1], coords[2]);
case 4: return this.scaled4D(coords[0], coords[1], coords[2], coords[3]);
default: return null;
}
};
FastSimplexNoise.prototype.scaled2D = function (x, y) {
var amplitude = this.amplitude;
var frequency = this.frequency;
var maxAmplitude = 0;
var noise = 0;
for (var i = 0; i < this.octaves; i++) {
noise += this.raw2D(x * frequency, y * frequency) * amplitude;
maxAmplitude += amplitude;
amplitude *= this.persistence;
frequency *= 2;
}
return this.scale(noise / maxAmplitude);
};
FastSimplexNoise.prototype.scaled3D = function (x, y, z) {
var amplitude = this.amplitude;
var frequency = this.frequency;
var maxAmplitude = 0;
var noise = 0;
for (var i = 0; i < this.octaves; i++) {
noise += this.raw3D(x * frequency, y * frequency, z * frequency) * amplitude;
maxAmplitude += amplitude;
amplitude *= this.persistence;
frequency *= 2;
}
return this.scale(noise / maxAmplitude);
};
FastSimplexNoise.prototype.scaled4D = function (x, y, z, w) {
var amplitude = this.amplitude;
var frequency = this.frequency;
var maxAmplitude = 0;
var noise = 0;
for (var i = 0; i < this.octaves; i++) {
noise += this.raw4D(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
maxAmplitude += amplitude;
amplitude *= this.persistence;
frequency *= 2;
}
return this.scale(noise / maxAmplitude);
};
FastSimplexNoise.prototype.spherical = function (circumference, coords) {
switch (coords.length) {
case 3: return this.spherical3D(circumference, coords[0], coords[1], coords[2]);
case 2: return this.spherical2D(circumference, coords[0], coords[1]);
default: return null;
}
};
FastSimplexNoise.prototype.spherical2D = function (circumference, x, y) {
var nx = x / circumference;
var ny = y / circumference;
var rdx = nx * 2 * Math.PI;
var rdy = ny * Math.PI;
var sinY = Math.sin(rdy + Math.PI);
var sinRds = 2 * Math.PI;
var a = sinRds * Math.sin(rdx) * sinY;
var b = sinRds * Math.cos(rdx) * sinY;
var d = sinRds * Math.cos(rdy);
return this.scaled3D(a, b, d);
};
FastSimplexNoise.prototype.spherical3D = function (circumference, x, y, z) {
var nx = x / circumference;
var ny = y / circumference;
var rdx = nx * 2 * Math.PI;
var rdy = ny * Math.PI;
var sinY = Math.sin(rdy + Math.PI);
var sinRds = 2 * Math.PI;
var a = sinRds * Math.sin(rdx) * sinY;
var b = sinRds * Math.cos(rdx) * sinY;
var d = sinRds * Math.cos(rdy);
return this.scaled4D(a, b, d, z);
};
FastSimplexNoise.G2 = (3.0 - Math.sqrt(3.0)) / 6.0;
FastSimplexNoise.G3 = 1.0 / 6.0;
FastSimplexNoise.G4 = (5.0 - Math.sqrt(5.0)) / 20.0;
FastSimplexNoise.GRAD3D = [
[1, 1, 0], [-1, 1, 0], [1, -1, 0], [-1, -1, 0],
[1, 0, 1], [-1, 0, 1], [1, 0, -1], [-1, 0, -1],
[0, 1, 1], [0, -1, -1], [0, 1, -1], [0, -1, -1]
];
FastSimplexNoise.GRAD4D = [
[0, 1, 1, 1], [0, 1, 1, -1], [0, 1, -1, 1], [0, 1, -1, -1],
[0, -1, 1, 1], [0, -1, 1, -1], [0, -1, -1, 1], [0, -1, -1, -1],
[1, 0, 1, 1], [1, 0, 1, -1], [1, 0, -1, 1], [1, 0, -1, -1],
[-1, 0, 1, 1], [-1, 0, 1, -1], [-1, 0, -1, 1], [-1, 0, -1, -1],
[1, 1, 0, 1], [1, 1, 0, -1], [1, -1, 0, 1], [1, -1, 0, -1],
[-1, 1, 0, 1], [-1, 1, 0, -1], [-1, -1, 0, 1], [-1, -1, 0, -1],
[1, 1, 1, 0], [1, 1, -1, 0], [1, -1, 1, 0], [1, -1, -1, 0],
[-1, 1, 1, 0], [-1, 1, -1, 0], [-1, -1, 1, 0], [-1, -1, -1, 0]
];
return FastSimplexNoise;
}());
exports.default = FastSimplexNoise;

585
yarn.lock 100644
View File

@ -0,0 +1,585 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@mapbox/node-pre-gyp@^1.0.0":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz#2a0b32fcb416fb3f2250fd24cb2a81421a4f5950"
dependencies:
detect-libc "^1.0.3"
https-proxy-agent "^5.0.0"
make-dir "^3.1.0"
node-fetch "^2.6.1"
nopt "^5.0.0"
npmlog "^4.1.2"
rimraf "^3.0.2"
semver "^7.3.4"
tar "^6.1.0"
"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz"
abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
agent-base@6:
version "6.0.2"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
dependencies:
debug "4"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
dependencies:
color-convert "^1.9.0"
ansi-styles@^4.1.0:
version "4.2.1"
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz"
dependencies:
"@types/color-name" "^1.1.1"
color-convert "^2.0.1"
aproba@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
are-we-there-yet@~1.1.2:
version "1.1.5"
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
dependencies:
delegates "^1.0.0"
readable-stream "^2.0.6"
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
canvas@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.8.0.tgz#f99ca7f25e6e26686661ffa4fec1239bbef74461"
dependencies:
"@mapbox/node-pre-gyp" "^1.0.0"
nan "^2.14.0"
simple-get "^3.0.3"
chalk@^2.3.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chalk@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz"
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chownr@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
color-convert@^1.9.0, color-convert@^1.9.1:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
dependencies:
color-name "1.1.3"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
dependencies:
color-name "~1.1.4"
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
color-name@^1.0.0, color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
color-string@^1.5.4:
version "1.5.5"
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014"
dependencies:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e"
dependencies:
color-convert "^1.9.1"
color-string "^1.5.4"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
debug@4:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
dependencies:
ms "2.1.2"
decompress-response@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986"
dependencies:
mimic-response "^2.0.0"
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
error-ex@^1.3.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
dependencies:
is-arrayish "^0.2.1"
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
fast-simplex-noise@^3.2.1:
version "3.2.1"
resolved "https://registry.npmjs.org/fast-simplex-noise/-/fast-simplex-noise-3.2.1.tgz"
figures@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
dependencies:
escape-string-regexp "^1.0.5"
find-up@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
dependencies:
locate-path "^2.0.0"
fs-minipass@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
dependencies:
minipass "^3.0.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
gauge@~2.7.3:
version "2.7.4"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
dependencies:
aproba "^1.0.3"
console-control-strings "^1.0.0"
has-unicode "^2.0.0"
object-assign "^4.1.0"
signal-exit "^3.0.0"
string-width "^1.0.1"
strip-ansi "^3.0.1"
wide-align "^1.1.0"
glob@^7.1.3:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.2:
version "4.2.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
https-proxy-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2"
dependencies:
agent-base "6"
debug "4"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
is-arrayish@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03"
is-fullwidth-code-point@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
dependencies:
number-is-nan "^1.0.0"
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
json-parse-better-errors@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
load-json-file@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
dependencies:
graceful-fs "^4.1.2"
parse-json "^4.0.0"
pify "^3.0.0"
strip-bom "^3.0.0"
locate-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
dependencies:
p-locate "^2.0.0"
path-exists "^3.0.0"
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
dependencies:
yallist "^4.0.0"
make-dir@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
dependencies:
semver "^6.0.0"
mimic-response@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minipass@^3.0.0:
version "3.1.3"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd"
dependencies:
yallist "^4.0.0"
minizlib@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
dependencies:
minipass "^3.0.0"
yallist "^4.0.0"
mkdirp@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
nan@^2.14.0:
version "2.14.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
node-fetch@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
nopt@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88"
dependencies:
abbrev "1"
npmlog@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
dependencies:
are-we-there-yet "~1.1.2"
console-control-strings "~1.1.0"
gauge "~2.7.3"
set-blocking "~2.0.0"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
object-assign@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
once@^1.3.0, once@^1.3.1:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
p-limit@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
dependencies:
p-try "^1.0.0"
p-locate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
dependencies:
p-limit "^1.1.0"
p-try@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
parse-json@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
dependencies:
error-ex "^1.3.1"
json-parse-better-errors "^1.0.1"
path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
pify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
pkg-conf@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058"
dependencies:
find-up "^2.0.0"
load-json-file "^4.0.0"
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
readable-stream@^2.0.6:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
dependencies:
glob "^7.1.3"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
seedrandom@^3.0.5:
version "3.0.5"
resolved "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz"
semver@^6.0.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
semver@^7.3.4:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
dependencies:
lru-cache "^6.0.0"
set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
signal-exit@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
signale@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/signale/-/signale-1.4.0.tgz#c4be58302fb0262ac00fc3d886a7c113759042f1"
dependencies:
chalk "^2.3.2"
figures "^2.0.0"
pkg-conf "^2.1.0"
simple-concat@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f"
simple-get@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3"
dependencies:
decompress-response "^4.2.0"
once "^1.3.1"
simple-concat "^1.0.0"
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
dependencies:
is-arrayish "^0.3.1"
simplex-noise@^2.4.0:
version "2.4.0"
resolved "https://registry.npmjs.org/simplex-noise/-/simplex-noise-2.4.0.tgz"
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"
"string-width@^1.0.2 || 2":
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
dependencies:
safe-buffer "~5.1.0"
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
dependencies:
ansi-regex "^3.0.0"
strip-bom@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
dependencies:
has-flag "^3.0.0"
supports-color@^7.1.0:
version "7.1.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz"
dependencies:
has-flag "^4.0.0"
tar@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83"
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
minipass "^3.0.0"
minizlib "^2.1.1"
mkdirp "^1.0.3"
yallist "^4.0.0"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
wide-align@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
dependencies:
string-width "^1.0.2 || 2"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"