We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getIndentCount
1 parent c7f94be commit bc07136Copy full SHA for bc07136
text.test.ts
text.ts
@@ -1,6 +1,16 @@
1
+// deno-lint-ignore-file no-irregular-whitespace
2
import { isString } from "@core/unknownutil/is/string";
3
4
/** 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
+ * ```
14
*
15
* @param text - The input {@linkcode string} to analyze
16
* @returns The {@linkcode number} of leading whitespace characters
0 commit comments