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.201708221145 to 1.4.1-git.201708221215

118

lib/utils/ensure-directory.js

@@ -9,5 +9,5 @@ 'use strict';

var _fs = require('fs');
var _gracefulFs = require('graceful-fs');
var _fs2 = _interopRequireDefault(_fs);
var _gracefulFs2 = _interopRequireDefault(_gracefulFs);

@@ -24,5 +24,14 @@ var _path = require('path');

var stat = _promisify2.default(_fs2.default.stat);
var _delay = require('./delay');
var _delay2 = _interopRequireDefault(_delay);
var stat = _promisify2.default(_gracefulFs2.default.stat);
var open = _promisify2.default(_gracefulFs2.default.open);
var close = _promisify2.default(_gracefulFs2.default.close);
var mkdir = _promisify2.default(_mkdirp2.default);
var MAX_RETRY_COUNT = 10;
var RETRY_DELAY = 100;
function createDirectory(directoryPath) {

@@ -51,2 +60,103 @@ return _regeneratorRuntime.async(function createDirectory$(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) {
case 0:
context$1$0.prev = 0;
context$1$0.next = 3;
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 9:
context$1$0.prev = 9;
context$1$0.t0 = context$1$0['catch'](0);
return context$1$0.abrupt('return', false);
case 12:
case 'end':
return context$1$0.stop();
}
}, null, this, [[0, 9]]);
}
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:
directoryPath = _path.dirname(fileName);
context$1$0.next = 3;
return _regeneratorRuntime.awrap(createDirectory(directoryPath));
case 3:
context$1$0.t0 = context$1$0.sent;
if (!context$1$0.t0) {
context$1$0.next = 8;
break;
}
context$1$0.next = 7;
return _regeneratorRuntime.awrap(openFile(fileName));
case 7:
context$1$0.t0 = context$1$0.sent;
case 8:
fileEnsured = context$1$0.t0;
i = 0;
case 10:
if (!(i < MAX_RETRY_COUNT && !fileEnsured)) {
context$1$0.next = 24;
break;
}
context$1$0.next = 13;
return _regeneratorRuntime.awrap(_delay2.default(RETRY_DELAY));
case 13:
context$1$0.next = 15;
return _regeneratorRuntime.awrap(createDirectory(directoryPath));
case 15:
context$1$0.t1 = context$1$0.sent;
if (!context$1$0.t1) {
context$1$0.next = 20;
break;
}
context$1$0.next = 19;
return _regeneratorRuntime.awrap(openFile(fileName));
case 19:
context$1$0.t1 = context$1$0.sent;
case 20:
fileEnsured = context$1$0.t1;
case 21:
i++;
context$1$0.next = 10;
break;
case 24:
return context$1$0.abrupt('return', fileEnsured);
case 25:
case 'end':
return context$1$0.stop();
}
}, null, this);
}
exports.default = function callee$0$0(fileName) {

@@ -76,3 +186,3 @@ var directoryPath, stats;

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

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

6

lib/utils/fs-exists-promised.js

@@ -7,5 +7,5 @@ 'use strict';

var _fs = require('fs');
var _gracefulFs = require('graceful-fs');
var _fs2 = _interopRequireDefault(_fs);
var _gracefulFs2 = _interopRequireDefault(_gracefulFs);

@@ -18,3 +18,3 @@ var _pinkie = require('pinkie');

return new _pinkie2.default(function (resolve) {
return _fs2.default.exists(filePath, resolve);
return _gracefulFs2.default.exists(filePath, resolve);
});

@@ -21,0 +21,0 @@ };

{
"name": "testcafe-browser-tools",
"version": "1.4.1-git.201708221145",
"version": "1.4.1-git.201708221215",
"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