Hello there!
Sorry for the late response, but I believe that you should be able to replace this line:
this.sketchObject.CSSAttributes()
with this:
this.sketchObject.CSSAttributeString().split('\n')
which will produce essentially the same results. See also Function to get CSS Attributes removed from API?
Let me know if this works for you!