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 fs = require("fs"); | |
const path = require("path"); | |
const prettier = require("prettier"); | |
const { DOMParser, XMLSerializer } = require("xmldom"); | |
const ICONS_DIRECTORY = path.join(__dirname, "icons"); | |
const EXPORT_DIRECTORY = path.join(__dirname, "components"); | |
fs.readdir(ICONS_DIRECTORY, function (err, files) { | |
if (err) { |
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
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ | |
import { reactive, toRefs } from 'vue'; | |
import axios,{ AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios'; | |
export enum Status { | |
IDLE = 'idle', | |
LOADING = 'loading', | |
SUCCESS = 'success', | |
ERROR = 'error', |
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 { ref } from "vue"; | |
export default function ({ min, max, defaultValue }) { | |
const count = ref(defaultValue); | |
const increment = () => { | |
if (max) { | |
count.value < max && count.value++; | |
} else { | |
count.value++; | |
} |
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 wrapper = document.querySelector('#wrapper') | |
const wrapperComputedStyle = window.getComputedStyle(wrapper, null) | |
let wrapperWidth = wrapper.clientWidth | |
wrapperWidth -= | |
parseFloat(wrapperComputedStyle.paddingLeft) + | |
parseFloat(wrapperComputedStyle.paddingRight) |
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 { useLocation } from "react-router-dom"; | |
import PropTypes from "prop-types"; | |
export default function useQueryParams(...keys) { | |
const location = useLocation(); | |
const query = new URLSearchParams(location.search); | |
let paramObj = {}; | |
for (let value of keys) { |
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 express = require("express"); | |
const multer = require("multer"); | |
const fs = require("fs"); | |
// constant | |
const app = express(); | |
const storage = multer.diskStorage({ | |
destination: (req, file, callback) => { | |
const dir = "uploads/"; | |
!fs.existsSync(dir) && fs.mkdirSync(dir); |