Skip to content

Commit 7664e31

Browse files
Fix a couple more typos (#619)
1 parent e54d44a commit 7664e31

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/diff/word.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const extendedWordChars = 'a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2
2525
// Each token is one of the following:
2626
// - A punctuation mark plus the surrounding whitespace
2727
// - A word plus the surrounding whitespace
28-
// - Pure whitespace (but only in the special case where this the entire text
28+
// - Pure whitespace (but only in the special case where the entire text
2929
// is just whitespace)
3030
//
3131
// We have to include surrounding whitespace in the tokens because the two
@@ -318,7 +318,7 @@ function dedupeWhitespaceInChangeObjects(
318318
class WordsWithSpaceDiff extends Diff<string, string> {
319319
tokenize(value: string) {
320320
// Slightly different to the tokenizeIncludingWhitespace regex used above in
321-
// that this one treats each individual newline as a distinct tokens, rather
321+
// that this one treats each individual newline as a distinct token, rather
322322
// than merging them into other surrounding whitespace. This was requested
323323
// in https://github.com/kpdecker/jsdiff/issues/180 &
324324
// https://github.com/kpdecker/jsdiff/issues/211

src/util/string.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function hasOnlyUnixLineEndings(string: string): boolean {
104104

105105
export function trailingWs(string: string): string {
106106
// Yes, this looks overcomplicated and dumb - why not replace the whole function with
107-
// return string match(/\s*$/)[0]
107+
// return string.match(/\s*$/)[0]
108108
// you ask? Because:
109109
// 1. the trap described at https://markamery.com/blog/quadratic-time-regexes/ would mean doing
110110
// this would cause this function to take O(n²) time in the worst case (specifically when

0 commit comments

Comments
 (0)