Skip to content

Commit 10b2aa4

Browse files
marcosmoskiChristian Sullivan
authored and
Christian Sullivan
committed
error on headerString[key].split(2,/:/) (#41)
* error on headerString[key].split(2,/:/) the last argument of array is a function, you can not do split on function i have added if(typeof headerString[key] != 'function') to fix it * Update ofx.js
1 parent c072c4b commit 10b2aa4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ofx.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ OFX.parse = function (ofxStr, fn) {
161161
data.header = {};
162162

163163
for(var key in headerString){
164-
var headAttributes = headerString[key].split(/:/,2);
164+
if (typeof headerString[key] === "string"){
165+
var headAttributes = headerString[key].split(/:/,2);
166+
}
165167
if (headAttributes[0]) data.header[headAttributes[0]] = headAttributes[1];
166168
}
167169
fn(data);

0 commit comments

Comments
 (0)