toJSON

The toJSON() method of the TrustedScript interface returns a JSON representation of the stored data.

MDN Reference