radash icon indicating copy to clipboard operation
radash copied to clipboard

crush() doesn't handle dots in property names well

Open stefaanMLB opened this issue 2 years ago • 4 comments

import { crush } from 'radash';
const test = {
  prop1: 'value1',
  'prop2.sub1': 'value2',
  prop3: {
    prop4: 'value4',
    'prop5.sub2': 'value5'
  }
};
console.log(crush(test));

outputs

{
  prop1: 'value1',
  'prop2.sub1': undefined,
  'prop3.prop4': 'value4',
  'prop3.prop5.sub2': undefined
}

Whenever there is a dot in a proptery name, the value is undefined. Even is I'm pushing the limits by having the dots in the property names, these's still no reason for the values to be undefined

stefaanMLB avatar Nov 29 '23 16:11 stefaanMLB

+1 for this issue. @stefaanv I see you had a PR for this, but it got closed. Was it not working?

Balvajs avatar Mar 06 '24 14:03 Balvajs

@Balvajs no, the repo seems to have been abandonned, unfortunately. A shame really because it's a really good initiative.

stefaanMLB avatar Mar 07 '24 07:03 stefaanMLB

@stefaanMLB oh no 😕 Do you know if there is some statement somewhere or more info about abandoning this repo? 2 weeks ago the author made a release, so maybe he could be back 🤞

Balvajs avatar Mar 07 '24 09:03 Balvajs

Hi @Balvajs, this is fixed in the Radashi fork (#95). A lot of other stuff has been added/fixed too.

You can use it today by installing radashi@beta (see changelog here). An official release is pending. If you have any more ideas or feedback, consider sharing it here.

aleclarson avatar Jul 23 '24 15:07 aleclarson