If you're worried about the property existing at all, just do `"sourceCode" in data` as your check.  If you're worried about it being a string, `typeof(data.sourceCode) === "string"`.  I just get nervous when I see checks for things being `undefined`, it's not necessarily a problem here.