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
| type Santa = "🎅"; | |
| type Alley = " "; | |
| type MazeMatrix = MazeItem[][]; | |
| type MazeItem = "🎄" | "🎅" | " "; | |
| type Directions = "up" | "down" | "left" | "right"; | |
| type FindSantaCol< | |
| T extends MazeItem[], | |
| A extends any[] = [], | |
| AL extends number = A["length"], |
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
| class StorageHelper { | |
| private storage: Storage; | |
| private tempStorage: Record<string, string> = {}; | |
| public isStorageAvailable: boolean; | |
| constructor(storage: "sessionStorage" | "localStorage") { | |
| this.storage = window[storage]; | |
| this.isStorageAvailable = this.checkIfStorageAvailable(); | |
| } |
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 path = require("path"); | |
| function replacePathAlias(currentFilePath, importPath, pathMap) { | |
| // if windows env, convert backslashes to "/" first | |
| console.log(currentFilePath) | |
| currentFilePath = path.posix.join(...currentFilePath.split(path.sep)); | |
| const regex = createRegex(pathMap); | |
| return importPath.replace(regex, replacer); |
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 { Provider } from 'react-redux'; | |
| import { Router } from 'react-router-dom'; | |
| import { SWRConfig } from 'swr'; | |
| import { MuiThemeProvider } from '@material-ui/core'; | |
| import { SnackbarProvider } from 'notistack'; | |
| import { MuiPickersUtilsProvider } from '@material-ui/pickers'; | |
| export const Providers = ({ | |
| children, | |
| history, |
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
| // js | |
| const modifyClassList = ( | |
| method: string, | |
| ids: Array<string>, | |
| classStyle: Array<string>, | |
| ) => { | |
| let el: any; | |
| ids.forEach((id: string) => { | |
| el = document.querySelector(id); | |
| if (el) { |
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 React from 'react'; | |
| // types | |
| import type { ButtonProps, DialogProps } from '@material-ui/core'; | |
| // mui | |
| import { | |
| Box, | |
| Button, | |
| Dialog as MUIDialog, |
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
| interface SWRProps { | |
| api: keyInterface; | |
| children?: Function | null; | |
| options?: any; | |
| showRetry?: boolean; | |
| } | |
| export const Fetcher: React.FC<SWRProps> = ({ | |
| api, | |
| children, |