Desired Behavior
Currently serializers are using JSON.stringify/JSON.parse. Any plans to support custom serializers to support non serializable json data? Just ran into a gotcha case where Date was serialized to string but still typed as a Date in step output.
Example Usage
const backend = BackendSqlite.connect(dbPath, { serializer: {
serialize(data) {
return devalue.stringify(data)
},
deserialize(data: string) {
return devalue.parse(data)
}
})
If there are no plans to support custom serializers, i guess it might be good to type StepOutputs in a way that makes typescript complain errors when output returned are not serializable
Maybe Output extends JsonValue or something
export interface StepApi {
run: <Output extends JsonValue>(
config: Readonly<StepFunctionConfig>,
fn: StepFunction<Output>,
) => Promise<Output>;
}
Desired Behavior
Currently serializers are using JSON.stringify/JSON.parse. Any plans to support custom serializers to support non serializable json data? Just ran into a gotcha case where Date was serialized to string but still typed as a Date in step output.
Example Usage
If there are no plans to support custom serializers, i guess it might be good to type StepOutputs in a way that makes typescript complain errors when output returned are not serializable
Maybe Output extends JsonValue or something