chore: update deps and apply lint
All checks were successful
/ deploy_site (push) Successful in 22s

This commit is contained in:
Minhyeok Park 2025-03-19 15:10:18 +09:00
parent b01a3696a0
commit f78c9cd655
Signed by: pmh_only
SSH Key Fingerprint: SHA256:g/OyGvi2pcd8ub9mqge/ohmDP0fZX/xOPWPIcM+9XpI
5 changed files with 659 additions and 604 deletions

View File

@ -10,11 +10,11 @@
"preview": "vite preview"
},
"dependencies": {
"@fontsource-variable/jetbrains-mono": "^5.1.1",
"@monaco-editor/react": "^4.6.0",
"@fontsource-variable/jetbrains-mono": "^5.2.5",
"@monaco-editor/react": "^4.7.0",
"@uidotdev/usehooks": "^2.4.1",
"clsx": "^2.1.1",
"framer-motion": "^11.11.10",
"framer-motion": "^11.18.2",
"json5": "^2.2.3",
"moment": "^2.30.1",
"normalize.css": "^8.0.1",
@ -23,26 +23,26 @@
"react-tooltip": "^5.28.0",
"recoil": "^0.7.7",
"strtime": "^1.1.2",
"styled-components": "^6.1.13",
"yaml": "^2.6.0"
"styled-components": "^6.1.16",
"yaml": "^2.7.0"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.13.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.13",
"globals": "^15.11.0",
"@eslint/js": "^9.22.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react-swc": "^3.8.0",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"monaco-editor": "^0.52.2",
"sass-embedded": "^1.80.4",
"sass-embedded": "^1.86.0",
"sharp": "^0.33.5",
"typescript": "~5.6.2",
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9",
"typescript": "~5.6.3",
"typescript-eslint": "^8.26.1",
"vite": "^5.4.14",
"vite-plugin-image-optimizer": "^1.1.8"
}
}

1168
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,25 @@ import { Transform } from './Transform'
const pythonToJSON = (pythonStr: string): string => {
// Validate basic structure first before any replacements
if (!(/^\s*(?:\{[\s\S]*\}|\[[\s\S]*\])\s*$/.test(pythonStr))) {
if (!/^\s*(?:\{[\s\S]*\}|\[[\s\S]*\])\s*$/.test(pythonStr)) {
throw new Error('Invalid Python dictionary or array format')
}
// Perform all replacements in a single pass
return pythonStr
.replace(/('|None\b|True\b|False\b)/g, match => {
switch (match) {
case "'": return '"'
case 'None': return 'null'
case 'True': return 'true'
case 'False': return 'false'
default: return match
}
})
return pythonStr.replace(/('|None\b|True\b|False\b)/g, (match) => {
switch (match) {
case "'":
return '"'
case 'None':
return 'null'
case 'True':
return 'true'
case 'False':
return 'false'
default:
return match
}
})
}
export const PythonDictToJSONTransform: Transform = {
@ -36,16 +40,23 @@ export const JSONToPythonDictTransform: Transform = {
fn: async (v) => {
try {
// Validate and format in one step
return JSON.stringify(JSON.parse(v), null, 2)
.replace(/("|\bnull\b|\btrue\b|\bfalse\b)/g, match => {
return JSON.stringify(JSON.parse(v), null, 2).replace(
/("|\bnull\b|\btrue\b|\bfalse\b)/g,
(match) => {
switch (match) {
case '"': return "'"
case 'null': return 'None'
case 'true': return 'True'
case 'false': return 'False'
default: return match
case '"':
return "'"
case 'null':
return 'None'
case 'true':
return 'True'
case 'false':
return 'False'
default:
return match
}
})
}
)
} catch {
throw new Error('Invalid JSON format')
}

View File

@ -3,10 +3,7 @@ import {
Base64EncodeTransform
} from './Base64Transforms'
import { DatetimeTransform } from './DatetimeTransforms'
import {
GzipCompressTransform,
GzipDecompressTransform
} from './GzipTransform'
import { GzipCompressTransform, GzipDecompressTransform } from './GzipTransform'
import {
JSONBeautifyTransform,
JSONEscapeTransform,

1
src/vite-env.d.ts vendored
View File

@ -1,6 +1,5 @@
/// <reference types="vite/client" />
module 'strtime' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function strptime(string, string): Date
}