MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / trimTextLikeEdges

Function trimTextLikeEdges

packages/cli/src/transform.ts:951–957  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

949}
950
951function trimTextLikeEdges(value: string): { core: string; hasLeadingWhitespace: boolean; hasTrailingWhitespace: boolean } {
952 return {
953 core: value.replace(/^\s+/, "").replace(/\s+$/, ""),
954 hasLeadingWhitespace: /^\s/.test(value),
955 hasTrailingWhitespace: /\s$/.test(value),
956 };
957}
958
959function insertSingleVisibleBoundarySpace(normalized: any[], upcomingChild?: any): void {
960 const previous = normalized[normalized.length - 1];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected