Skip to content

Commit

Permalink
fix ts-node buffer warning
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mann committed Jul 13, 2020
1 parent 27e8c81 commit c5012c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"clean-deps": "rm -rf node_modules",
"postinstall": "patch-package",
"test": "yarn test-unit",
"test-unit": "node test",
"test-watch": "echo 'no watching of tests'"
Expand Down
13 changes: 13 additions & 0 deletions packages/ts/patches/ts-node+5.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/ts-node/dist/index.js b/node_modules/ts-node/dist/index.js
index 2dfd704..c00aa39 100644
--- a/node_modules/ts-node/dist/index.js
+++ b/node_modules/ts-node/dist/index.js
@@ -298,7 +298,7 @@ function readThrough(cachedir, shouldCache, memoryCache, compile, getExtension)
};
}
function updateOutput(outputText, fileName, sourceMap, getExtension) {
- var base64Map = new Buffer(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64');
+ var base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64');
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
var sourceMapLength = (path_1.basename(fileName) + ".map").length + (getExtension(fileName).length - path_1.extname(fileName).length);
return outputText.slice(0, -sourceMapLength) + sourceMapContent;

0 comments on commit c5012c0

Please sign in to comment.