hash-bang / bfj-collections Goto Github PK
View Code? Open in Web Editor NEWHelper library for BFJ that specializes in arrays of objects
License: MIT License
Helper library for BFJ that specializes in arrays of objects
License: MIT License
Hello, while using bfjc I encountered a parsing error. It seems something about the structure of the object being parsed causes stackTop to break.
error TypeError: stackTop.push is not a function
at EventEmitter.emitter.on (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bfj-collections/index.js:44:14)
at EventEmitter.emit (events.js:198:13)
at then (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bfj/src/walk.js:327:19)
at tryCatcher (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromiseCtx (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/promise.js:611:10)
at _drainQueueStep (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/async.js:142:12)
at _drainQueue (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/tajimas/Dev/lexivore-ingestor/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
[
{
"occupation": [[], [{}]]
}
]
Returned object after breakage: { occupation: [] }
It seems that nested arrays of objects are not parsed properly.
Test data: [{"foo": "bar", "foo2": [1,2,3], "baz": [{"foo":"bar"}]}]
Expected result: property "baz" would have one object in it
Actual result: "baz" is an empty array
The nested array of numbers seems to work fine, though and "foo2" is parsed correctly.
example code snippet to reproduce:
var stream = fs.createReadStream("test.json", {encoding: 'utf8'});
bfjc(stream)
.on('bfjc', data => {
console.log(data);
})
.on(bfj.events.end, () => {
})
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.