Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
llparse peek() caracteres con múltiples puntos de código

Estoy tratando de modificar llhttp, un cliente HTTP basado en llparse, para admitir NTRIP (un protocolo basado en HTTP). Para hacerlo, necesito echar un vuezo a '\u{D3}' (coincidir pero no consumir) y realizar una prueba, de lo contrario, iniciar un lapso.

El problema es que peek() solo funciona con un solo carácter y '\u{D3}' cuenta como 2 ( '\u{C3}\u{93}' ). ¿Cómo echaría un vuezo a varios caracteres o volvería a anteponer el primer carácter?

Esto es lo que tenía:

 n('header_field_start') // Match node
 .match('\r', n('headers_almost_done'))
 .peek('\n', n('headers_almost_done'))
 .peek(
 '\u{D3}', // 2 characters
 this.testLenientFlags(
 LENIENT_FLAGS.NTRIP, 
 {
 1: this.invokePausable('on_chunk_complete', ERROR.CB_CHUNK_COMPLETE, 'message_done') // If NTRIP is set
 },
 p.error(ERROR.INVALID_VERSION, 'Invalid major version') // Otherwise
 )
 )
 .otherwise(span.headerField.start(n('header_field')));

// Defined earlier...
private testLenientFlags(flag: LENIENT_FLAGS, map: { [key: number]: Node }, next?: string | Node): Node {
 const p = this.llparse;
 const res = p.invoke(p.code.test('lenient_flags', flag), map);
 if (next !== undefined) {
 res.otherwise(this.node(next));
 }
 return res;
}
almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!