Giter Club home page Giter Club logo

bfj-collections's People

Contributors

hash-bang avatar mryellow avatar

Watchers

 avatar  avatar  avatar

Forkers

mryellow

bfj-collections's Issues

StackTop.push is not a function error

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: [] }

Parsing of nested arrays of objects results in empty array

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, () => {

})

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.