Get rid of ifHasItemOfType

This commit is contained in:
Johannes Loher 2021-02-26 01:38:53 +01:00
parent b3ac3cde84
commit 315261bf4f
5 changed files with 42 additions and 69 deletions

View file

@ -1,6 +1,10 @@
export default { htmlToPlainText };
export default { htmlToPlainText, isEmpty };
function htmlToPlainText(input: string | null | undefined): string | null | undefined {
if (!input) return;
return $(input).text();
}
function isEmpty(input: Array<unknown> | null | undefined): boolean {
return (input?.length ?? 0) === 0;
}