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

Fallback if column has only null #14

Closed
ximex opened this issue Jan 21, 2016 · 0 comments · Fixed by #15
Closed

Fallback if column has only null #14

ximex opened this issue Jan 21, 2016 · 0 comments · Fixed by #15

Comments

@ximex
Copy link

ximex commented Jan 21, 2016

If a column has only null values we cant calc the size for the buffer.
So i think a fallback to String would be fine.
Example:

function obj(_) {
    var fields = {}, o = [];
    for (var p in _) fields[p] = typeof _[p];
    for (var n in fields) {
        var t = types[fields[n]];
        o.push({
            name: n,
            type: t || 'C',
            size: fieldSize[t] || fieldSize['C']
        });
    }
    return o;
}
faandi added a commit to faandi/dbf that referenced this issue Apr 15, 2016
- include fields where all values are null
- do not overwrite existing fields with undefined or null, fixes mapbox#14
@tmcw tmcw closed this as completed in #15 May 16, 2016
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

Successfully merging a pull request may close this issue.

1 participant