- 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
19 lines
872 B
JavaScript
19 lines
872 B
JavaScript
import { tuple } from './tuple.js';
|
|
import { uniqueArray } from './uniqueArray.js';
|
|
import { keyValuePairsToObjectMapper, keyValuePairsToObjectUnmapper } from './_internals/mappers/KeyValuePairsToObject.js';
|
|
import { constant } from './constant.js';
|
|
import { boolean } from './boolean.js';
|
|
function dictionaryKeyExtractor(entry) {
|
|
return entry[0];
|
|
}
|
|
export function dictionary(keyArb, valueArb, constraints = {}) {
|
|
const noNullPrototype = constraints.noNullPrototype !== false;
|
|
return tuple(uniqueArray(tuple(keyArb, valueArb), {
|
|
minLength: constraints.minKeys,
|
|
maxLength: constraints.maxKeys,
|
|
size: constraints.size,
|
|
selector: dictionaryKeyExtractor,
|
|
depthIdentifier: constraints.depthIdentifier,
|
|
}), noNullPrototype ? constant(false) : boolean()).map(keyValuePairsToObjectMapper, keyValuePairsToObjectUnmapper);
|
|
}
|