@trenskow/wait 1.1.2 → 1.2.2

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +3 -1
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -23,7 +23,7 @@ You can also cancel the wait before the specified time.
23
23
  ````javascript
24
24
  const waiter = wait('2s');
25
25
 
26
- setTimeout(waiter.elapse, 1000);
26
+ setTimeout(waiter.cancel, 1000);
27
27
 
28
28
  await waiter;
29
29
 
package/index.js CHANGED
@@ -14,10 +14,12 @@ module.exports = exports = (interval) => {
14
14
  timeoutId = setTimeout(resolve, interval);
15
15
  });
16
16
 
17
- result.elapse = () => {
17
+ result.cancel = () => {
18
18
  clearTimeout(timeoutId);
19
19
  resolver();
20
20
  };
21
21
 
22
+ result.elapse = result.cancel;
23
+
22
24
  return result;
23
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/wait",
3
- "version": "1.1.2",
3
+ "version": "1.2.2",
4
4
  "description": "A promisified version of `setTimeout`.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "homepage": "https://github.com/trenskow/wait#readme",
25
25
  "dependencies": {
26
- "@trenskow/units": "^0.1.1"
26
+ "@trenskow/units": "^0.1.4"
27
27
  },
28
28
  "devDependencies": {
29
- "chai": "^4.2.0",
29
+ "chai": "^4.3.6",
30
30
  "chai-as-promised": "^7.1.1",
31
- "mocha": "^7.2.0"
31
+ "mocha": "^9.2.2"
32
32
  }
33
33
  }