Update index.ts

This commit is contained in:
Andros Fenollosa 2022-02-12 09:29:34 +01:00 committed by GitHub
parent 608f35a9f7
commit 4f54ae1d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,7 @@ export function cloneJSON(json: JSON): JSON {
* // => 8.31 (Maybe) * // => 8.31 (Maybe)
* *
*/ */
export function getRandom(min, max, decimals=0) { export function getRandom(min: number, max: number, decimals: number=0): number {
const minRandom = Math.ceil(min); const minRandom = Math.ceil(min);
const maxRandom = Math.floor(max); const maxRandom = Math.floor(max);
return (Math.random() * (maxRandom - minRandom + 1) + minRandom).toFixed(decimals); return (Math.random() * (maxRandom - minRandom + 1) + minRandom).toFixed(decimals);
@ -189,7 +189,7 @@ export function deleteArrayElementByIndex(index: number, list: Array<any>): Arra
* @param {Array<File>} filesList * @param {Array<File>} filesList
* @return {FileList} * @return {FileList}
*/ */
export function arrayFilesToFileList(filesList) { export function arrayFilesToFileList(filesList): Filelist {
return filesList.reduce(function (dataTransfer, file) { return filesList.reduce(function (dataTransfer, file) {
dataTransfer.items.add(file); dataTransfer.items.add(file);
return dataTransfer; return dataTransfer;