testcafe-browser-tools
Advanced tools
Comparing version 1.4.1-git.201708230930 to 1.4.1-git.201708231130
@@ -28,4 +28,3 @@ 'use strict'; | ||
var stat = _promisify2.default(_gracefulFs2.default.stat); | ||
var open = _promisify2.default(_gracefulFs2.default.open); | ||
var close = _promisify2.default(_gracefulFs2.default.close); | ||
var readdir = _promisify2.default(_gracefulFs2.default.readdir); | ||
var mkdir = _promisify2.default(_mkdirp2.default); | ||
@@ -59,5 +58,4 @@ | ||
function openFile(fileName) { | ||
var fd; | ||
return _regeneratorRuntime.async(function openFile$(context$1$0) { | ||
function readDirectory(directoryPath) { | ||
return _regeneratorRuntime.async(function readDirectory$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
@@ -67,90 +65,84 @@ case 0: | ||
context$1$0.next = 3; | ||
return _regeneratorRuntime.awrap(open(fileName, 'a+')); | ||
return _regeneratorRuntime.awrap(readdir(directoryPath)); | ||
case 3: | ||
fd = context$1$0.sent; | ||
context$1$0.next = 6; | ||
return _regeneratorRuntime.awrap(close(fd)); | ||
return context$1$0.abrupt('return', true); | ||
case 6: | ||
return context$1$0.abrupt('return', true); | ||
case 9: | ||
context$1$0.prev = 9; | ||
context$1$0.prev = 6; | ||
context$1$0.t0 = context$1$0['catch'](0); | ||
return context$1$0.abrupt('return', false); | ||
case 12: | ||
case 9: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this, [[0, 9]]); | ||
}, null, this, [[0, 6]]); | ||
} | ||
function ensureFile(fileName) { | ||
var directoryPath, fileEnsured, i; | ||
return _regeneratorRuntime.async(function ensureFile$(context$1$0) { | ||
function ensureDirectory(directoryPath) { | ||
var fileEnsured, i; | ||
return _regeneratorRuntime.async(function ensureDirectory$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
directoryPath = _path.dirname(fileName); | ||
context$1$0.next = 3; | ||
context$1$0.next = 2; | ||
return _regeneratorRuntime.awrap(createDirectory(directoryPath)); | ||
case 3: | ||
case 2: | ||
context$1$0.t0 = context$1$0.sent; | ||
if (!context$1$0.t0) { | ||
context$1$0.next = 8; | ||
context$1$0.next = 7; | ||
break; | ||
} | ||
context$1$0.next = 7; | ||
return _regeneratorRuntime.awrap(openFile(fileName)); | ||
context$1$0.next = 6; | ||
return _regeneratorRuntime.awrap(readDirectory(directoryPath)); | ||
case 7: | ||
case 6: | ||
context$1$0.t0 = context$1$0.sent; | ||
case 8: | ||
case 7: | ||
fileEnsured = context$1$0.t0; | ||
i = 0; | ||
case 10: | ||
case 9: | ||
if (!(i < MAX_RETRY_COUNT && !fileEnsured)) { | ||
context$1$0.next = 24; | ||
context$1$0.next = 23; | ||
break; | ||
} | ||
context$1$0.next = 13; | ||
context$1$0.next = 12; | ||
return _regeneratorRuntime.awrap(_delay2.default(RETRY_DELAY)); | ||
case 13: | ||
context$1$0.next = 15; | ||
case 12: | ||
context$1$0.next = 14; | ||
return _regeneratorRuntime.awrap(createDirectory(directoryPath)); | ||
case 15: | ||
case 14: | ||
context$1$0.t1 = context$1$0.sent; | ||
if (!context$1$0.t1) { | ||
context$1$0.next = 20; | ||
context$1$0.next = 19; | ||
break; | ||
} | ||
context$1$0.next = 19; | ||
return _regeneratorRuntime.awrap(openFile(fileName)); | ||
context$1$0.next = 18; | ||
return _regeneratorRuntime.awrap(readDirectory(directoryPath)); | ||
case 19: | ||
case 18: | ||
context$1$0.t1 = context$1$0.sent; | ||
case 20: | ||
case 19: | ||
fileEnsured = context$1$0.t1; | ||
case 21: | ||
case 20: | ||
i++; | ||
context$1$0.next = 10; | ||
context$1$0.next = 9; | ||
break; | ||
case 24: | ||
case 23: | ||
return context$1$0.abrupt('return', fileEnsured); | ||
case 25: | ||
case 24: | ||
case 'end': | ||
@@ -186,3 +178,3 @@ return context$1$0.stop(); | ||
context$1$0.next = 13; | ||
return _regeneratorRuntime.awrap(ensureFile(fileName)); | ||
return _regeneratorRuntime.awrap(ensureDirectory(directoryPath)); | ||
@@ -189,0 +181,0 @@ case 13: |
{ | ||
"name": "testcafe-browser-tools", | ||
"version": "1.4.1-git.201708230930", | ||
"version": "1.4.1-git.201708231130", | ||
"description": "An utility library for performing platform-dependent actions on browsers.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/DevExpress/testcafe-browser-tools", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1600271
1692