add transformers to file helpers (#2922)

* fix undefined handling in INI

* beta.14

* Partial -> DeepPartial in action request

* boolean laziness kills

* beta.16

* misc fixes

* file transformers

* infer validator source argument

* simplify validator

* readd toml

* beta.17

* filter undefined instead of parse/stringify

* handle arrays of objects in filterUndefined
This commit is contained in:
Aiden McClelland
2025-05-06 11:04:11 -06:00
committed by GitHub
parent 97e4d036dc
commit 68955c29cb
10 changed files with 139 additions and 41 deletions

View File

@@ -35,10 +35,15 @@ export class CallbackHolder {
}
child(name: string): CallbackHolder {
this.removeChild(name)
const child = new CallbackHolder()
const child = new CallbackHolder(this.effects)
this.children.set(name, child)
return child
}
getChild(name: string): CallbackHolder | null {
return this.children.get(name) || null
}
removeChild(name: string) {
const child = this.children.get(name)
if (child) {
@@ -60,7 +65,9 @@ export class CallbackHolder {
callCallback(index: number, args: any[]): Promise<unknown> {
const callback = this.getCallback(index)
if (!callback) return Promise.resolve()
return Promise.resolve().then(() => callback(...args))
return Promise.resolve()
.then(() => callback(...args))
.catch((e) => console.error("callback failed", e))
}
onLeaveContext(fn: Function) {
this.onLeaveContextCallbacks.push(fn)