If you have any issues with macOS, or need anything related to it check this documentation
Install Xcode Command Line tools :
If you have any issues with macOS, or need anything related to it check this documentation
Install Xcode Command Line tools :
const arrayCompare = (a: string[], b: string[]) => { | |
if (a.length !== b.length) { | |
return false; | |
} | |
for (const item of a) { | |
if (b.indexOf(item) === -1) { | |
return false; | |
} | |
} |
Number(5).toLocaleString('pt-BR', {style: 'currency',currency: 'BRL'}) |
// {...} | |
<div> | |
<form> | |
<input placeholder="Name" {...formik.getFieldProps("name")} /> | |
<br /> | |
<input placeholder="Email" {...formik.getFieldProps("email")} /> | |
<br /> | |
<input placeholder="Password" {...formik.getFieldProps("password")} /> | |
<br /> | |
<input |
import React from "react"; | |
import { useFormik } from "formik"; | |
const initialValues = { | |
name: "", | |
email: "", | |
address: { | |
street: "", | |
number: "", | |
city: "" |
const removeAcentos = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") |
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"jest": true | |
}, | |
"settings": { | |
"react": { | |
"version": "detect" | |
} |
const convert = (src, goToRight) => { | |
const img = new Image() | |
const canvas = document.createElement('canvas') | |
const ctx = canvas.getContext('2d') | |
img.crossOrigin = 'Anonymous' | |
img.onload = () => { | |
canvas.width = img.width | |
canvas.height = img.height | |
goToRight | |
? ctx.transform(0, -1, 1, 0, 0, img.height) |
{ | |
"parser": "@typescript-eslint/parser", | |
"extends": [ | |
"plugin:react/recommended", | |
"plugin:@typescript-eslint/recommended", | |
], | |
"parserOptions": { | |
"ecmaVersion": 2018, | |
"sourceType": "module", | |
"ecmaFeatures": { |
export function cpfMask (value) { | |
return value | |
.replace(/\D/g, '') | |
.replace(/(\d{3})(\d)/, '$1.$2') | |
.replace(/(\d{3})(\d)/, '$1.$2') | |
.replace(/(\d{3})(\d{1,2})/, '$1-$2') | |
.replace(/(-\d{2})\d+?$/, '$1') | |
} | |
export function cnpjMask (value) { |