Update fnTools.ts

This commit is contained in:
Andros Fenollosa 2022-02-09 17:03:34 +01:00 committed by GitHub
parent 481e112b53
commit 0bede8fce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,3 +169,13 @@ export function getIndexOfFileList(name: string, list: Array<File>): number {
-1
);
}
/**
* Returns a copy of the array by removing one position by index.
* @param {Array} list
* @param {number} index
* @return {Array} list
*/
export function deleteArrayElementByIndex(list: Array<any>, index: number) {
return list.filter((item, itemIndex) => itemIndex !== index);
}