Parameters for the normalization
The normalized array value (empty array if both inputs are empty/undefined)
// Only deprecated field provided
normalizeSingularToArray({
singularValue: 'class-1',
arrayValue: undefined,
}); // Returns ['class-1']
// Both provided - array takes precedence
normalizeSingularToArray({
singularValue: 'class-1',
arrayValue: ['class-2', 'class-3'],
}); // Returns ['class-2', 'class-3']
// Neither provided
normalizeSingularToArray({
singularValue: undefined,
arrayValue: undefined,
}); // Returns []
Normalize a deprecated singular field to an array field.
When both singular and array values are provided, the array takes precedence. If the array is empty/undefined but singular has a value, wraps it in an array.