If you have a type (as shown below) which has a property that begins with a numeric character (as a string or not!) encode and encodeDiff fail because they attempt to use dot notation obj.1 rather than square bracket notation obj['1'] for property access.