Skip to content

Commit

Permalink
refactor: update value-parser collation read
Browse files Browse the repository at this point in the history
fixes lint issue and also failing test
  • Loading branch information
mShan0 committed Jul 15, 2022
1 parent 9687fd7 commit 0ae76f5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/value-parser.ts
Expand Up @@ -458,17 +458,15 @@ function readVariant(parser: Parser, options: ParserOptions, dataLength: number,
case 'VarChar':
case 'Char':
return parser.readUInt16LE((_maxLength) => {
readCollation(parser, (collation) => {
readChars(parser, dataLength, collation.codepage!, callback);
});
const collation = readCollation(parser);
readChars(parser, dataLength, collation.codepage!, callback);
});

case 'NVarChar':
case 'NChar':
return parser.readUInt16LE((_maxLength) => {
readCollation(parser, (_collation) => {
readNChars(parser, dataLength, callback);
});
readCollation(parser);
readNChars(parser, dataLength, callback);
});

default:
Expand Down

0 comments on commit 0ae76f5

Please sign in to comment.