Skip to content

Commit ebe239a

Browse files
authored
Drop old node.js support without Buffer.from (#702)
1 parent b61c745 commit ebe239a

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

package-lock.json

+2-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"homepage": "https://github.com/TypeStrong/ts-node",
5050
"devDependencies": {
5151
"@types/arrify": "^1.0.1",
52-
"@types/buffer-from": "^1.1.0",
5352
"@types/chai": "^4.0.4",
5453
"@types/diff": "^3.2.1",
5554
"@types/minimist": "^1.2.0",
@@ -77,7 +76,6 @@
7776
},
7877
"dependencies": {
7978
"arrify": "^1.0.0",
80-
"buffer-from": "^1.1.0",
8179
"diff": "^3.1.0",
8280
"make-error": "^1.1.1",
8381
"minimist": "^1.2.0",

src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import mkdirp = require('mkdirp')
66
import crypto = require('crypto')
77
import yn = require('yn')
88
import arrify = require('arrify')
9-
import bufferFrom = require('buffer-from')
109
import { BaseError } from 'make-error'
1110
import * as util from 'util'
1211
import * as ts from 'typescript'
@@ -487,7 +486,7 @@ type SourceOutput = [string, string]
487486
* Update the output remapping the source map.
488487
*/
489488
function updateOutput (outputText: string, fileName: string, sourceMap: string, getExtension: (fileName: string) => string) {
490-
const base64Map = bufferFrom(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64')
489+
const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64')
491490
const sourceMapContent = `data:application/json;charset=utf-8;base64,${base64Map}`
492491
const sourceMapLength = `${basename(fileName)}.map`.length + (getExtension(fileName).length - extname(fileName).length)
493492

0 commit comments

Comments
 (0)