UNPKG

@lonu/stc

Version:

A tool for converting OpenApi/Swagger/Apifox into code.

43 lines (42 loc) 957 B
import * as Colors from "../deps/jsr.io/@std/fmt/1.0.8/colors.js"; import { getT } from "./i18n/index.js"; /** * 输出提示信息 * @param str - 文本内容 */ const info = (str) => { console.info(Colors.bgBlue(getT(" $t(console.info) ")) + ` ${Colors.blue(str)}`); }; /** * 输出成功信息 * @param str - 文本内容 */ const success = (str) => { console.info(Colors.bgGreen(getT(" $t(console.success) ")) + ` ${Colors.green(str)}`); }; /** * 输出警告信息 * @param str - 文本内容 */ const warn = (str) => { console.log(Colors.bgYellow(getT(" $t(console.warn) ")) + ` ${Colors.yellow(str)}`); }; /** * 输出错误信息 * @param str - 文本内容 */ const error = (str) => { console.error(Colors.bgRed(getT(" $t(console.error) ")) + ` ${Colors.red(str)}`); }; /** * 清空终端信息 */ const clear = () => console.clear(); export default { info, success, warn, error, clear, };