UNPKG

@builder.io/mitosis

Version:

Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io

21 lines (20 loc) 602 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.minify = void 0; function minify(messageParts, ...expressions) { let text = ''; for (let i = 0; i < messageParts.length; i++) { const part = messageParts[i]; text += part; if (i < expressions.length) { text += expressions[i]; } } return text .replace('\n', ' ') .replace(/^\s+/, '') .replace(/\s+$/, '') .replace(/\s+/g, ' ') .replace(/\s?([,;\:\-\{\}\(\)\<\>])\s?/g, (_, match) => match); } exports.minify = minify;