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

Needs a method to determine if no batches, or all batches are empty #23

Open
turntayble81 opened this issue Mar 20, 2017 · 0 comments
Open

Comments

@turntayble81
Copy link

I have a use case where I don't want to generate a file if there are no batches, or all batches have 0 entries. I created the following code to do this, but it would be better added to this project:

const entryCount = (this.file._batches || []).map((batch) => {
    return (batch._entries || []).length;
}).reduce((acc, val) => {
    return acc + val;
}, 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

1 participant