Skip to content

Commit 8687733

Browse files
committed
small improvements in CubeStoreResultWrapper
1 parent ff991e2 commit 8687733

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

packages/cubejs-backend-native/js/CubeStoreResultWrapper.ts

+7-10
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,19 @@ export class CubeStoreResultWrapper {
1616
return array[Number(prop)];
1717
}
1818

19-
// intercept array methods
19+
// intercept isNative
20+
if (prop === 'isNative') {
21+
return true;
22+
}
23+
24+
// intercept array props and methods
2025
if (typeof prop === 'string' && prop in Array.prototype) {
2126
const arrayMethod = (Array.prototype as any)[prop];
2227
if (typeof arrayMethod === 'function') {
2328
return (...args: any[]) => this.invokeArrayMethod(prop, ...args);
2429
}
25-
}
2630

27-
// intercept isNative
28-
if (prop === 'isNative') {
29-
return true;
30-
}
31-
32-
// intercept array length
33-
if (prop === 'length') {
34-
return this.getArray().length;
31+
return (this.getArray() as any)[prop];
3532
}
3633

3734
// intercept JSON.stringify or toJSON()

0 commit comments

Comments
 (0)