@ioffice/svg2png
Advanced tools
Comparing version 0.0.1-beta.1808291306 to 0.0.1-beta.1808291627
{ | ||
"name": "@ioffice/svg2png", | ||
"description": "Converts SVGs to PNGs, using Chromium", | ||
"version": "0.0.1-beta.1808291306", | ||
"version": "0.0.1-beta.1808291627", | ||
"author": "Orignal Author: Domenic Denicola (https://domenic.me)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -20,3 +20,3 @@ /// <reference types="node" /> | ||
static pool: Pool<Browser>; | ||
private static idCounter; | ||
static idCounter: number; | ||
private source; | ||
@@ -27,4 +27,4 @@ private id; | ||
static closePool(): Promise<undefined>; | ||
static debug(date: number, id: number, ...args: any[]): void; | ||
log(...args: any[]): void; | ||
static debug(id: number, msg: string, meta?: object): void; | ||
log(msg: string, meta?: object): void; | ||
failure(msg: string): Promise<any>; | ||
@@ -31,0 +31,0 @@ convert(): Promise<Buffer>; |
@@ -40,16 +40,8 @@ "use strict"; | ||
}; | ||
Svg2png.debug = function (date, id) { | ||
var args = []; | ||
for (var _i = 2; _i < arguments.length; _i++) { | ||
args[_i - 2] = arguments[_i]; | ||
} | ||
console.log.apply(console, ["[SVG2PNG:" + id + ":" + date + "]"].concat(args)); | ||
Svg2png.debug = function (id, msg, meta) { | ||
console.log("[SVG2PNG:" + id + "]", msg, meta || ''); | ||
}; | ||
Svg2png.prototype.log = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
Svg2png.prototype.log = function (msg, meta) { | ||
if (this.options.debug) { | ||
Svg2png.debug.apply(Svg2png, [this.id, +(new Date())].concat(args)); | ||
Svg2png.debug(this.id, msg, meta); | ||
} | ||
@@ -83,2 +75,3 @@ }; | ||
_a.trys.push([1, 4, , 9]); | ||
this.log('calling "pool.use"'); | ||
return [4 /*yield*/, Svg2png.pool.use(function (browser) { return fn(browser); })]; | ||
@@ -88,3 +81,3 @@ case 2: | ||
clearTimeout(timeoutHandle); | ||
this.log('success. closing page'); | ||
this.log('closing page'); | ||
return [4 /*yield*/, this.closePage()]; | ||
@@ -100,2 +93,3 @@ case 3: | ||
_a.trys.push([5, 7, , 8]); | ||
this.log('ERROR: clearing timeout and closing page:', { error: err_2 }); | ||
clearTimeout(timeoutHandle); | ||
@@ -397,4 +391,7 @@ return [4 /*yield*/, this.closePage()]; | ||
var s2pInstance = new Svg2png(config); | ||
return s2pInstance.convert(); | ||
return s2pInstance.convert().then(function (result) { | ||
s2pInstance.log('success'); | ||
return result; | ||
}); | ||
} | ||
exports.svg2png = svg2png; |
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
39243
761