Last active
February 16, 2022 17:47
-
-
Save ddanielsantos/814aa89fc5421e258b3220824d6bdabf to your computer and use it in GitHub Desktop.
JS Tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function removePropriedadesNumeradas<T extends Object>(objetoComNumero: T): Partial<T> { | |
| const objetoTratado: Partial<T> = {} | |
| const propriedades = Object.keys(objetoComNumero) as Array<keyof typeof objetoComNumero> | |
| for (let index = 0; index < propriedades.length; index++) { | |
| if (isNaN(Number(propriedades[index]))) { | |
| objetoComNumero[propriedades[index]] = propriedades[index] | |
| } | |
| } | |
| return objetoTratado | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment