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

Trim option does not work #454

Open
JimmyBeldone opened this issue Oct 19, 2022 · 1 comment
Open

Trim option does not work #454

JimmyBeldone opened this issue Oct 19, 2022 · 1 comment

Comments

@JimmyBeldone
Copy link

Hi,

Thanks for your amazing work !

It seems that trim default value option does not work, even if I add it top options.

This is my test :

const csv = require('csvtojson');

const csvFilePath = 'src/contents/csv/projects.csv';

csv({ trim: true })
    .fromFile(csvFilePath)
    .then((jsonObj) => {
        console.log(jsonObj);
    });

And a part of the output :

...,
{
    type_de_travaux: 'Démolir ',
    stars_number: '4.5',
    stars_vote: '0',
  },
...,

Am I doing something wrong ?

I tried adding space at the beginning of a string and the result is the same.

@edeebee
Copy link

edeebee commented Mar 29, 2023

same here

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