MCPcopy Create free account
hub / github.com/testing-library/user-event / stripAddedLinebreaks

Function stripAddedLinebreaks

testenv/modules/inlineSnapshot.js:92–97  ·  view source on GitHub ↗
(normalizedSnapshot)

Source from the content-addressed store, hash-verified

90}
91
92function stripAddedLinebreaks(normalizedSnapshot) {
93 return normalizedSnapshot.startsWith('\n') &&
94 normalizedSnapshot.endsWith('\n')
95 ? normalizedSnapshot.substring(1, normalizedSnapshot.length - 1)
96 : normalizedSnapshot
97}
98
99const INDENTATION_REGEX = /^([^\S\n]*)\S/m
100

Callers 2

toMatchInlineSnapshotFunction · 0.85
matchErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected