UNPKG

638 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.styler = void 0;
4var handleStyle_1 = require("./handleStyle");
5var utils_1 = require("./utils");
6/**
7 * this function is not browser compatible*.
8 * @example ```ts
9 * console.log(styler('test', 'red'))
10 * ```
11 *
12 * *you have to add the styles manually, use the Log function for browser compatibly.
13 */
14function styler(input, style) {
15 if (utils_1.isBrowser) {
16 return "%c" + input;
17 }
18 if (style) {
19 return handleStyle_1.addReset("" + handleStyle_1.getNodeStyle(style) + input);
20 }
21 return input;
22}
23exports.styler = styler;