All files / dist decorators.js

68.75% Statements 22/32
0% Branches 0/8
30% Functions 3/10
82.6% Lines 19/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  2x 2x 2x 2x 2x 12x 2x 7x 2x 2x 2x 3x 2x 2x 2x               2x         2x 2x               2x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.$section = exports.$h = exports.$kd = exports.$name = exports.$href = exports.$literal = exports.$type = exports.$kind = void 0;
const node_tools_1 = require("./node-tools");
const $kind = (kind) => `<span className="ts-doc-kind">${kind}</span>`;
exports.$kind = $kind;
const $type = (type) => `<span className="ts-doc-type">${type}</span>`;
exports.$type = $type;
const $literal = (lit) => `<span className="ts-doc-lit">${lit}</span>`;
exports.$literal = $literal;
const $href = (text, href) => `[${text}](${href})`;
exports.$href = $href;
const $name = (text) => `<span className="ts-doc-name">${text}</span>`;
exports.$name = $name;
const $kd = (strings, ...args) => (0, exports.$kind)(strings.reduce((o, s, i) => { var _a; return o + s + ((_a = args[i]) !== null && _a !== void 0 ? _a : ''); }, ''));
exports.$kd = $kd;
/**
 * Create a title section that allows for a more dynamic naming then what .mdx typically supports.
 * @param s
 * @param node
 * @param content
 * @returns
 */
const $h = (s, node, ...content) => `<div className="ts-doc-header-wrapper">
 
<h${s} className="ts-doc-header">${content.join(' ')}</h${s}>
 
${node ? `${'#'.repeat(s)} ${(0, node_tools_1.getFullName)(node)}\n\n` : ''}</div>`;
exports.$h = $h;
const $section = (...content) => {
    const ctn = content.filter(c => c.trim()).join('\n');
    if (!ctn)
        return '';
    return `<div className="ts-doc-section">
		${ctn}
	</div>`;
};
exports.$section = $section;