@kubb/core
Version:
Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.
19 lines (15 loc) • 394 B
text/typescript
export function trim(text: string): string {
return text.replaceAll(/\n/g, '').trim()
}
export function trimQuotes(text: string): string {
if (text.match(/^"(.*)"$/)) {
return text.replace(/^"(.*)"$/, '$1')
}
if (text.match(/^'(.*)'$/)) {
return text.replace(/^'(.*)'$/, '$1')
}
if (text.match(/^`(.*)`$/)) {
return text.replace(/^`(.*)`$/, '$1')
}
return text
}