juni-utils
v1.0.5
Published
Pacotes úteis para testes.
Downloads
10
Readme
Funções de formatação
Como installar?
npm i juni-utils ou yarn add juni-utils
Como usar?
const { formatCep } = require("juni-utils");
formatCep(value: number | string): Essa função irá formatar um CEP
formatPrice(value: number) Formata o valor inserido para moeda. Ex: 1000 => R$ 1000,00, 3937.09 => R$ 3937,09
waitForElement(func => Element): func(elementFound)
formataWA(str: string) => formattedString: string Formata um texto para o formato de rótulo no GA
elementIsVisible(target: Element, callback: Function, callbackNotVisible: Function, threshold: number) => void
| Parametro | Tipo | Descrição | | ------------------ | -------- | ------------------------------------------------------------------------------------ | | target | Element | Elemento que vai ser monitorado | | callback | Function | Função que vai ser executada quando o elemento estiver na tela | | callbackNotVisible | Function | Função que vai ser executada quando o elemento não na tela | | threshold | Number | Porcentagem que o elemento deve estar na tela pro callback ser executado. Default: 1 |