Run the script below in your Browser's DevTools console at https://www.tibia.com/library/?subtopic=boostablebosses.
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
// @ts-check | |
import glob from 'glob' | |
/** | |
* @param {string} path | |
* @returns {Promise<string[]>} | |
*/ | |
function getFiles(path) { | |
return new Promise((resolve, reject) => { |
- Substituir o Yarn pelo npm
- Substituir o bili pelo Rollup
- Substituir o AVA pelo Jest
- Substituir o Travis CLI pelo GitHub Actions
- Substituir o
Dockerfile
por umdocker-compose.yaml
- Adicionar Prettier
- Adicionar ESLint (com plugins para Prettier e TypeScript)
- Refazer a arquitetura
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
declare namespace NodeJS { | |
interface ProcessEnv { | |
/** | |
* Always set to `true`. | |
*/ | |
CI: true; | |
/** | |
* The name of the action currently running, or the | |
* [`id`](/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsid) |
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 type SplitPath from './Split.js'; | |
import test from 'ava'; | |
type Assert<TypeA, TypeB> = [TypeB] extends [TypeA] ? true : false; | |
test("returns 'never' for invalid paths", (context) => { | |
const assertions: true[] = [ | |
true as Assert<SplitPath<''>, never>, | |
true as Assert<SplitPath<'.'>, never>, | |
true as Assert<SplitPath<'a.'>, never>, |
React.js components podem ser definidos de diferentes formas, entre elas:
-
Como classes filhas das classes
Component
ePureComponent
.import { PureComponent } from 'react'; class Button extends PureComponent {
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 mockNanoId from '__mocks__/mockNanoId'; | |
import { render } from '@testing-library/react'; | |
import Home from './Home'; | |
describe('Home | component | integration test', () => { | |
beforeEach(mockNanoId); | |
it('renders the home page', () => { | |
const { container } = render(<Home />); | |
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 { useCallback, useMemo } from 'react'; | |
import generateHash from './generateHash.js'; | |
export type Identify = (name: string) => string; | |
function useIdentify(): Identify { | |
const ids = useMemo(() => new Map<string, string>(), []); | |
return useCallback((name) => { | |
if (!ids.has(name)) { |
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
version: '3' | |
services: | |
server: | |
container_name: server | |
working_dir: /app | |
command: npm run start | |
volumes: | |
- ./:/app | |
- ./node_modules:/app/node_modules |
NewerOlder