isScript

fun isScript(value: JsAny?): Boolean(source)

The isScript() method of the TrustedTypePolicyFactory interface returns true if it is passed a valid TrustedScript object.

MDN Reference