Skip to content

Commit bc07136

Browse files
committed
refactor(doc): Move getIndentCount tests into JSDoc comments
1 parent c7f94be commit bc07136

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

text.test.ts

-9
This file was deleted.

text.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
// deno-lint-ignore-file no-irregular-whitespace
12
import { isString } from "@core/unknownutil/is/string";
23

34
/** Count the number of leading whitespace characters (indentation level)
5+
*
6+
* ```ts
7+
* import { assertEquals } from "@std/assert/equals";
8+
*
9+
* assertEquals(getIndentCount("sample text "), 0);
10+
* assertEquals(getIndentCount(" sample text "), 2);
11+
* assertEquals(getIndentCount("   sample text"), 3);
12+
* assertEquals(getIndentCount("\t \t  sample text"), 5);
13+
* ```
414
*
515
* @param text - The input {@linkcode string} to analyze
616
* @returns The {@linkcode number} of leading whitespace characters

0 commit comments

Comments
 (0)