sodiray / radash

Functional utility library - modern, simple, typed, powerful
https://radash-docs.vercel.app
MIT License
4.18k stars 167 forks source link

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

Open stefaanMLB opened 9 months ago

stefaanMLB commented 9 months ago
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

Balvajs commented 6 months ago

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

stefaanMLB commented 6 months ago

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

Balvajs commented 6 months ago

@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 🤞

aleclarson commented 1 month ago

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.