isBase64URL
Verifica se uma string está codificada em Base64URL.
Sintaxe
typescript
isBase64URL(value: string): booleanParâmetros
| Nome | Tipo | Descrição |
|---|---|---|
value | string | A string a ser verificada |
Retorno
| Tipo | Descrição |
|---|---|
boolean | Retorna true se a string estiver em formato Base64URL, caso contrário, retorna false. |
Exemplo
typescript
isBase64URL("U29tZV9kYWRvLQ"); // true
isBase64URL("U29tZSBkYWRv"); // false
isBase64URL(12345); // lança TypeErrorNotas
- Lança um
TypeErrorse o valor não for uma string. - Base64URL utiliza os caracteres
A-Z,a-z,0-9,_e-.
