* Consolidate multiple different HTML/XML/RSS libraries to use the Cheerio stack * Remove unused deps * Move dev dependencies to correct section * Pin versions where missing
14 lines
419 B
TypeScript
14 lines
419 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
export function truncate(input: string, size: number): string;
|
|
export function truncate(input: string | undefined, size: number): string | undefined;
|
|
export function truncate(input: string | undefined, size: number): string | undefined {
|
|
if (!input) {
|
|
return input;
|
|
} else {
|
|
return input.slice(0, size);
|
|
}
|
|
}
|