Add filter to change or replace key names in an object.

The filter should take an object such as {'key1':'value1','key2':'value2', 'key3':'value3'} and provide a list of text to replace the key names e.g. ['mykey1','mykey2','mykey3'}

and return: {'mykey1':'myvalue1','key2':'myvalue2', 'key3':'value3'}.

WHY? At times, one needs to provide more descriptive keys to the frontend (a major/regular demand from frontend developers), that are not necessarily the same on the table columns. So, it would be great, if after all the manipulation on the function stack, one can change the key names as one wishes without much hassles.

Other
3 replies