Drop array support from endsWith.
This commit is contained in:
parent
f908f3fc88
commit
abb9618e8c
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user