pubo-utils 1.0.207 → 1.0.210

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/es/loop/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { sleep } from '../sleep';
2
- /**
3
- * Executes the given callback function in a loop with the specified time interval.
4
- *
5
- * @param {Function} cb - The callback function to be executed in the loop. It takes a stop function as a parameter.
6
- * @param {number} time - The time interval in milliseconds for the loop.
7
- * @return {Function} The stop function that can be used to stop the loop.
2
+ /**
3
+ * Executes the given callback function in a loop with the specified time interval.
4
+ *
5
+ * @param {Function} cb - The callback function to be executed in the loop. It takes a stop function as a parameter.
6
+ * @param {number} time - The time interval in milliseconds for the loop.
7
+ * @return {Function} The stop function that can be used to stop the loop.
8
8
  */ export const loop = (cb, time)=>{
9
9
  let onOff = true;
10
10
  let stop = ()=>onOff = false;
@@ -20,14 +20,14 @@ import { sleep } from '../sleep';
20
20
  })();
21
21
  return stop;
22
22
  };
23
- /**
24
- * Waits for a boolean condition to be true, with optional timeouts for the check and the overall wait.
25
- *
26
- * @param {WaitForBool} bool - the boolean condition to wait for
27
- * @param {Object} options - optional parameters for checkTime and timeout
28
- * @param {number} options.checkTime - the time interval for checking the boolean condition (default is 100)
29
- * @param {number} options.timeout - the maximum time to wait for the boolean condition to be true
30
- * @return {Promise<any>} a promise that resolves when the boolean condition is true or rejects with 'timeout' if the timeout is reached
23
+ /**
24
+ * Waits for a boolean condition to be true, with optional timeouts for the check and the overall wait.
25
+ *
26
+ * @param {WaitForBool} bool - the boolean condition to wait for
27
+ * @param {Object} options - optional parameters for checkTime and timeout
28
+ * @param {number} options.checkTime - the time interval for checking the boolean condition (default is 100)
29
+ * @param {number} options.timeout - the maximum time to wait for the boolean condition to be true
30
+ * @return {Promise<any>} a promise that resolves when the boolean condition is true or rejects with 'timeout' if the timeout is reached
31
31
  */ export const waitFor = (bool, { checkTime, timeout } = {})=>{
32
32
  return new Promise((resolve, reject)=>{
33
33
  let _timeout;
@@ -1,9 +1,9 @@
1
1
  const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
2
- /**
3
- * Generates a random string of specified length.
4
- *
5
- * @param {number} n - The length of the random string to generate
6
- * @return {string} The randomly generated string
2
+ /**
3
+ * Generates a random string of specified length.
4
+ *
5
+ * @param {number} n - The length of the random string to generate
6
+ * @return {string} The randomly generated string
7
7
  */ export const random = (n = 8)=>{
8
8
  let result = '';
9
9
  for(let i = 0; i < n; i++){
@@ -11,11 +11,11 @@ const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
11
11
  }
12
12
  return result;
13
13
  };
14
- /**
15
- * Generates a random number within the specified range.
16
- *
17
- * @param {number[]} range - The range within which to generate the random number.
18
- * @return {number} The randomly generated number within the specified range.
14
+ /**
15
+ * Generates a random number within the specified range.
16
+ *
17
+ * @param {number[]} range - The range within which to generate the random number.
18
+ * @return {number} The randomly generated number within the specified range.
19
19
  */ export const randomRangeNum = (range)=>{
20
20
  const [min, max] = range[0] < range[1] ? [
21
21
  range[0],
package/es/sleep/index.js CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * Asynchronous function to sleep for a specified amount of time.
3
- *
4
- * @param {number} time - The duration in milliseconds to sleep
5
- * @return {Promise<void>} A promise that resolves after the specified time
1
+ /**
2
+ * Asynchronous function to sleep for a specified amount of time.
3
+ *
4
+ * @param {number} time - The duration in milliseconds to sleep
5
+ * @return {Promise<void>} A promise that resolves after the specified time
6
6
  */ export const sleep = (time)=>{
7
7
  return new Promise((resolve)=>setTimeout(resolve, time));
8
8
  };
@@ -1,8 +1,8 @@
1
- /**
2
- * Asynchronous function to sleep for a specified amount of time.
3
- *
4
- * @param {number} time - The duration in milliseconds to sleep
5
- * @return {Promise<void>} A promise that resolves after the specified time
1
+ /**
2
+ * Asynchronous function to sleep for a specified amount of time.
3
+ *
4
+ * @param {number} time - The duration in milliseconds to sleep
5
+ * @return {Promise<void>} A promise that resolves after the specified time
6
6
  */ "use strict";
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pubo-utils",
3
- "version": "1.0.207",
3
+ "version": "1.0.210",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "engines": {
17
17
  "node": ">=8.0.0"
18
18
  },
19
- "gitHead": "f785821fb5a3ec8f9c7db2c3b818108dc9139ea2",
19
+ "gitHead": "aff7b585c4f83e46aa8838a337d448948caaee7d",
20
20
  "devDependencies": {
21
21
  "del": "^5.1.0",
22
22
  "eslint": "^8.42.0",
@@ -25,9 +25,6 @@
25
25
  "gulp-typescript": "^6.0.0-alpha.1",
26
26
  "prettier": "^2.8.8",
27
27
  "pretty-quick": "^2.0.1",
28
- "typescript": "^4.9.5",
29
- "webpack": "^5.75.0",
30
- "webpack-cli": "^5.0.1",
31
- "webpack-merge": "^5.8.0"
28
+ "typescript": "^4.9.5"
32
29
  }
33
30
  }