Skip to content

remove buffer-from #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"test": "mocha"
},
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions source-map-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ try {
/* nop */
}

var bufferFrom = require('buffer-from');

/**
* Requires a module which is protected against bundler minification.
*
Expand Down Expand Up @@ -171,7 +169,7 @@ retrieveMapHandlers.push(function(source) {
if (reSourceMap.test(sourceMappingURL)) {
// Support source map URL as a data url
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);
sourceMapData = bufferFrom(rawData, "base64").toString();
sourceMapData = Buffer.from(rawData, "base64").toString();
sourceMappingURL = source;
} else {
// Support source map URLs relative to the source URL
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var SourceMapGenerator = require('source-map').SourceMapGenerator;
var child_process = require('child_process');
var assert = require('assert');
var fs = require('fs');
var bufferFrom = require('buffer-from');
var bufferFrom = Buffer.from;

function compareLines(actual, expected) {
assert(actual.length >= expected.length, 'got ' + actual.length + ' lines but expected at least ' + expected.length + ' lines');
Expand Down