Closed scheidtdav closed 1 year ago
Can this not be more dynamic, basically im thinking along the lines of
export function customArray(
fields?: Record<string, string>
settings?: CustomArraySettings
): Record<string, string>[];
basically the idea stems from the way the function currently works
i can call
countryCodes.customArray({ name: '{countryNameEn}',
value: `[{countryCode}] {${CountryProperty.officialLanguageCode}}`,})
=> [{name: United States of America, value: [US] en}]
but if i call the following the results are still as expected
countryCodes.customArray({
label: '{countryNameEn}',
value: [{countryCode}] {${CountryProperty.officialLanguageCode}}
,
callingCode: '{countryCallingCode}',
})
=> [{label: United States of America, value: [US] en, callingCode: 1}]
Hey @Frank-vdm,
you are right, its probably a lot better by using something like what you proposed. My PR was mostly for fixing the fact that it seems straight up wrong in the current release. Happy to close this one in favor of one thats more sophisticated, if you like to contribute (looks like you just did that in #31, should we close this?). It has been over a month though, since I opened this PR. I am not sure if @LucianoGanga is planning a release of this library?
Cheers
Yea I did do a quick pr, I'm hoping for some movement here
Sweet. Closing this in favor of #31 then. That will fix #25 as well.
Fix for #25 plus I added
customArray
to the README.md for good measure :)