Compare commits

...

2 Commits

Author SHA1 Message Date
1a571bba90 9.0.5 2021-12-22 19:08:54 +01:00
bcb66b2ccf fix(core): update 2021-12-22 19:08:53 +01:00
4 changed files with 8 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartfile",
"version": "9.0.4",
"version": "9.0.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartfile",
"version": "9.0.4",
"version": "9.0.5",
"license": "MIT",
"dependencies": {
"@pushrocks/lik": "^5.0.0",

View File

@ -1,7 +1,7 @@
{
"name": "@pushrocks/smartfile",
"private": false,
"version": "9.0.4",
"version": "9.0.5",
"description": "offers smart ways to work with files in nodejs",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",

View File

@ -213,4 +213,8 @@ tap.test('should create, store and retrieve valid smartfiles', async () => {
expect(retrievedString).to.equal(fileString);
});
tap.test('should wait for file to be ready', async () => {
await smartfile.fs.waitForFileToBeReady('./test/testassets/mytest.json')
})
tap.start();

View File

@ -388,7 +388,7 @@ export const waitForFileToBeReady = async (filePathArg: string): Promise<void> =
limitedArray.addOne(stats.size);
if (
limitedArray.array.length < 3 ||
!(limitedArray.array[0] === limitedArray[1] && limitedArray.array[1] === limitedArray[2])
!(limitedArray.array[0] === limitedArray.array[1] && limitedArray.array[1] === limitedArray.array[2])
) {
await plugins.smartdelay.delayFor(5000);
} else {