[F] Fix edge cases
This commit is contained in:
+2
-2
@@ -12,8 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
export function range(fromOrTo: number, to?: number, step = 1): number[]
|
export function range(fromOrTo: number, to?: number, step = 1): number[]
|
||||||
{
|
{
|
||||||
const from = to ? fromOrTo : 0
|
const from = to !== undefined ? fromOrTo : 0
|
||||||
to = to ? to : fromOrTo
|
to = to !== undefined ? to : fromOrTo
|
||||||
|
|
||||||
if (to == from) return []
|
if (to == from) return []
|
||||||
const mul = to > from ? 1 : -1
|
const mul = to > from ? 1 : -1
|
||||||
|
|||||||
Reference in New Issue
Block a user