Skip to content

Commit

Permalink
style: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nonara committed Jun 30, 2021
1 parent 7dea8d7 commit e77fe84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/nodes/text.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { decode } from 'he';
import NodeType from './type';
import Node from './node';
import HTMLElement from './html';
import { trimText } from '../utils';
import { decode } from 'he';


/**
Expand Down Expand Up @@ -66,7 +66,7 @@ export default class TextNode extends Node {

/**
* Detect if the node contains only white space.
* @return {bool}
* @return {boolean}
*/
public get isWhitespace() {
return /^(\s| )*$/.test(this.rawText);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export function trimText(text: string): string {
const hasTrailingSpace = endPos < (text.length - 1) && /[^\S\r\n]/.test(text[endPos+1]);

return (hasLeadingSpace ? ' ' : '') + text.slice(startPos, endPos + 1) + (hasTrailingSpace ? ' ' : '');
}
}

0 comments on commit e77fe84

Please sign in to comment.