Skip to content

Commit c295a4b

Browse files
committed
chore: format
1 parent 40e6bf9 commit c295a4b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/utils/strings.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { calloutRegex, codeBlockBlockquoteRegex } from './regex';
2-
import { getTextInLanguage } from '../lang/helpers';
3-
import { logWarn } from './logger';
4-
import { getAllTablesInText } from './mdast';
1+
import {calloutRegex, codeBlockBlockquoteRegex} from './regex';
2+
import {getTextInLanguage} from '../lang/helpers';
3+
import {logWarn} from './logger';
4+
import {getAllTablesInText} from './mdast';
55
/**
66
* Inserts a string at the given position in a string.
77
* @param {string} str - The string to insert into
@@ -163,7 +163,7 @@ function makeSureContentHasASingleEmptyLineBeforeItUnlessItStartsAFileForBlockqu
163163
}
164164

165165
let firstLineOfBlockquote: string;
166-
const indexOfEndOfFirstLine = text.indexOf('\n', startOfContent + 1);
166+
const indexOfEndOfFirstLine = text.indexOf('\n', startOfContent+1);
167167
if (indexOfEndOfFirstLine === -1) {
168168
firstLineOfBlockquote = text.substring(startOfContent);
169169
} else {
@@ -289,11 +289,11 @@ function makeSureContentHasASingleEmptyLineAfterItUnlessItEndsAFileForBlockquote
289289
}
290290

291291
let lastLineOfBlockquote: string;
292-
const indexOfEndOfLastLine = text.lastIndexOf('\n', endOfContent - 1);
292+
const indexOfEndOfLastLine = text.lastIndexOf('\n', endOfContent-1);
293293
if (indexOfEndOfLastLine === -1) {
294294
lastLineOfBlockquote = text.substring(0, endOfNewContent);
295295
} else {
296-
lastLineOfBlockquote = text.substring(indexOfEndOfLastLine + 1, endOfContent);
296+
lastLineOfBlockquote = text.substring(indexOfEndOfLastLine+1, endOfContent);
297297
}
298298

299299
let emptyLine: string;
@@ -408,7 +408,7 @@ export function replaceAt(text: string, search: string, replace: string, start:
408408
}
409409

410410
return text.slice(0, start) +
411-
text.slice(start, text.length).replace(search, replace);
411+
text.slice(start, text.length).replace(search, replace);
412412
}
413413

414414
// based on https://stackoverflow.com/a/21730166/8353749
@@ -432,7 +432,7 @@ export function isNumeric(str: string) {
432432
const type = typeof str;
433433
if (type != 'string') return type === 'number'; // we only process strings so if the value is not already a number the result is false
434434
return !isNaN(str as unknown as number) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
435-
!isNaN(parseFloat(str)); // ...and ensure strings of whitespace fail
435+
!isNaN(parseFloat(str)); // ...and ensure strings of whitespace fail
436436
}
437437

438438
export function getSubstringIndex(substring: string, text: string): number[] {
@@ -447,7 +447,7 @@ export function getSubstringIndex(substring: string, text: string): number[] {
447447

448448
function getIndexOfStartOfFirstNonEmptyLine(text: string, currentStartOfBlockquote: number, blockquoteLevel: number): number {
449449
let actualStartOfBlockquote = currentStartOfBlockquote;
450-
let blockquoteIndex = currentStartOfBlockquote + 1;
450+
let blockquoteIndex = currentStartOfBlockquote+1;
451451
let currentChar = '';
452452
let foundNewStart = false;
453453
let level = 0;
@@ -479,7 +479,7 @@ function getIndexOfStartOfFirstNonEmptyLine(text: string, currentStartOfBlockquo
479479

480480
function getIndexOfEndOfLastNonEmptyLine(text: string, currentEndOfBlockquote: number, blockquoteLevel: number): number {
481481
let actualEndOfBlockquote = currentEndOfBlockquote;
482-
let blockquoteIndex = currentEndOfBlockquote - 1;
482+
let blockquoteIndex = currentEndOfBlockquote-1;
483483
let currentChar = '';
484484
let foundNewEnd = false;
485485
let level = 0;

0 commit comments

Comments
 (0)