Drop array support from endsWith.

This commit is contained in:
Logan Smyth 2016-07-05 18:09:54 -07:00
parent f908f3fc88
commit abb9618e8c
2 changed files with 1 additions and 3 deletions

View File

@ -335,8 +335,6 @@ export default class Buffer {
*/
endsWith(str: string): boolean {
if (Array.isArray(str)) return str.some((s) => this.endsWith(s));
if (str.length === 1) {
return this.last === str;
} else {

View File

@ -266,7 +266,7 @@ export default class Printer extends Buffer {
// whitespace before
this.newline(this.whitespace.getNewlinesBefore(comment));
if (!this.endsWith(["[", "{"])) this.space();
if (!this.endsWith("[") && !this.endsWith("{")) this.space();
let val = this.generateComment(comment);