Skip to content

Commit 94c5fa8

Browse files
authored
use isInteger instead (#1444)
1 parent 9059150 commit 94c5fa8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/runner/src/storage/transaction-shim.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ export class StorageTransaction implements IStorageTransaction {
421421
return { ok: reader };
422422
}
423423

424-
read(address: IMemorySpaceAddress, options?: IReadOptions): Result<Read, ReadError> {
424+
read(
425+
address: IMemorySpaceAddress,
426+
options?: IReadOptions,
427+
): Result<Read, ReadError> {
425428
const readerResult = this.reader(address.space);
426429
if (readerResult.error) {
427430
return { ok: undefined, error: readerResult.error };
@@ -540,7 +543,10 @@ export class ExtendedStorageTransaction implements IExtendedStorageTransaction {
540543
return this.tx.reader(space);
541544
}
542545

543-
read(address: IMemorySpaceAddress, options?: IReadOptions): Result<Read, ReadError> {
546+
read(
547+
address: IMemorySpaceAddress,
548+
options?: IReadOptions,
549+
): Result<Read, ReadError> {
544550
return this.tx.read(address, options);
545551
}
546552

@@ -594,7 +600,7 @@ export class ExtendedStorageTransaction implements IExtendedStorageTransaction {
594600
for (const key of remainingPath) {
595601
nextValue =
596602
nextValue[key] =
597-
(!Number.isNaN(Number(key)) ? [] : {}) as typeof nextValue;
603+
(Number.isInteger(Number(key)) ? [] : {}) as typeof nextValue;
598604
}
599605
nextValue[lastKey] = value;
600606
const parentAddress = { ...address, path: lastValidPath ?? [] };

0 commit comments

Comments
 (0)