UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

14 lines 516 B
import { formatXml } from './formatXml'; import { formatJSONString } from './formatJSONString'; import { lineFeedRegex } from './countLineFeeds'; export function formatStringLike(str, format) { let result = str; if (format === 'json') { result = formatJSONString(str.replace(lineFeedRegex, '')); } else if (format === 'html' || format === 'xml') { result = formatXml(str.replace(lineFeedRegex, '')); } return result; } //# sourceMappingURL=formatStringLike.js.map