Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

testcafe-browser-tools

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-browser-tools - npm Package Compare versions

Comparing version 1.4.1-git.201708221400 to 1.4.1-git.201708230630

76

lib/utils/ensure-directory.js

@@ -28,3 +28,4 @@ 'use strict';

var stat = _promisify2.default(_gracefulFs2.default.stat);
var readdir = _promisify2.default(_gracefulFs2.default.readdir);
var open = _promisify2.default(_gracefulFs2.default.open);
var close = _promisify2.default(_gracefulFs2.default.close);
var mkdir = _promisify2.default(_mkdirp2.default);

@@ -58,4 +59,5 @@

function readDirectory(directoryPath) {
return _regeneratorRuntime.async(function readDirectory$(context$1$0) {
function openFile(fileName) {
var fd;
return _regeneratorRuntime.async(function openFile$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {

@@ -65,84 +67,90 @@ case 0:

context$1$0.next = 3;
return _regeneratorRuntime.awrap(readdir(directoryPath));
return _regeneratorRuntime.awrap(open(fileName, 'a+'));
case 3:
fd = context$1$0.sent;
context$1$0.next = 6;
return _regeneratorRuntime.awrap(close(fd));
case 6:
return context$1$0.abrupt('return', true);
case 6:
context$1$0.prev = 6;
case 9:
context$1$0.prev = 9;
context$1$0.t0 = context$1$0['catch'](0);
return context$1$0.abrupt('return', false);
case 9:
case 12:
case 'end':
return context$1$0.stop();
}
}, null, this, [[0, 6]]);
}, null, this, [[0, 9]]);
}
function ensureDirectory(directoryPath) {
var fileEnsured, i;
return _regeneratorRuntime.async(function ensureDirectory$(context$1$0) {
function ensureFile(fileName) {
var directoryPath, fileEnsured, i;
return _regeneratorRuntime.async(function ensureFile$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
context$1$0.next = 2;
directoryPath = _path.dirname(fileName);
context$1$0.next = 3;
return _regeneratorRuntime.awrap(createDirectory(directoryPath));
case 2:
case 3:
context$1$0.t0 = context$1$0.sent;
if (!context$1$0.t0) {
context$1$0.next = 7;
context$1$0.next = 8;
break;
}
context$1$0.next = 6;
return _regeneratorRuntime.awrap(readDirectory(directoryPath));
context$1$0.next = 7;
return _regeneratorRuntime.awrap(openFile(fileName));
case 6:
case 7:
context$1$0.t0 = context$1$0.sent;
case 7:
case 8:
fileEnsured = context$1$0.t0;
i = 0;
case 9:
case 10:
if (!(i < MAX_RETRY_COUNT && !fileEnsured)) {
context$1$0.next = 23;
context$1$0.next = 24;
break;
}
context$1$0.next = 12;
context$1$0.next = 13;
return _regeneratorRuntime.awrap(_delay2.default(RETRY_DELAY));
case 12:
context$1$0.next = 14;
case 13:
context$1$0.next = 15;
return _regeneratorRuntime.awrap(createDirectory(directoryPath));
case 14:
case 15:
context$1$0.t1 = context$1$0.sent;
if (!context$1$0.t1) {
context$1$0.next = 19;
context$1$0.next = 20;
break;
}
context$1$0.next = 18;
return _regeneratorRuntime.awrap(readDirectory(directoryPath));
context$1$0.next = 19;
return _regeneratorRuntime.awrap(openFile(fileName));
case 18:
case 19:
context$1$0.t1 = context$1$0.sent;
case 19:
case 20:
fileEnsured = context$1$0.t1;
case 20:
case 21:
i++;
context$1$0.next = 9;
context$1$0.next = 10;
break;
case 23:
case 24:
return context$1$0.abrupt('return', fileEnsured);
case 24:
case 25:
case 'end':

@@ -178,3 +186,3 @@ return context$1$0.stop();

context$1$0.next = 13;
return _regeneratorRuntime.awrap(ensureDirectory(directoryPath));
return _regeneratorRuntime.awrap(ensureFile(fileName));

@@ -181,0 +189,0 @@ case 13:

{
"name": "testcafe-browser-tools",
"version": "1.4.1-git.201708221400",
"version": "1.4.1-git.201708230630",
"description": "An utility library for performing platform-dependent actions on browsers.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/DevExpress/testcafe-browser-tools",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc