UNPKG

json-parser-yaml-converter

Version:
19 lines (15 loc) 437 B
/** * This module contains some util functions to tests. * * @module utils */ 'use strict'; /** * This function removes colors and newlines from a string. * @param {string} string - The string to clean. * @returns {string} The cleaned string. */ function cleanString(string) { return string.replace(/\u001b\[\d+m/g, '').replace(/\r\n/g, '').replace(/\n/g, '').replace(/\r/g, ''); } export { cleanString };