MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / trim

Function trim

packages/core/src/utils/path.ts:96–115  ·  view source on GitHub ↗

JSDoc

(arr: string[])

Source from the content-addressed store, hash-verified

94
95/** JSDoc */
96function trim(arr: string[]): string[] {
97 let start = 0;
98 for (; start < arr.length; start++) {
99 if (arr[start] !== '') {
100 break;
101 }
102 }
103
104 let end = arr.length - 1;
105 for (; end >= 0; end--) {
106 if (arr[end] !== '') {
107 break;
108 }
109 }
110
111 if (start > end) {
112 return [];
113 }
114 return arr.slice(start, end - start + 1);
115}
116
117// path.relative(from, to)
118// posix version

Callers 1

relativeFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected