@artilleryio/int-core 2.3.0-1c936ad → 2.3.0-a0b6328

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.
Files changed (2) hide show
  1. package/lib/runner.js +11 -2
  2. package/package.json +2 -2
package/lib/runner.js CHANGED
@@ -471,8 +471,17 @@ function $randomNumber(min, max) {
471
471
  return _.random(min, max);
472
472
  }
473
473
 
474
- function $randomString(length) {
475
- return Math.random().toString(36).substr(2, length);
474
+ function $randomString(length = 10) {
475
+ let s = '';
476
+ const alphabet =
477
+ 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
478
+ const alphabetLength = alphabet.length;
479
+
480
+ while (s.length < length) {
481
+ s += alphabet.charAt((Math.random() * alphabetLength) | 0);
482
+ }
483
+
484
+ return s;
476
485
  }
477
486
 
478
487
  function handleScriptHook(hook, script, hookEvents, contextVars = {}) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@artilleryio/int-core",
3
- "version": "2.3.0-1c936ad",
3
+ "version": "2.3.0-a0b6328",
4
4
  "main": "./index.js",
5
5
  "license": "MPL-2.0",
6
6
  "dependencies": {
7
- "@artilleryio/int-commons": "2.0.4-1c936ad",
7
+ "@artilleryio/int-commons": "2.0.4-a0b6328",
8
8
  "@artilleryio/sketches-js": "^2.1.1",
9
9
  "agentkeepalive": "^4.1.0",
10
10
  "arrivals": "^2.1.2",