From f92c4c5526c254b26e65f5a8086471ff7ecc18bf Mon Sep 17 00:00:00 2001 From: woxtu Date: Thu, 5 May 2022 21:40:00 +0900 Subject: [PATCH] Add type annotations --- pyscriptjs/src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyscriptjs/src/utils.ts b/pyscriptjs/src/utils.ts index 4f23e332..71262595 100644 --- a/pyscriptjs/src/utils.ts +++ b/pyscriptjs/src/utils.ts @@ -4,11 +4,11 @@ function addClasses(element: HTMLElement, classes: Array) { } } -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; }