svgicons2svgfont
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "svgicons2svgfont", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Read a set of SVG icons and ouput a SVG font", | ||
@@ -30,6 +30,7 @@ "homepage": "https://github.com/nfroidure/svgicons2svgfont", | ||
"devDependencies": { | ||
"coveralls": "~2.11.2", | ||
"istanbul": "~0.3.15", | ||
"mocha": "~2.2.5", | ||
"mocha-lcov-reporter": "0.0.2", | ||
"coveralls": "~2.11.2", | ||
"istanbul": "~0.3.15" | ||
"streamtest": "^1.2.1" | ||
}, | ||
@@ -36,0 +37,0 @@ "author": { |
@@ -306,2 +306,6 @@ /* | ||
saxStream.on('error', function (error) { | ||
_this.emit('error', error); | ||
}); | ||
saxStream.on('closetag', function(tag) { | ||
@@ -371,3 +375,4 @@ parents.pop(); | ||
glyph.d.forEach(function(cD) { | ||
d+=' '+new SVGPathData(cD) | ||
try { | ||
d += ' ' + new SVGPathData(cD) | ||
.toAbs() | ||
@@ -381,2 +386,6 @@ .translate(-glyph.dX, -glyph.dY) | ||
.encode(); | ||
} catch(err) { | ||
_this.emit('error', 'Got an error parsing the glyph "' + | ||
glyph.name + '" path data: ' + cD + '.'); | ||
} | ||
}); | ||
@@ -383,0 +392,0 @@ if(options.centerHorizontally) { |
@@ -7,2 +7,3 @@ var assert = require('assert'); | ||
var SVGIconsDirStream = require(__dirname + '/../src/iconsdir'); | ||
var streamtest = require('streamtest'); | ||
@@ -414,2 +415,15 @@ // Helpers | ||
it("should fail when providing bad XML", function(done) { | ||
var svgIconStream = streamtest.v2.fromChunks(['bad', 'xml']); | ||
svgIconStream.metadata = { | ||
name: 'test', | ||
unicode: ['\uE002'] | ||
}; | ||
SVGIcons2SVGFontStream().on('error', function(err) { | ||
assert.equal(err instanceof Error, true); | ||
assert.equal(err.message, 'Non-whitespace before first tag.\nLine: 0\nColumn: 1\nChar: b'); | ||
done(); | ||
}).write(svgIconStream); | ||
}); | ||
}); |
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
157755
1151
5