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
| <select> | |
| <option>Afghanistan</option> | |
| <option>Akrotiri</option> | |
| <option>Albania</option> | |
| <option>Algeria</option> | |
| <option>American Samoa</option> | |
| <option>Andorra</option> | |
| <option>Angola</option> | |
| <option>Anguilla</option> | |
| <option>Antarctica</option> |
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
| const products = [ | |
| {id: 1, title: "Trim Dress", category: "women", collection: ["new", "featured"]}, | |
| {id: 2, title: "Belted Dress", category: "women", collection: ["featured"]}, | |
| {id: 3, title: "Fitted Dress", category: "men", collection: ["new"]} | |
| ]; | |
| const categories = new Set( | |
| products.map(product => product.category) | |
| ); |
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
| const getColor = () => "red"; | |
| const color = getColor(); | |
| ({ | |
| red: () => alert("Vermelho"), | |
| blue: () => alert("Azul") | |
| }[color]?.()); | |
| // OR |
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
| import api from 'api.js'; | |
| export default endpoint => ({ | |
| get: (id = "") => api.get(`${endpoint}/${id}`), | |
| create: data => api.post(`${endpoint}`, data), | |
| update: ({ id, ...data }) => api.put(`${endpoint}/${id}`, data), | |
| patch: ({ id, ...data }) => api.patch(`${endpoint}/${id}`, data), | |
| delete: id => api.delete(`${endpoint}/${id}`), | |
| filterBy: params => api.get(`${endpoint}`, { params }) | |
| }); |
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
| const apiURL = "https://brasilapi.com.br/api"; | |
| const endpoint = `${apiURL}/cep/v2`; | |
| /** | |
| * @typedef IPayload | |
| * @type {object} | |
| * @property {string} cep | |
| * @property {string} state | |
| * @property {string} city | |
| * @property {string} neighborhood |
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
| ... | |
| transform: { | |
| '^.+\\.(t|j)sx?$': [ | |
| '@swc/jest', | |
| { | |
| jsc: { | |
| parser: { | |
| syntax: 'typescript', | |
| tsx: true, | |
| decorators: true, |
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
| import { useSlugify } from "./useSlugify"; | |
| const slugify = useSlugify(); | |
| console.log(slugify("São Paulo")); |
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
| const list = [ | |
| { name: "Marcelo Ribeiro", short_name: "tchelo" }, | |
| { name: "Leonardo Costa", short_name: "leo" }, | |
| { name: "Victor Tanure", short_name: "vitrola" }, | |
| { name: "Matheus Oliveira", short_name: "rary" } | |
| ]; | |
| let filteredList = [...list]; | |
| const searchProps = ["name", "short_name"]; | |
| let timeout = null; | |
| const removeAccents = (text) => { return text; }; |
OlderNewer