- 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
20 lines
864 B
JavaScript
20 lines
864 B
JavaScript
import { constant } from './constant.js';
|
|
import { FrequencyArbitrary } from './_internals/FrequencyArbitrary.js';
|
|
import { safeHasOwnProperty } from '../utils/globals.js';
|
|
export function option(arb, constraints = {}) {
|
|
const freq = constraints.freq == null ? 5 : constraints.freq;
|
|
const nilValue = safeHasOwnProperty(constraints, 'nil') ? constraints.nil : null;
|
|
const nilArb = constant(nilValue);
|
|
const weightedArbs = [
|
|
{ arbitrary: nilArb, weight: 1, fallbackValue: { default: nilValue } },
|
|
{ arbitrary: arb, weight: freq },
|
|
];
|
|
const frequencyConstraints = {
|
|
withCrossShrink: true,
|
|
depthSize: constraints.depthSize,
|
|
maxDepth: constraints.maxDepth,
|
|
depthIdentifier: constraints.depthIdentifier,
|
|
};
|
|
return FrequencyArbitrary.from(weightedArbs, frequencyConstraints, 'fc.option');
|
|
}
|