alexewerlof / combine-json Goto Github PK
View Code? Open in Web Editor NEWCombines a group of files into one JavaScript object
Home Page: https://www.npmjs.com/package/combine-json
License: Other
Combines a group of files into one JavaScript object
Home Page: https://www.npmjs.com/package/combine-json
License: Other
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!
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.