text2json
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -199,2 +199,5 @@ "use strict"; | ||
var _hash = {}; | ||
if (!this.columnFilters) { | ||
return _hash; | ||
} | ||
for (var i = 0; i < this.columnFilters.length; i++) { | ||
@@ -201,0 +204,0 @@ _hash[headers[this.columnFilters[i]]] = line[this.columnFilters[i]]; |
{ | ||
"name": "text2json", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Performant parser for textual data (CSV parser)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -227,2 +227,5 @@ import * as debug from 'debug' | ||
let _hash = {} | ||
if (!this.columnFilters) { | ||
return _hash | ||
} | ||
for (var i = 0; i < this.columnFilters.length; i++) { | ||
@@ -229,0 +232,0 @@ _hash[headers[this.columnFilters[i]]] = line[this.columnFilters[i]] |
@@ -197,3 +197,3 @@ import {ParserOptions, Parser} from '../src/index.js' | ||
it.only('ascii', (done) => { | ||
it('ascii', (done) => { | ||
let opt : ParserOptions = {hasHeader: true, encoding: 'ascii'} | ||
@@ -203,6 +203,6 @@ let sub = new Parser(opt) | ||
1,2,3 | ||
97,98,99` | ||
let expected = [ { a: '1', b: '2', c: '3' }, { a: '4', b: '5', c: 'J$' } ] | ||
4,5,ʤ` | ||
let expected = [ { a: '1', b: '2', c: '3' }, { a: '4', b: '5', c: 'ʤ' } ] | ||
sub.text2json(testItem, (err, actual)=>{ | ||
if(!_.isEqual(expected, actual)) { | ||
if(_.isEqual(expected, actual)) { | ||
logTestData(expected, actual) | ||
@@ -209,0 +209,0 @@ done (`Failed test for wrong_encoding`) |
48638
1234