Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten arrays to string #85

Open
Migaelh opened this issue Jun 4, 2019 · 2 comments
Open

Flatten arrays to string #85

Migaelh opened this issue Jun 4, 2019 · 2 comments

Comments

@Migaelh
Copy link

Migaelh commented Jun 4, 2019

Hi, I have a unique use-case, I am currently building a dynamic table based on an object's keys. So this does not work correctly when the object has an array associated with it. Would it be possible to add an additional parameter to specify that arrays should be strings with the safe option associated?

for example:
`flatten({
title:'Hello world',
countries: ['ZAF','USA','GRL']
}, {
safe:true,
arraytostring:true
});

//output:
// {
// title:'Hello World',
// countries: '["ZAF","USA","GRL"]'
`

If you do not want to add this functionality to your repo, can I clone the project and add this for my specific use-case?

@antony
Copy link

antony commented Jun 30, 2019

Hi @Migaelh - I have added this functionality in my own (released) fork. I think this project is abandoned.

https://github.com/antony/flatley

@Migaelh
Copy link
Author

Migaelh commented Jun 30, 2019

Thanks @antony, i also made a fork with this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants