Fix TypeScript errors in discriminator implementation
- Changed DiscriminatorInfo.values type from string[] to ReadonlyArray<string> to match discriminatorValues return type
- Added null check for array item access to prevent possibly undefined errors
- Changed required array mutation from push to spread operator to work with readonly arrays
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>