quirrel-dev / quirrel

The Task Queueing Solution for Serverless.
https://quirrel.dev
MIT License
883 stars 67 forks source link

Using a date type in the payload of a queue results in a string type #163

Closed Steffan-Harris closed 3 years ago

Steffan-Harris commented 3 years ago

Bug Report

Current Behavior When I set the input parameter of the Queue function to a date type and pass in a date to the enqueue function, the type of the parameter is a string.

Input Code

export default Queue(
  "api/generateRosterQueue", // the path of this API route
  async (date: Date) => {
    console.log(`Generate roster task executing for date: ${typeof date}`)
  }
)

await GenerateRosterQueue.enqueue(new Date())

Expected behavior/code I expect the tyoeof date to return a Date type, but it returns a string

Environment

Additional context/Screenshots

Screenshot 2021-03-05 at 16 01 48
Skn0tt commented 3 years ago

Hi @scisteffan, thanks for opening this issue! Definitely a good idea. I'll put up a PR to integrate SuperJSON, that should solve it :)