UNPKG

astx

Version:

super powerful structural search and replace for JavaScript and TypeScript to automate your refactoring

12 lines (10 loc) 290 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = normalizeJSXTextValue; function normalizeJSXTextValue(value) { return value.replace(/^\s+|\s+$/g, function (match) { return /\n/.test(match) ? '' : ' '; }).replace(/\s+/gm, ' '); }