MCPcopy Create free account
hub / github.com/ShipSecAI/studio / truncateBody

Function truncateBody

packages/component-sdk/src/http/har-builder.ts:116–124  ·  view source on GitHub ↗
(
  body: string,
  maxSize: number,
)

Source from the content-addressed store, hash-verified

114}
115
116export function truncateBody(
117 body: string,
118 maxSize: number,
119): { text: string; truncated: boolean } {
120 if (body.length <= maxSize) {
121 return { text: body, truncated: false };
122 }
123 return { text: body.slice(0, maxSize), truncated: true };
124}
125
126export function buildHarRequest(
127 input: HttpRequestInput,

Callers 2

buildHarRequestFunction · 0.85
buildHarResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected