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.201708211545 to 1.4.1-git.201708221000

85

lib/api/generate-thumbnail.js

@@ -90,2 +90,4 @@ 'use strict';

function generate(src, dst, width, height) {
var _this = this;
return new _Promise(function (resolve, reject) {

@@ -96,21 +98,62 @@ var srcFileData = _fs2.default.readFileSync(src);

srcImage.parse(srcFileData, function (e) {
if (e) reject(e);
srcImage.parse(srcFileData, function callee$2$0(e) {
var dstImage, dstFileData;
return _regeneratorRuntime.async(function callee$2$0$(context$3$0) {
while (1) switch (context$3$0.prev = context$3$0.next) {
case 0:
if (e) reject(e);
try {
var dstImage = scale(srcImage, width, height);
context$3$0.prev = 1;
dstImage = scale(srcImage, width, height);
dstFileData = _pngjs.PNG.sync.write(dstImage);
context$3$0.prev = 4;
var dstFileData = _pngjs.PNG.sync.write(dstImage);
_fs2.default.writeFileSync(dst, dstFileData);
context$3$0.next = 18;
break;
try {
_fs2.default.writeFileSync(dst, dstFileData);
} catch (e2) {
if (e2.code !== 'ENOENT' || !_utilsEnsureDirectory2.default(dst)) throw e2;
case 8:
context$3$0.prev = 8;
context$3$0.t0 = context$3$0['catch'](4);
context$3$0.t1 = context$3$0.t0.code !== 'ENOENT';
_fs2.default.writeFileSync(dst, dstFileData);
if (context$3$0.t1) {
context$3$0.next = 15;
break;
}
context$3$0.next = 14;
return _regeneratorRuntime.awrap(_utilsEnsureDirectory2.default(dst));
case 14:
context$3$0.t1 = !context$3$0.sent;
case 15:
if (!context$3$0.t1) {
context$3$0.next = 17;
break;
}
throw context$3$0.t0;
case 17:
_fs2.default.writeFileSync(dst, dstFileData);
case 18:
resolve();
context$3$0.next = 24;
break;
case 21:
context$3$0.prev = 21;
context$3$0.t2 = context$3$0['catch'](1);
reject(context$3$0.t2);
case 24:
case 'end':
return context$3$0.stop();
}
resolve();
} catch (e3) {
reject(e3);
}
}, null, _this, [[1, 21], [4, 8]]);
});

@@ -150,4 +193,8 @@ });

case 0:
if (_utilsEnsureDirectory2.default(thumbnailPath)) {
context$2$0.next = 2;
context$2$0.next = 2;
return _regeneratorRuntime.awrap(_utilsEnsureDirectory2.default(thumbnailPath));
case 2:
if (context$2$0.sent) {
context$2$0.next = 4;
break;

@@ -158,7 +205,7 @@ }

case 2:
context$2$0.next = 4;
case 4:
context$2$0.next = 6;
return _regeneratorRuntime.awrap(generate(sourcePath, thumbnailPath, width, height));
case 4:
case 6:
case 'end':

@@ -165,0 +212,0 @@ return context$2$0.stop();

@@ -73,12 +73,16 @@ /*eslint-disable*/

if (!(context$1$0.t0.code === 'ENOENT')) {
context$1$0.next = 12;
context$1$0.next = 14;
break;
}
return context$1$0.abrupt('return', createDirectory(directoryPath));
context$1$0.next = 13;
return _regeneratorRuntime.awrap(createDirectory(directoryPath));
case 12:
case 13:
return context$1$0.abrupt('return', context$1$0.sent);
case 14:
return context$1$0.abrupt('return', false);
case 13:
case 15:
case 'end':

@@ -85,0 +89,0 @@ return context$1$0.stop();

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