UNPKG

kui-shell

Version:

This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool

21 lines 738 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = (str) => { const kvPattern = /^([^=]+)=(.+)$/gm; let match = kvPattern.exec(str); if (match) { const matches = []; do { const value = { name: 'value', onclick: false, value: match[2], css: 'normal-wrap break-all' }; matches.push({ type: 'key-value', name: match[1], attributes: [value] }); } while ((match = kvPattern.exec(str))); const nLines = str.split(/\n/).filter(x => x).length; return nLines === matches.length && matches; } }; //# sourceMappingURL=ascii-key-value-to-table.js.map