Update fnTools.ts

This commit is contained in:
Andros Fenollosa 2022-02-09 16:57:28 +01:00 committed by GitHub
parent d04f498c99
commit a732cc04fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,7 @@ export function getRandom(min, max, decimals=0) {
* @param {Array<File>} list - List of files. * @param {Array<File>} list - List of files.
* @return number * @return number
*/ */
function getIndexOfFileList(name: string, list: Array<File>): number { export function getIndexOfFileList(name: string, list: Array<File>): number {
return list.reduce( return list.reduce(
(position, file, index) => (file.name === name ? index : position), (position, file, index) => (file.name === name ? index : position),
-1 -1