MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / dictToString

Function dictToString

js/botasaurus-server-js/src/validation.ts:60–72  ·  view source on GitHub ↗
(errorsDict: { [key: string]: string[] })

Source from the content-addressed store, hash-verified

58}
59
60export function dictToString(errorsDict: { [key: string]: string[] }): string {
61 const formattedPairs: string[] = [];
62 for (const [key, values] of Object.entries(errorsDict)) {
63
64 const valueStr = values.map(x => x.endsWith('.') ? x.slice(0, -1) : x).join('; ');
65 const formattedPair = `${key}: ${valueStr}.`;
66 formattedPairs.push(formattedPair);
67 }
68
69 const resultString = formattedPairs.join('\n');
70
71 return resultString;
72}
73
74export function isStringOfMinLength(data: any, minLength = 1): boolean {
75 return typeof data === 'string' && data.length >= minLength;

Callers 2

validateTaskRequestFunction · 0.85

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected