Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

315
Visualizações
Terser: Annotate function as always pure (and what does it mean)

To assist with optimization Terser supports the pure comment to indicate that a function call is pure. Specifically, the docs give only the following example.

const x = /*#__PURE__*/i_am_dropped_if_x_is_not_used()

But, usually, if I define a pure function every use of it is pure. Is there a way to use comments to indicate that the function is always pure? If not do I have to manually list out the functions and pass them into the pure_funcs option?

--

Also, does the pure annotation really require that that the function be pure in a mathematical/functional programming sense, or is it enough that it be idempotent? For instance, if the function getModel(id) keeps a cache behind the scenes to improve performance will it cause problems if I mark it as pure?

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda