In frontend, how to deserialize data serialized by php?

I am pulling some data from a database using Graphql, but I noticed that some data are actually serialized by PHP,I looked for a package to quickly deserialize the data but I didn’t find one. I tried myself using Regex but I spent many hours without luck.

Knowing that the type of serialized data is: array, string, number.

Any efficient way to do so? (Package or Code)

Thanks in advance.