Code Monkey home page Code Monkey logo

Comments (3)

kaue avatar kaue commented on June 16, 2024

Indeed looks like the problem is because we are doing col || '' at
https://github.com/kaue/jsonexport/blob/master/lib/parser/csv.js#L89

Thats an pretty easy fix, i would replace that with something like col == null ? '' : col
Feel free to open a pull request for this fix if you have time. Otherwise i will prob work on this later tonight.

We should probably include a test to make sure this does not happen in the future as well.

@gannons thanks for taking the time to report and also for pointing out where the issue is :)

from jsonexport.

kaue avatar kaue commented on June 16, 2024

should be fixed in jsonexport v3.0.1

from jsonexport.

g-ongenae avatar g-ongenae commented on June 16, 2024

Still having this issue. (ts-node: v9.0.0, nodejs: 14.13.1, jsonexport: v3.0.1) But only on object not on array, for instance:

Input:

const value = {
  name: "Bob",
  lastName: "Smith",
  age: 0,
  family: {
    name: "Peter",
    type: "Father",
    size: 0,
  },
  location: [1231, 3214, 4214, 0],
};

jsonexport(value)
  .then(console.log)
  .catch(console.error);

Output:

name,Bob
lastName,Smith
age,
family.name,Peter
family.type,Father
family.size,
location,1231;3214;4214;0

from jsonexport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.