This file contains 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
Show hidden characters
{ | |
"extends": ["eslint:recommended", "prettier", "prettier/react"], | |
"plugins": [], | |
"parserOptions": { | |
"ecmaVersion": 2016, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, |
This file contains 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
node_modules/ | |
.DS_Store | |
.cache/ | |
dist/ | |
coverage/ | |
.vscode/ | |
.env |
This file contains 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 argv = require('minimist')(process.argv.slice(2)); | |
const fse = require('fs-extra'); | |
const { p, s } = argv; | |
if (!p|| !s) { | |
console.info('-p: problem number'); | |
console.info('-s: solution name'); | |
console.error('Please enter problem number and solution name.'); | |
process.exit(-1); |
This file contains 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
// 通过 typeof 来查看每种数据类型的描述 | |
// [undefined, null, true, '', 0, Symbol(), {}].map(it => typeof it) | |
// ["undefined", "object", "boolean", "string", "number", "symbol", "object"] | |
function clone(obj) { | |
// 添加一个 WeakMap 来记录已经拷贝过的对象,如果当前对象已经被拷贝过,那么直接从 WeakMap 中取出,否则重新创建一个对象并加入 WeakMap 中 | |
// ES6 推出的 WeakMap 对象,该对象是一组键/值对的集合,其中的键是弱引用的。其键必须是对象,而值可以是任意的 | |
let map = new WeakMap(); | |
function deep(data) { |
This file contains 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
// App.tsx | |
import { Button } from "./components/Button" | |
function App() { | |
return ( | |
<div className="App"> | |
<Button | |
onClick={(e) => { | |
e.preventDefault() |
This file contains 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
TypeScript 1 hr 2 mins ████████▉░░░░░░░░░░░░ 42.5% | |
Other 27 mins ████░░░░░░░░░░░░░░░░░ 19.1% | |
HTML 15 mins ██▏░░░░░░░░░░░░░░░░░░ 10.3% | |
Bash 14 mins ██░░░░░░░░░░░░░░░░░░░ 9.7% | |
Git Config 12 mins █▋░░░░░░░░░░░░░░░░░░░ 8.2% |