Skip to content

Commit

Permalink
Switch to Buffer.from (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 22, 2021
1 parent c22ca4d commit 4bd64e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/svg-sprite.js
Expand Up @@ -130,7 +130,7 @@ SVGSpriter.prototype.add = function (file, name, svg) {
file = new File({
base: file.substring(0, file.length - name.length),
path: file,
contents: new Buffer(svg)
contents: Buffer.from(svg)
});
}

Expand Down Expand Up @@ -360,7 +360,7 @@ SVGSpriter.prototype._getShapeFiles = function (dest) {
return new File({
base: this.config.dest,
path: path.join(dest, shape.id + '.svg'),
contents: new Buffer(shape.getSVG(false))
contents: Buffer.from(shape.getSVG(false))
});
}, this);
};
Expand Down
4 changes: 2 additions & 2 deletions lib/svg-sprite/mode/base.js
Expand Up @@ -166,7 +166,7 @@ SVGSpriteBase.prototype._buildCSSResources = function(files, cb) {
files[ext] = new File({
base : spriter.config.dest,
path : renderConfig.dest,
contents : new Buffer(out)
contents : Buffer.from(out)
});
spriter.verbose('Created «%s» stylesheet resource', ext);
}
Expand Down Expand Up @@ -195,7 +195,7 @@ SVGSpriteBase.prototype._buildHTMLExample = function(files, cb) {
files.example = new File({
base : this._spriter.config.dest,
path : this.config.example.dest,
contents : new Buffer(out)
contents : Buffer.from(out)
});
this._spriter.verbose('Created «%s» HTML example file', this.key);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/sprite.js
Expand Up @@ -113,7 +113,7 @@ SVGSprite.prototype.toFile = function(base, path) {
return new File({
base : base,
path : path,
contents : new Buffer(this.toString())
contents : Buffer.from(this.toString())
});
};

Expand Down

0 comments on commit 4bd64e1

Please sign in to comment.