Skip to content
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

chore: remove trim-right dependency #10420

Merged
merged 1 commit into from Sep 10, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/babel-generator/package.json
Expand Up @@ -17,8 +17,7 @@
"@babel/types": "^7.6.0",
"jsesc": "^2.5.1",
"lodash": "^4.17.13",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
"source-map": "^0.5.0"
},
"devDependencies": {
"@babel/helper-fixtures": "^7.6.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-generator/src/buffer.js
@@ -1,5 +1,4 @@
import type SourceMap from "./source-map";
import trimRight from "trim-right";

const SPACES_RE = /^[ \t]+$/;

Expand Down Expand Up @@ -43,7 +42,7 @@ export default class Buffer {
const result = {
// Whatever trim is used here should not execute a regex against the
// source string since it may be arbitrarily large after all transformations
code: trimRight(this._buf.join("")),
code: this._buf.join("").trimRight(),
map: null,
rawMappings: map && map.getRawMappings(),
};
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-helper-fixtures/src/index.js
@@ -1,5 +1,4 @@
import cloneDeep from "lodash/cloneDeep";
import trimEnd from "lodash/trimEnd";
import resolve from "try-resolve";
import clone from "lodash/clone";
import extend from "lodash/extend";
Expand Down Expand Up @@ -275,7 +274,7 @@ export function multiple(entryLoc, ignore?: Array<string>) {

export function readFile(filename) {
if (fs.existsSync(filename)) {
let file = trimEnd(fs.readFileSync(filename, "utf8"));
let file = fs.readFileSync(filename, "utf8").trimRight();
file = file.replace(/\r\n/g, "\n");
return file;
} else {
Expand Down