- 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
45 lines
885 B
JavaScript
45 lines
885 B
JavaScript
/**
|
|
* @fileoverview A class of identifiers generator for code path segments.
|
|
*
|
|
* Each rule uses the identifier of code path segments to store additional
|
|
* information of the code path.
|
|
*
|
|
* @author Toru Nagashima
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Public Interface
|
|
//------------------------------------------------------------------------------
|
|
|
|
/**
|
|
* A generator for unique ids.
|
|
*/
|
|
class IdGenerator {
|
|
/**
|
|
* @param {string} prefix Optional. A prefix of generated ids.
|
|
*/
|
|
constructor(prefix) {
|
|
this.prefix = String(prefix);
|
|
this.n = 0;
|
|
}
|
|
|
|
/**
|
|
* Generates id.
|
|
* @returns {string} A generated id.
|
|
*/
|
|
next() {
|
|
this.n = (1 + this.n) | 0;
|
|
|
|
/* c8 ignore start */
|
|
if (this.n < 0) {
|
|
this.n = 1;
|
|
} /* c8 ignore stop */
|
|
|
|
return this.prefix + this.n;
|
|
}
|
|
}
|
|
|
|
module.exports = IdGenerator;
|