MCPcopy Create free account
hub / github.com/Kong/insomnia / sanitizeStringArray

Function sanitizeStringArray

packages/insomnia/src/konnect/transform.ts:23–29  ·  view source on GitHub ↗

Strips template syntax from each item, filters empties, and returns null if nothing remains.

(arr: string[] | null)

Source from the content-addressed store, hash-verified

21
22/** Strips template syntax from each item, filters empties, and returns null if nothing remains. */
23function sanitizeStringArray(arr: string[] | null): string[] | null {
24 if (arr === null) {
25 return null;
26 }
27 const result = arr.map(stripTemplateSyntax).filter(s => s.trim() !== '');
28 return result.length > 0 ? result : null;
29}
30
31/**
32 * Returns a copy of the route with Liquid template syntax stripped from all

Callers 1

sanitizeRouteFunction · 0.85

Calls 2

filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected