astro-ghostcms/.pnpm-store/v3/files/13/f211663a2fbcecd4c21b0cd16b8...

24 lines
652 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.styler = void 0;
var transformStyles_1 = require("./transformStyles");
var utils_1 = require("./utils");
/**
* this function is not browser compatible*.
* @example ```ts
* console.log(styler('test', 'red'))
* ```
*
* *you have to add the styles manually, use the Log function for browser compatibly.
*/
function styler(input, style) {
if (utils_1.isBrowser) {
return "%c" + input;
}
if (style) {
return utils_1.addReset("" + transformStyles_1.transformToNodeStyle(style) + input);
}
return input;
}
exports.styler = styler;