toosoon-prng 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/prng.js CHANGED
@@ -6,27 +6,25 @@ import { AlgorithmName } from './types';
6
6
  * @class PRNG
7
7
  * @exports
8
8
  */
9
- var PRNG = /** @class */ (function () {
10
- function PRNG() {
11
- this.seed = '';
12
- this.algorithm = splitmix32;
13
- }
9
+ export class PRNG {
10
+ seed = '';
11
+ algorithm = splitmix32;
14
12
  /**
15
13
  * Set this PRNG seed
16
14
  *
17
15
  * @param {string} seed
18
16
  */
19
- PRNG.prototype.setSeed = function (seed) {
17
+ setSeed(seed) {
20
18
  this.seed = seed;
21
- };
19
+ }
22
20
  /**
23
21
  * Set this PRNG algorithm
24
22
  *
25
23
  * @param {AlgorithmName} algorithmName Algorithm name
26
24
  */
27
- PRNG.prototype.setAlgorithm = function (algorithmName) {
25
+ setAlgorithm(algorithmName) {
28
26
  this.algorithm = this.getAlgorithmByName(algorithmName);
29
- };
27
+ }
30
28
  /**
31
29
  * Generate a pseudo-random number in the interval [0, 1]
32
30
  * PRNG equivalent of `Math.random()`
@@ -34,10 +32,10 @@ var PRNG = /** @class */ (function () {
34
32
  * @param {string} seed
35
33
  * @returns {number}
36
34
  */
37
- PRNG.prototype.random = function (seed) {
38
- var hashes = cyrb128(this.seed + seed);
39
- return this.algorithm.apply(this, hashes);
40
- };
35
+ random(seed) {
36
+ const hashes = cyrb128(this.seed + seed);
37
+ return this.algorithm(...hashes);
38
+ }
41
39
  /**
42
40
  * Generate a pseudo-random boolean (true or false)
43
41
  *
@@ -45,10 +43,9 @@ var PRNG = /** @class */ (function () {
45
43
  * @param {number} [probability=0.5] Probability to get `true`
46
44
  * @returns {boolean} Either `true` or `false`
47
45
  */
48
- PRNG.prototype.randomBoolean = function (seed, probability) {
49
- if (probability === void 0) { probability = 0.5; }
46
+ randomBoolean(seed, probability = 0.5) {
50
47
  return this.random(seed) < probability;
51
- };
48
+ }
52
49
  /**
53
50
  * Generate a pseudo-random sign (1 or -1)
54
51
  *
@@ -56,10 +53,9 @@ var PRNG = /** @class */ (function () {
56
53
  * @param {number} [probability=0.5] Probability to get 1
57
54
  * @returns {number} Either 1 or -1
58
55
  */
59
- PRNG.prototype.randomSign = function (seed, probability) {
60
- if (probability === void 0) { probability = 0.5; }
56
+ randomSign(seed, probability = 0.5) {
61
57
  return this.randomBoolean(seed, probability) ? 1 : -1;
62
- };
58
+ }
63
59
  /**
64
60
  * Generate a pseudo-random floating-point number within a specified range
65
61
  *
@@ -69,12 +65,9 @@ var PRNG = /** @class */ (function () {
69
65
  * @param {number} [precision=2] Number of digits after the decimal point
70
66
  * @returns {number} Generated float
71
67
  */
72
- PRNG.prototype.randomFloat = function (seed, min, max, precision) {
73
- if (min === void 0) { min = 0; }
74
- if (max === void 0) { max = 1; }
75
- if (precision === void 0) { precision = 2; }
68
+ randomFloat(seed, min = 0, max = 1, precision = 2) {
76
69
  return parseFloat(Math.min(min + this.random(seed) * (max - min), max).toFixed(precision));
77
- };
70
+ }
78
71
  /**
79
72
  * Generate a pseudo-random integer number within a specified range
80
73
  *
@@ -83,18 +76,18 @@ var PRNG = /** @class */ (function () {
83
76
  * @param {number} max Maximum boundary
84
77
  * @returns {number} Generated integer
85
78
  */
86
- PRNG.prototype.randomInt = function (seed, min, max) {
79
+ randomInt(seed, min, max) {
87
80
  return Math.floor(this.random(seed) * (max - min + 1) + min);
88
- };
81
+ }
89
82
  /**
90
83
  * Generate a pseudo-random hexadecimal color
91
84
  *
92
85
  * @param {string} seed
93
86
  * @returns {string} Generated hexadecimal color
94
87
  */
95
- PRNG.prototype.randomHexColor = function (seed) {
88
+ randomHexColor(seed) {
96
89
  return '#' + ('00000' + ((this.random(seed) * (1 << 24)) | 0).toString(16)).slice(-6);
97
- };
90
+ }
98
91
  /**
99
92
  * Pick a pseudo-random item from a given array
100
93
  *
@@ -102,11 +95,11 @@ var PRNG = /** @class */ (function () {
102
95
  * @param {T[]} array Array to pick the item from
103
96
  * @returns {T|undefined} Random item picked
104
97
  */
105
- PRNG.prototype.randomItem = function (seed, array) {
98
+ randomItem(seed, array) {
106
99
  if (array.length === 0)
107
100
  return undefined;
108
101
  return array[this.randomInt(seed, 0, array.length - 1)];
109
- };
102
+ }
110
103
  /**
111
104
  * Pick a pseudo-random property value from a given object
112
105
  *
@@ -114,13 +107,13 @@ var PRNG = /** @class */ (function () {
114
107
  * @param {object} object Object to pick the property from
115
108
  * @returns {T|undefined} Random item picked
116
109
  */
117
- PRNG.prototype.randomObjectProperty = function (seed, object) {
118
- var keys = Object.keys(object);
119
- var key = this.randomItem(seed, keys);
110
+ randomObjectProperty(seed, object) {
111
+ const keys = Object.keys(object);
112
+ const key = this.randomItem(seed, keys);
120
113
  if (key && object.hasOwnProperty(key)) {
121
114
  return object[key];
122
115
  }
123
- };
116
+ }
124
117
  /**
125
118
  * Select a pseudo-random index from an array of weighted items
126
119
  *
@@ -128,24 +121,23 @@ var PRNG = /** @class */ (function () {
128
121
  * @param {number[]} weights Array of weights
129
122
  * @returns {number} Random index based on weights
130
123
  */
131
- PRNG.prototype.randomIndex = function (seed, weights) {
124
+ randomIndex(seed, weights) {
132
125
  if (weights.length === 0)
133
126
  return -1;
134
- var totalWeight = 0;
135
- for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) {
136
- var weight_1 = weights_1[_i];
137
- totalWeight += weight_1;
127
+ let totalWeight = 0;
128
+ for (let weight of weights) {
129
+ totalWeight += weight;
138
130
  }
139
131
  if (totalWeight <= 0)
140
132
  console.warn('PRNG.randomIndex()', 'Weights must sum to > 0', totalWeight);
141
- var weight = this.random(seed) * totalWeight;
142
- for (var i = 0; i < weights.length; i++) {
133
+ let weight = this.random(seed) * totalWeight;
134
+ for (let i = 0; i < weights.length; i++) {
143
135
  if (weight < weights[i])
144
136
  return i;
145
137
  weight -= weights[i];
146
138
  }
147
139
  return 0;
148
- };
140
+ }
149
141
  /**
150
142
  * Generate a pseudo-random number fitting a Gaussian (normal) distribution
151
143
  *
@@ -154,22 +146,20 @@ var PRNG = /** @class */ (function () {
154
146
  * @param {number} [spread=1] Standard deviation
155
147
  * @returns Generated number
156
148
  */
157
- PRNG.prototype.randomGaussian = function (seed, mean, spread) {
158
- if (mean === void 0) { mean = 0; }
159
- if (spread === void 0) { spread = 1; }
160
- var hashes = cyrb128(this.seed + seed);
161
- var u = this.algorithm.apply(this, hashes);
162
- var v = this.algorithm.apply(this, hashes.reverse());
163
- var z = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
149
+ randomGaussian(seed, mean = 0, spread = 1) {
150
+ const hashes = cyrb128(this.seed + seed);
151
+ const u = this.algorithm(...hashes);
152
+ const v = this.algorithm(...hashes.reverse());
153
+ const z = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
164
154
  return mean + z * spread;
165
- };
155
+ }
166
156
  /**
167
157
  * Get the PRNG algorithm function by its name
168
158
  *
169
159
  * @param {AlgorithmName} algorithmName Algorithm name
170
160
  * @returns {Function} PRNG algorithm function
171
161
  */
172
- PRNG.prototype.getAlgorithmByName = function (algorithmName) {
162
+ getAlgorithmByName(algorithmName) {
173
163
  switch (algorithmName) {
174
164
  case AlgorithmName.jsf32:
175
165
  return jsf32;
@@ -182,9 +172,7 @@ var PRNG = /** @class */ (function () {
182
172
  case AlgorithmName.xoshiro128ss:
183
173
  return xoshiro128ss;
184
174
  }
185
- };
186
- return PRNG;
187
- }());
188
- export { PRNG };
189
- var prng = new PRNG();
175
+ }
176
+ }
177
+ const prng = new PRNG();
190
178
  export default prng;
@@ -1 +1 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.esnext.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../node_modules/typescript/lib/lib.esnext.promise.d.ts","../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../node_modules/typescript/lib/lib.esnext.object.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/toosoon-utils/lib/prng.d.ts","../src/types.ts","../src/prng.ts","../src/index.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"3244739232ed0f77eb4aa4cd9af4feddcf5c3eabdf4f6c3388a5a75569935adb",{"version":"1080703238475ef8ae349a6573364784b530e85937fce63754c30204944f3633","signature":"4cb1f41b9212d2152ce32b4383fa494101c25b12b8f290ed43f5359670458471"},{"version":"ec50a3a90cc1e767395a32fcefab7736a4285e1988d855587bbc77d3f1d9b25c","signature":"afc5a13e0b5c667cf0bb3182fbeb055990f90e2424a8ae2592bbbb345cfc515d"},{"version":"e4035c130e9e1e9c9462141cf3af38879f74d9653e70c7585e0cec14a3fee8a4","signature":"f9ca5cc1b894f1a19cbb55135cbfa308ad994ef06e1412e04ff1796272a93b89"}],"root":[[70,72]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"declaration":true,"module":5,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","skipLibCheck":true,"strict":true,"target":1},"fileIdsList":[[70,71],[69,70],[70]],"referencedMap":[[72,1],[71,2]],"exportedModulesMap":[[72,1],[71,3]],"semanticDiagnosticsPerFile":[69,67,68,12,14,13,2,15,16,17,18,19,20,21,22,3,23,4,24,28,25,26,27,29,30,31,5,32,33,34,35,6,39,36,37,38,40,7,41,46,47,42,43,44,45,8,51,48,49,50,52,9,53,54,55,58,56,57,59,60,10,1,61,11,65,63,62,66,64,72,71,70]},"version":"5.4.2"}
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.esnext.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../node_modules/typescript/lib/lib.esnext.promise.d.ts","../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../node_modules/typescript/lib/lib.esnext.object.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/toosoon-utils/lib/prng.d.ts","../src/types.ts","../src/prng.ts","../src/index.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"3244739232ed0f77eb4aa4cd9af4feddcf5c3eabdf4f6c3388a5a75569935adb",{"version":"1080703238475ef8ae349a6573364784b530e85937fce63754c30204944f3633","signature":"4cb1f41b9212d2152ce32b4383fa494101c25b12b8f290ed43f5359670458471"},{"version":"ec50a3a90cc1e767395a32fcefab7736a4285e1988d855587bbc77d3f1d9b25c","signature":"afc5a13e0b5c667cf0bb3182fbeb055990f90e2424a8ae2592bbbb345cfc515d"},{"version":"e4035c130e9e1e9c9462141cf3af38879f74d9653e70c7585e0cec14a3fee8a4","signature":"f9ca5cc1b894f1a19cbb55135cbfa308ad994ef06e1412e04ff1796272a93b89"}],"root":[[71,73]],"options":{"allowJs":true,"checkJs":true,"declaration":true,"module":99,"outDir":"./","skipLibCheck":true,"strict":true,"target":99},"fileIdsList":[[71,72],[70,71],[71]],"referencedMap":[[73,1],[72,2]],"exportedModulesMap":[[73,1],[72,3]],"semanticDiagnosticsPerFile":[70,68,69,12,13,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,11,66,64,63,67,65,73,72,71]},"version":"5.4.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toosoon-prng",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "This project provides PRNG functions for generating pseudo-random values using a seed-based approach and various algorithms",
5
5
  "type": "module",
6
6
  "engines": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/toosoon-dev/toosoon-prng#readme",
34
34
  "dependencies": {
35
- "toosoon-utils": "^4.0.0"
35
+ "toosoon-utils": "latest"
36
36
  },
37
37
  "devDependencies": {
38
38
  "typescript": "^5.4.2"
package/tsconfig.json CHANGED
@@ -3,22 +3,26 @@
3
3
  "exclude": ["node_modules"],
4
4
  "compilerOptions": {
5
5
  "baseUrl": ".",
6
+
6
7
  "outDir": "lib",
7
- "target": "ES5",
8
- "module": "ES2015",
9
- "moduleResolution": "bundler",
10
- "lib": ["DOM", "ESNext"],
11
- "allowJs": true,
12
- "allowSyntheticDefaultImports": true,
13
- "checkJs": true,
8
+
9
+ "target": "ESNext",
10
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
11
+ "skipLibCheck": true,
14
12
  "declaration": true,
15
- "forceConsistentCasingInFileNames": true,
16
- "isolatedModules": true,
17
13
  "incremental": true,
18
- "noUnusedParameters": true,
19
- "noUnusedLocals": true,
14
+
15
+ /* Bundler mode */
16
+ "module": "ESNext",
17
+ "moduleResolution": "bundler",
18
+ "moduleDetection": "force",
19
+ "isolatedModules": true,
20
20
  "resolveJsonModule": true,
21
- "skipLibCheck": true,
22
- "strict": true
21
+
22
+ /* Linting */
23
+ "strict": true,
24
+ "allowJs": true,
25
+ "checkJs": true,
26
+ "forceConsistentCasingInFileNames": true
23
27
  }
24
28
  }