Typescript If Not Empty Python Dictionary Append Key