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

116
Views
Equivalente JS para strconv.Quote de Golang

Dado un YAML como este:

 --- body: "something else" path: site:^example\.com?"something"..."something" title: "How to do this"

al analizarlo usando yaml-ast-parser , da como resultado un YAML no válido debido al punto en la expresión regular y las comillas. Puedo extraer el valor de path y comillas dobles con strconv.Quote y eso da como resultado un YAML final como este:

 --- body: "something else" path: "site:^example\\.com?\"something\"...\"something\"" title: "How to do this"

Sin embargo, strconv.Quote es un método golang y este es un proyecto javascript. ¿Alguien sabe una forma en que puedo lograr strconv.Quote en un entorno de javascript?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Para obtener algo similar a strconv.Quote , use JSON.stringify :

 // Example value you got from the YAML: const path = String.raw`site:^example\.com?"something"..."something"`; console.log("before"); console.log(path); console.log("after"); console.log(JSON.stringify(path));

about 4 years ago · Santiago Gelvez Report
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!