fix: 정규 표현식 수정 및 조건부 렌더링 개선; 코드 가독성 향상
This commit is contained in:
@@ -102,7 +102,7 @@ const parsePhpArray = (input: string): unknown => {
|
||||
|
||||
const parseNumber = () => {
|
||||
let raw = '';
|
||||
while (index < input.length && /[0-9.+\-]/.test(input[index] ?? '')) {
|
||||
while (index < input.length && /[0-9.+-]/.test(input[index] ?? '')) {
|
||||
raw += input[index];
|
||||
index += 1;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ const parsePhpArray = (input: string): unknown => {
|
||||
if (char === '"' || char === "'") {
|
||||
return parseString();
|
||||
}
|
||||
if (/[0-9.+\-]/.test(char)) {
|
||||
if (/[0-9.+-]/.test(char)) {
|
||||
return parseNumber();
|
||||
}
|
||||
if (input.startsWith('true', index)) {
|
||||
|
||||
Reference in New Issue
Block a user