mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
Rewrite WebpackPatcher to support new features (#3157)
This commit is contained in:
parent
fcf8690d26
commit
e8639e2e16
22 changed files with 896 additions and 358 deletions
|
@ -100,6 +100,11 @@ export function pluralise(amount: number, singular: string, plural = singular +
|
|||
return amount === 1 ? `${amount} ${singular}` : `${amount} ${plural}`;
|
||||
}
|
||||
|
||||
export function interpolateIfDefined(strings: TemplateStringsArray, ...args: any[]) {
|
||||
if (args.some(arg => arg == null)) return "";
|
||||
return String.raw({ raw: strings }, ...args);
|
||||
}
|
||||
|
||||
export function tryOrElse<T>(func: () => T, fallback: T): T {
|
||||
try {
|
||||
const res = func();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue