forked from ddrilling/asb_cloud_front
Функция range ускорена в 5 раз
This commit is contained in:
parent
4b20a44d88
commit
8f98cc066c
@ -23,7 +23,7 @@ export const limitValue = <T,>(min: T, max: T) => (value: T) => {
|
||||
*
|
||||
* @returns Массив чисел в диапазоне от `start` до `end`
|
||||
*/
|
||||
export const range = (end: number, start: number = 0) => Array.from({ length: end - start }, (_, i) => start + i)
|
||||
export const range = (end: number, start: number = 0) => Array(end - start).fill(undefined).map((_, i) => start + i)
|
||||
|
||||
export const pretify = (n: number): number | null => {
|
||||
if (!Number.isFinite(n)) return null
|
||||
|
Loading…
Reference in New Issue
Block a user