@beauraines/node-helpers 5.2.5 → 5.3.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/.github/dependabot.yml +5 -5
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/helpers.js +5 -0
- package/src/helpers.test.js +8 -0
package/.github/dependabot.yml
CHANGED
|
@@ -8,14 +8,14 @@ updates:
|
|
|
8
8
|
- package-ecosystem: "npm" # See documentation for possible values
|
|
9
9
|
directory: "/" # Location of package manifests
|
|
10
10
|
schedule:
|
|
11
|
-
interval: "
|
|
11
|
+
interval: "monthly"
|
|
12
12
|
day: "friday"
|
|
13
13
|
commit-message:
|
|
14
14
|
prefix: fix
|
|
15
15
|
prefix-development: chore
|
|
16
16
|
include: scope
|
|
17
17
|
groups:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
dev-dependencies:
|
|
19
|
+
dependency-type: "development"
|
|
20
|
+
patterns:
|
|
21
|
+
- "*"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [5.3.1](https://github.com/beauraines/node-helpers/compare/v5.3.0...v5.3.1) (2024-12-30)
|
|
6
|
+
|
|
7
|
+
## [5.3.0](https://github.com/beauraines/node-helpers/compare/v5.2.5...v5.3.0) (2024-12-21)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **helper:** async sleep function ([fc26a39](https://github.com/beauraines/node-helpers/commit/fc26a39fa54a353aba297390112646d01b450498))
|
|
13
|
+
|
|
5
14
|
### [5.2.5](https://github.com/beauraines/node-helpers/compare/v5.2.4...v5.2.5) (2024-12-07)
|
|
6
15
|
|
|
7
16
|
### [5.2.4](https://github.com/beauraines/node-helpers/compare/v5.2.3...v5.2.4) (2024-11-26)
|
package/package.json
CHANGED
package/src/helpers.js
CHANGED
|
@@ -218,6 +218,10 @@ const decompressFile = (filePath) => {
|
|
|
218
218
|
return fs.createReadStream(filePath).pipe(gunzip());
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
+
const sleep = async (milliseconds) => {
|
|
222
|
+
return new Promise(resolve => setTimeout(resolve, milliseconds))
|
|
223
|
+
}
|
|
224
|
+
|
|
221
225
|
|
|
222
226
|
module.exports = {
|
|
223
227
|
decompressFile,
|
|
@@ -227,6 +231,7 @@ module.exports = {
|
|
|
227
231
|
groupAndSum,
|
|
228
232
|
readFile,
|
|
229
233
|
listFiles,
|
|
234
|
+
sleep,
|
|
230
235
|
sparkline,
|
|
231
236
|
streamToBuffer,
|
|
232
237
|
stripNewLines,
|
package/src/helpers.test.js
CHANGED
|
@@ -45,5 +45,13 @@ describe('helpers',()=> {
|
|
|
45
45
|
expect(convertedDate).toBe(expectedOutput);
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
+
it('should sleep for 1 second', async () => {
|
|
49
|
+
let expectedEnd = new Date();
|
|
50
|
+
expectedEnd.setSeconds(expectedEnd.getSeconds() + 1); // Modify expectedEnd directly
|
|
51
|
+
await helper.sleep(1000);
|
|
52
|
+
const end = new Date();
|
|
53
|
+
expect(end.getTime()).toBeCloseTo(expectedEnd.getTime(), -2); // Allow slight deviation
|
|
54
|
+
})
|
|
55
|
+
|
|
48
56
|
})
|
|
49
57
|
|