Skip to content

Commit d693a2b

Browse files
committed
Fix issues which are blocking the build pipeline
The wrong typecasting the `record.ts` was giving a `Type 'any' cannot be used to index type 'Entries'.` during the build. And it was fixed just by adjusting the type casting. The test case `Result Promise should call finally on error` was not handling correctly the error before call finally and it was giving `Unhandled promise rejection` error during the tests.
1 parent b3f9daa commit d693a2b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/record.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Record<
110110
*/
111111
forEach(visitor: Visitor<Entries, Key>): void {
112112
for (const [key, value] of this.entries()) {
113-
visitor(value as any, key as any, this)
113+
visitor(value, key as Key, this)
114114
}
115115
}
116116

@@ -128,7 +128,7 @@ class Record<
128128
const resultArray = []
129129

130130
for (const [key, value] of this.entries()) {
131-
resultArray.push(visitor(value as any, key as any, this))
131+
resultArray.push(visitor(value, key as Key, this))
132132
}
133133

134134
return resultArray
@@ -180,7 +180,7 @@ class Record<
180180
const obj: Entries = {} as Entries
181181

182182
for (const [key, value] of this.entries()) {
183-
obj[key as any] = value
183+
obj[key as Key] = value
184184
}
185185

186186
return obj

core/test/result.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ describe('Result', () => {
407407
it('should call finally on error', done => {
408408
streamObserverMock.onError(expectedError)
409409

410-
result.finally(done)
410+
result.catch(() => {}).finally(done)
411411
})
412412

413413
describe.each([

0 commit comments

Comments
 (0)