Skip to content

Commit 99f8b62

Browse files
committed
replace deprecated use of Buffer
1 parent 7b0efa3 commit 99f8b62

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function runtcm(filepath, creator, content, options){
7171
showWarning(filepath, mes);
7272
}
7373
}
74-
return new Buffer(content.formatted);
74+
return Buffer.from(content.formatted);
7575
})
7676
.catch(err=>{
7777
showError(filepath, err);

test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('gulp-typed-css-modules', ()=>{
3737

3838
const file = new Vinyl({
3939
path: path.join(__dirname, 'fake.css'),
40-
contents: new Buffer('.foo { display: none; }'),
40+
contents: Buffer.from('.foo { display: none; }'),
4141
});
4242

4343
const factory = new FakeTCMFactory();
@@ -75,10 +75,10 @@ describe('gulp-typed-css-modules', ()=>{
7575
contents: inputStream,
7676
});
7777

78-
inputStream.write(new Buffer('.bar '));
79-
inputStream.write(new Buffer('{ displa'));
80-
inputStream.write(new Buffer('y: none;'));
81-
inputStream.write(new Buffer(' }\n'));
78+
inputStream.write(Buffer.from('.bar '));
79+
inputStream.write(Buffer.from('{ displa'));
80+
inputStream.write(Buffer.from('y: none;'));
81+
inputStream.write(Buffer.from(' }\n'));
8282
inputStream.end();
8383

8484
const factory = new FakeTCMFactory();

0 commit comments

Comments
 (0)