There was a bug that prevented loading 'Color Category' column from properly loading from a CSV import. There was a hard-to-grok one liner that transformed parsed CSV headers from matching the header values exactly to lower cased values that still contained spaces. ex. 'Set' becomes 'set', 'Collector Number' becomes 'collector number', etc.
Then an object unpacking renamed the keys with spaces to camelCase. This rename is case sensitve still, so the line trying to rename the key 'Color Category' to 'colorCategory' would fail silently (the value would be undefined).
To fix the bug and make the transformation more clear, we now transform the header keys from 'Words With Spaces' to 'camelCaseWords' in one step. This is extracted into a named helper method for further clarity.
fixes #2458
There was a bug that prevented loading 'Color Category' column from properly loading from a CSV import. There was a hard-to-grok one liner that transformed parsed CSV headers from matching the header values exactly to lower cased values that still contained spaces. ex. 'Set' becomes 'set', 'Collector Number' becomes 'collector number', etc.
Then an object unpacking renamed the keys with spaces to camelCase. This rename is case sensitve still, so the line trying to rename the key 'Color Category' to 'colorCategory' would fail silently (the value would be undefined).
To fix the bug and make the transformation more clear, we now transform the header keys from 'Words With Spaces' to 'camelCaseWords' in one step. This is extracted into a named helper method for further clarity.