testilo 39.3.0 → 40.1.0

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/procs/util.js CHANGED
@@ -27,16 +27,15 @@
27
27
 
28
28
  // CONSTANTS
29
29
 
30
- // Array of 62 alphanumeric characters.
30
+ // Array of 36 alphanumeric characters.
31
31
  const alphaNumChars = (() => {
32
32
  const digits = Array(10).fill('').map((digit, index) => index.toString());
33
- const uppers = Array(26).fill('').map((letter, index) => String.fromCodePoint(65 + index));
34
33
  const lowers = Array(26).fill('').map((letter, index) => String.fromCodePoint(97 + index));
35
- return digits.concat(uppers, lowers);
34
+ return digits.concat(lowers);
36
35
  })();
37
36
  // Tools.
38
37
  const toolIDs = exports.toolIDs = [
39
- 'alfa', 'aslint', 'axe', 'ed11y', 'htmlcs', 'ibm', 'nuVal', 'qualWeb', 'testaro', 'wax', 'wave'
38
+ 'alfa', 'aslint', 'axe', 'ed11y', 'htmlcs', 'ibm', 'nuVal', 'qualWeb', 'testaro', 'wave', 'wax'
40
39
  ];
41
40
 
42
41
  // FUNCTIONS
@@ -75,13 +74,13 @@ exports.dateOf = timeStamp => {
75
74
  return null;
76
75
  }
77
76
  };
78
- // Returns a base-62 alphanumeric representation of an integer.
77
+ // Returns a base-36 alphanumeric representation of an integer.
79
78
  exports.alphaNumOf = num => {
80
79
  let resultDigits = [];
81
80
  while (num || ! resultDigits.length) {
82
- const remainder = num % 62;
81
+ const remainder = num % 36;
83
82
  resultDigits.unshift(alphaNumChars[remainder]);
84
- num = Math.floor(num / 62);
83
+ num = Math.floor(num / 36);
85
84
  }
86
85
  return resultDigits.join('');
87
86
  };
@@ -89,7 +88,7 @@ exports.alphaNumOf = num => {
89
88
  const getRandomString = exports.getRandomString = length => {
90
89
  const chars = [];
91
90
  for (let i = 0; i < length; i++) {
92
- chars.push(alphaNumChars[Math.floor(62 * Math.random())]);
91
+ chars.push(alphaNumChars[Math.floor(36 * Math.random())]);
93
92
  }
94
93
  return chars.join('');
95
94
  };