Merge pull request #31007 from Xapphire13/patch-1

fix [SerialPort]: Change `data` -> `delimiter` in ready-parser options
This commit is contained in:
Jesse Trinity
2018-12-14 14:49:09 -08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ declare namespace SerialPort {
constructor(options: {delimiter: string | Buffer | number[], encoding?: 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex'});
}
class Ready extends Stream.Transform {
constructor(options: {data: string | Buffer | number[]});
constructor(options: {delimiter: string | Buffer | number[]});
}
class Regex extends Stream.Transform {
constructor(options: {regex: RegExp});
+1 -1
View File
@@ -107,7 +107,7 @@ function test_parsers() {
const CCTalkParser = new SerialPort.parsers.CCTalk();
const DelimiterParser = new SerialPort.parsers.Delimiter({ delimiter: Buffer.from('EOL') });
const ReadlineParser = new SerialPort.parsers.Readline({ delimiter: '\r\n' });
const ReadyParser = new SerialPort.parsers.Ready({ data: 'READY' });
const ReadyParser = new SerialPort.parsers.Ready({ delimiter: 'READY' });
const RegexParser = new SerialPort.parsers.Regex({regex: /.*/});
port.pipe(ByteLengthParser);