mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-24 19:35:41 +08:00
16 lines
436 B
TypeScript
16 lines
436 B
TypeScript
import { ConfigEntry } from "./types";
|
|
|
|
export function trimEnd(text: string, trimChar: string): string {
|
|
return text.slice(-1) === trimChar
|
|
? text.slice(0, -1)
|
|
: text;
|
|
}
|
|
|
|
export function getConfigDefaultValueText(config: ConfigEntry): string {
|
|
if (config.type != "string?") {
|
|
return config.default.toString();
|
|
} else {
|
|
return `@"${config.default.toString().replaceAll('"', '""')}"`;
|
|
}
|
|
}
|