Skip to content

Commit cb54cf5

Browse files
committed
chore: change deprecated string method
1 parent 84f088b commit cb54cf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/csv2json.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const Csv2Json = function(options: FullCsv2JsonOptions) {
114114
splitLine.push('');
115115
} else {
116116
// Otherwise, there's a valid value, and the start index isn't the current index, grab the whole value
117-
splitLine.push(csv.substr(stateVariables.startIndex));
117+
splitLine.push(csv.substring(stateVariables.startIndex));
118118
}
119119

120120
// Since the last character is a comma, there's still an additional implied field value trailing the comma.
@@ -310,7 +310,7 @@ export const Csv2Json = function(options: FullCsv2JsonOptions) {
310310
lastChar = fieldValue[lastIndex];
311311
// If the field starts and ends with a wrap delimiter
312312
if (firstChar === options.delimiter.wrap && lastChar === options.delimiter.wrap) {
313-
return fieldValue.substr(1, lastIndex - 1);
313+
return fieldValue.substring(1, lastIndex - 1);
314314
}
315315
return fieldValue;
316316
}

0 commit comments

Comments
 (0)