MCPcopy
hub / github.com/jestjs/jest / getIndentationLength

Function getIndentationLength

packages/jest-snapshot/src/dedentLines.ts:8–11  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

6 */
7
8const getIndentationLength = (line: string): number => {
9 const result = /^( {2})+/.exec(line);
10 return result === null ? 0 : result[0].length;
11};
12
13const dedentLine = (line: string): string =>
14 line.slice(getIndentationLength(line));

Callers 2

dedentLineFunction · 0.85
dedentMarkupFunction · 0.85

Calls 1

execMethod · 0.80

Tested by

no test coverage detected