Coder Social home page Coder Social logo

combine-json's People

Contributors

alexewerlof avatar techeverri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

combine-json's Issues

Race condition in processing directories and files

This bug affects all previous versions of combine-json.

If a folder has the following structure:

/parent
  child.json // { "x": "X", "y": "Y" }
  /child/a.json
  /child/b.json
  /child/c.json

Depending on which one gets processed first, the result may be partial. For example if the order is this:

  /child/a.json
  child.json
  /child/b.json
  /child/c.json

Then whatever is set in a.json is ignored. This is due to how lodash.set() works:

const o = {}
_.set(o, ['a', 'b', 'c'], { foo_c: 'bar_c' })
// { a: { b: { c: { foo_c: "bar_c" } } } }
_.set(o, ['a', 'b'], { foo_b: 'bar_b' })
// { a: { b: foo_b: "bar_b" } } } }
// notice that foo_c disappeared!

Invalid parsing on Windows

Parses are invalid and test fails on a Windows device because of the imported sep which return \ when the path returned is /. It seems like the path returned defaulted to / on some time. It will cause error such as numerated json file in a folder (0.json, 1.json...) does not result in an array,

If you are facing this issue change const parts = path.split(sep) from sep to "/". Not sure if it applies to other Windows (10) or Node version (mine is v16.13.2).

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.