Skip to content

Commit 63ee25e

Browse files
CopilotDevilTea
andcommitted
fix: resolve TypeScript strict type checking errors
Co-authored-by: DevilTea <16652879+DevilTea@users.noreply.github.com>
1 parent 74f8ed0 commit 63ee25e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

packages/internal/src/shared/shared.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,18 @@ export class Pipe<I = unknown, O = I> {
9797
if (result instanceof Promise) {
9898
// Once we hit async, chain all remaining functions
9999
for (let j = i; j < len; j++) {
100-
result = result.then(fns[j])
100+
const fn = fns[j]
101+
if (fn) {
102+
result = result.then(fn)
103+
}
101104
}
102105
return result
103106
}
104107
// Execute function synchronously
105-
result = fns[i](result)
108+
const fn = fns[i]
109+
if (fn) {
110+
result = fn(result)
111+
}
106112
}
107113
return result
108114
}

packages/internal/src/steps/object/object.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const object = implStepPlugin<PluginDef>({
138138

139139
// First pass: process synchronously until we hit async
140140
for (let i = 0; i < keysLen; i++) {
141-
const key = keys[i]
141+
const key = keys[i]!
142142
const isOptional = Array.isArray(struct[key]!)
143143
const propSchema = Array.isArray(struct[key]!) ? struct[key]![0]! : struct[key]!
144144
const propValue = (value as any)[key]
@@ -153,7 +153,7 @@ export const object = implStepPlugin<PluginDef>({
153153

154154
// Chain remaining properties
155155
for (let j = i + 1; j < keysLen; j++) {
156-
const nextKey = keys[j]
156+
const nextKey = keys[j]!
157157
const nextIsOptional = Array.isArray(struct[nextKey]!)
158158
const nextPropSchema = Array.isArray(struct[nextKey]!) ? struct[nextKey]![0]! : struct[nextKey]!
159159
const nextPropValue = (value as any)[nextKey]

packages/internal/src/steps/strictObject/strictObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export const strictObject = implStepPlugin<PluginDef>({
159159

160160
// First pass: process synchronously until we hit async
161161
for (let i = 0; i < keysLen; i++) {
162-
const key = keys[i]
162+
const key = keys[i]!
163163
const isOptional = Array.isArray(struct[key]!)
164164
const propSchema = Array.isArray(struct[key]!) ? struct[key]![0]! : struct[key]!
165165
const propValue = (value as any)[key]
@@ -174,7 +174,7 @@ export const strictObject = implStepPlugin<PluginDef>({
174174

175175
// Chain remaining properties
176176
for (let j = i + 1; j < keysLen; j++) {
177-
const nextKey = keys[j]
177+
const nextKey = keys[j]!
178178
const nextIsOptional = Array.isArray(struct[nextKey]!)
179179
const nextPropSchema = Array.isArray(struct[nextKey]!) ? struct[nextKey]![0]! : struct[nextKey]!
180180
const nextPropValue = (value as any)[nextKey]

0 commit comments

Comments
 (0)