Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Fix: avoid deprecated Buffer warning
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Dec 5, 2018
1 parent 79b2de8 commit 22ff8f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/api/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @flow

export const encode = (text: string) => new Buffer(text).toString("base64");
export const decode = (text: string) => new Buffer(text, "base64").toString();
export const encode = (text: string) => Buffer.from(text).toString("base64");
export const decode = (text: string) => Buffer.from(text, "base64").toString();
4 changes: 2 additions & 2 deletions packages/plugin-transform-asciidoc/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ it("should transform asciidoc as html", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(`
contents: Buffer.from(`
= Hello, AsciiDoc!
Ezra Lalonde <[email protected]>
v1.0, 2017-10-05: First draft
Expand Down Expand Up @@ -50,7 +50,7 @@ it("should transform asciidoc as json", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(`
contents: Buffer.from(`
= Hello, AsciiDoc!
Ezra Lalonde <[email protected]>
v1.0, 2017-10-05: First draft
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-transform-json/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ it("should transform json as json", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(
contents: Buffer.from(
`{
"test": "a",
"test2": "b",
Expand All @@ -39,7 +39,7 @@ it("should transform json as json and support partial", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(
contents: Buffer.from(
`{
"test": "a",
"test2": "b",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-transform-markdown/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ it("should transform markdown as html", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(
contents: Buffer.from(
`---
test: a
test2: b
Expand All @@ -39,7 +39,7 @@ it("should transform markdown as json", () => {
// exists: true,
// type: "wat"
},
contents: new Buffer(
contents: Buffer.from(
`---
test: a
test2: b
Expand Down

0 comments on commit 22ff8f9

Please sign in to comment.