Skip to content

Commit

Permalink
Merge 6990848 into 94782c4
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 5, 2022
2 parents 94782c4 + 6990848 commit 0987e31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/svg-sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ SVGSpriter.prototype._namespacePow = [];
SVGSpriter.prototype.add = function(file, name, svg) {
// If no vinyl file object has been given
if (!this._isVinylFile(file)) {
file = _.trim(file);
file = file.trim();
let error = null;

// If the name part of the file path is absolute
if (name && path.isAbsolute(name)) {
error = format('SVGSpriter.add: "%s" is not a valid relative file name', name);
} else {
name = _.trimStart(_.trim(name), `${path.sep}.`) || path.basename(file);
svg = _.trim(svg);
name = _.trimStart(name.trim(), `${path.sep}.`) || path.basename(file);
svg = typeof svg === 'string' ? svg.trim() : svg;

// Argument validation
if (arguments.length < 3) {
Expand Down

0 comments on commit 0987e31

Please sign in to comment.