Here is the list of objects I'm trying to sort.
tcids: [
{
name: 'ABD3',
tcid: '2.A.3.1.1',
},
{
name: 'DDDS',
tcid: '1.A.3.2.4',
},
{
name: 'DSDG',
tcid: '2.A.3.2.1',
},
{
name: 'FFF',
tcid: '1.B.3.2.11',
},
]
I want these objects to be sorted by TCID, according to each decimal place. The numbers to the left are the highest priority, and the right are the lowest priority.
For example, 1.A.3.2.4 > 1.B.3.2.11 > 2.A.3.1.1 > 2.A.3.2.1.
I've seen some methods with _.sortBy, but those seem to expect my 'tcid' columns to be deconstructed into some array already. I have not been able to find a percise solution here on SO. Any help is much appreciated, thank you.