Add type annotations

This commit is contained in:
woxtu
2022-05-05 21:40:00 +09:00
parent 9334592c50
commit f92c4c5526

View File

@@ -4,11 +4,11 @@ function addClasses(element: HTMLElement, classes: Array<string>) {
}
}
const getLastPath = function (str) {
function getLastPath(str: string): string {
return str.split('\\').pop().split('/').pop();
};
}
function htmlDecode(input) {
function htmlDecode(input: string): string {
const doc = new DOMParser().parseFromString(ltrim(input), 'text/html');
return doc.documentElement.textContent;
}