MCPcopy Index your code
hub / github.com/triggerdotdev/jsonhero-web / formatString

Function formatString

app/utilities/formatter.ts:89–104  ·  view source on GitHub ↗
(value: string, format?: JSONStringFormat)

Source from the content-addressed store, hash-verified

87}
88
89function formatString(value: string, format?: JSONStringFormat): string {
90 if (!format) {
91 return value;
92 }
93
94 switch (format.name) {
95 case "email":
96 return value;
97 case "uri":
98 return value;
99 case "datetime":
100 return formatDateTime(value, format);
101 default:
102 return value;
103 }
104}
105
106export function formatDateTime(
107 value: string,

Callers 1

formatValueFunction · 0.85

Calls 1

formatDateTimeFunction · 0.85

Tested by

no test coverage detected