blob: 2d520aee92e90a832523cce755737b08629d9533 (
plain) (
tree)
|
|
import { immutableAssign } from './object'
function objectLineFeedToHtml (obj: any, keyToNormalize: string) {
return immutableAssign(obj, {
[keyToNormalize]: lineFeedToHtml(obj[keyToNormalize])
})
}
function lineFeedToHtml (text: string) {
if (!text) return text
return text.replace(/\r?\n|\r/g, '<br />')
}
export {
objectLineFeedToHtml,
lineFeedToHtml
}
|