- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
/** Checks whether given object is ParserObject */
|
|
export function isParserObject(value) {
|
|
return isEnhancedParserObject(value) || isBasicParserObject(value);
|
|
}
|
|
/** Checks whether given object is EnhancedParserObject */
|
|
export function isEnhancedParserObject(value) {
|
|
return Boolean(value && typeof value.parseForESLint === "function");
|
|
}
|
|
/** Checks whether given object is BasicParserObject */
|
|
export function isBasicParserObject(value) {
|
|
return Boolean(value && typeof value.parse === "function");
|
|
}
|
|
/** Checks whether given object maybe "@typescript-eslint/parser" */
|
|
export function maybeTSESLintParserObject(value) {
|
|
return (isEnhancedParserObject(value) &&
|
|
isBasicParserObject(value) &&
|
|
typeof value.createProgram === "function" &&
|
|
typeof value.clearCaches === "function" &&
|
|
typeof value.version === "string");
|
|
}
|
|
/** Checks whether given object is "@typescript-eslint/parser" */
|
|
export function isTSESLintParserObject(value) {
|
|
if (!isEnhancedParserObject(value))
|
|
return false;
|
|
try {
|
|
const result = value.parseForESLint("", {});
|
|
const services = result.services;
|
|
return Boolean(services &&
|
|
services.esTreeNodeToTSNodeMap &&
|
|
services.tsNodeToESTreeNodeMap);
|
|
}
|
|
catch {
|
|
return false;
|
|
}
|
|
}
|