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

Function removeExtraLineBreaks

packages/jest-snapshot/src/utils.ts:37–40  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

35// Instead of trim, which can remove additional newlines or spaces
36// at beginning or end of the content from a custom serializer.
37export const removeExtraLineBreaks = (string: string): string =>
38 string.length > 2 && string.startsWith('\n') && string.endsWith('\n')
39 ? string.slice(1, -1)
40 : string;
41
42export const removeLinesBeforeExternalMatcherTrap = (stack: string): string => {
43 const lines = stack.split('\n');

Callers 2

matchMethod · 0.90
utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected