Skip to content

Commit

Permalink
Drop old node.js support without Buffer.from (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 7, 2018
1 parent b61c745 commit ebe239a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
19 changes: 2 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"homepage": "https://github.com/TypeStrong/ts-node",
"devDependencies": {
"@types/arrify": "^1.0.1",
"@types/buffer-from": "^1.1.0",
"@types/chai": "^4.0.4",
"@types/diff": "^3.2.1",
"@types/minimist": "^1.2.0",
Expand Down Expand Up @@ -77,7 +76,6 @@
},
"dependencies": {
"arrify": "^1.0.0",
"buffer-from": "^1.1.0",
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import mkdirp = require('mkdirp')
import crypto = require('crypto')
import yn = require('yn')
import arrify = require('arrify')
import bufferFrom = require('buffer-from')
import { BaseError } from 'make-error'
import * as util from 'util'
import * as ts from 'typescript'
Expand Down Expand Up @@ -487,7 +486,7 @@ type SourceOutput = [string, string]
* Update the output remapping the source map.
*/
function updateOutput (outputText: string, fileName: string, sourceMap: string, getExtension: (fileName: string) => string) {
const base64Map = bufferFrom(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64')
const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64')
const sourceMapContent = `data:application/json;charset=utf-8;base64,${base64Map}`
const sourceMapLength = `${basename(fileName)}.map`.length + (getExtension(fileName).length - extname(fileName).length)

Expand Down

0 comments on commit ebe239a

Please sign in to comment.