From 0059b1ef93d7e4b011ac1078306d48e98dc803ea Mon Sep 17 00:00:00 2001 From: retarsis Date: Sat, 3 Oct 2020 16:31:59 +0300 Subject: [PATCH] fix: access array index proxy prop --- package/src/core/getRoutes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/src/core/getRoutes.ts b/package/src/core/getRoutes.ts index 6fc33471..7c8b027b 100644 --- a/package/src/core/getRoutes.ts +++ b/package/src/core/getRoutes.ts @@ -24,7 +24,7 @@ export const getRoutes = (): T => { case path === Symbol.iterator: return Array.prototype[Symbol.iterator].bind(targetArray); - case path in targetArray: { + case path in Array.prototype: { const updatedTargetPath = Array.prototype[path as any].bind(targetArray); Object.defineProperty(updatedTargetPath, 'length', { get: () => targetArray.length + 1 }); const nextTuple = [...targetArray, path];