From e28171eefcf7dca8e4b9fe3535fb23896667a152 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Thu, 10 Feb 2022 09:39:47 +0100 Subject: [PATCH] Update fnTools.ts --- src/fnTools.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fnTools.ts b/src/fnTools.ts index d939338..d643da3 100644 --- a/src/fnTools.ts +++ b/src/fnTools.ts @@ -213,3 +213,15 @@ export function arraySwapIndex(firstIndex: number, secondIndex: number, list: Ar tempList[secondIndex] = tmpFirstPos; return tempList; } + + +/** + * Returns a File in text. + * @param {File} file + * @return {Promise} + */ +export async function encodeFileToText(file: File): Promise { + return file.text().then((text) => { + return text; + }); +}