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

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);
}