Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream does not support typeHandlers option #102

Open
setheal opened this issue Sep 20, 2021 · 3 comments
Open

Stream does not support typeHandlers option #102

setheal opened this issue Sep 20, 2021 · 3 comments

Comments

@setheal
Copy link

setheal commented Sep 20, 2021

Hello,

I'm currently using the version 3.2.0 with the stream mode and apparently it's not possible to pass the typeHandlers options.

I checked a bit the code and I think the issue is located here :

const isOptions = objectKeys.every((key) => defaultKeys.includes(key));

@AckerApple
Copy link
Collaborator

A recommendation for more details as to what you are trying to accomplish and how you are trying to accomplish that.

I'm not able to connect enough dots with the information provided. I do assume you are trying to pass in individual typeHandlers but I can't related that to the coded provided.

If you do perhaps understand there is an issue and room for improvement, perhaps make a PR to better illustrate what's wrong and needing fixed

@setheal
Copy link
Author

setheal commented Sep 21, 2021

Yes, sorry for that.

I'm getting a stream of json data from a database and I want to transform a bit the CSV output.

I tried this to check how it was working :

esStream.pipe(
    jsonexport({
      typeHandlers: {
        Object: (value) => {
          return 'test';
        }
      },
      rename: schema.list.displayed.map(
        (property) => property[language] || property.en
      )
    })
  )
    .pipe(res);

But I got this error TypeError: dest.on is not a function.
I tried the version 2.5.2 and it's working fine on this version.

@jaichandra
Copy link

jaichandra commented Aug 26, 2022

I get this error just for passing options to jsonexport when using stream. Doesn't matter which options you have.
Im using 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants