Skip to content

Commit d1003b8

Browse files
committed
Update examples to use const
1 parent a0707fc commit d1003b8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ By default simplex-noise.js will use Math.random() to seed the noise.
1919
```javascript
2020
// initializing a new simplex instance
2121
// do this only once as it is relatively expensive
22-
var simplex = new SimplexNoise(),
22+
const simplex = new SimplexNoise(),
2323
value2d = simplex.noise2D(x, y),
2424
value3d = simplex.noise3D(x, y, z),
2525
value4d = simplex.noise4D(x, y, z, w);
@@ -28,7 +28,7 @@ var simplex = new SimplexNoise(),
2828
You can also pass in a seed string which will then be used to initialize
2929
the noise using the built in alea PRNG.
3030
```javascript
31-
var simplex = new SimplexNoise('seed'),
31+
const simplex = new SimplexNoise('seed'),
3232
value2d = simplex.noise2D(x, y),
3333
sameSeed = new SimplexNoise('seed'),
3434
differentSeed = new SimplexNoise('different seed');
@@ -42,7 +42,7 @@ used to build the permutation table.
4242
This can be used with a custom pseudo random number generator:
4343

4444
```javascript
45-
var random = new Alea(seed),
45+
const random = new Alea(seed),
4646
simplex = new SimplexNoise(random),
4747
value2d = simplex.noise2D(x, y);
4848
```
@@ -54,7 +54,7 @@ The ALEA PRNG can be found on in the npm package [alea](https://npmjs.org/packag
5454
Node.js is also supported, you can install the package using [npm](https://npmjs.org/package/simplex-noise).
5555

5656
```javascript
57-
var SimplexNoise = require('simplex-noise'),
57+
const SimplexNoise = require('simplex-noise'),
5858
simplex = new SimplexNoise(Math.random),
5959
value2d = simplex.noise2D(x, y);
6060
```
@@ -77,6 +77,10 @@ npm install && npm test
7777

7878
## Changelog
7979

80+
### main
81+
- Dependency update
82+
- Setting sideEffects: false in package.json
83+
8084
### 2.4.0
8185
- Included a PRNG based on ALEA to directly allow seeding
8286
- Included typescript definitions

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"homepage": "https://github.com/jwagner/simplex-noise.js",
66
"author": "Jonas Wagner <[email protected]> (http://29a.ch/)",
77
"main": "./simplex-noise",
8+
"sideEffects": false,
89
"files": [
910
"simplex-noise.js"
1011
],
@@ -42,4 +43,4 @@
4243
"test": "eslint simplex-noise.js && mocha",
4344
"benchmark": "node ./perf/benchmark.js"
4445
}
45-
}
46+
}

0 commit comments

Comments
 (0)