Files
headroom/frontend/node_modules/@ark/schema/out/refinements/max.js
Santhosh Janardhanan de2d83092e feat: Reinitialize frontend with SvelteKit and TypeScript
- 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
2026-02-17 16:19:59 -05:00

46 lines
1.5 KiB
JavaScript

import { Disjoint } from "../shared/disjoint.js";
import { implementNode } from "../shared/implement.js";
import { $ark } from "../shared/registry.js";
import { BaseRange, parseExclusiveKey } from "./range.js";
const implementation = implementNode({
kind: "max",
collapsibleKey: "rule",
hasAssociatedError: true,
keys: {
rule: {},
exclusive: parseExclusiveKey
},
normalize: schema => typeof schema === "number" ? { rule: schema } : schema,
defaults: {
description: node => {
if (node.rule === 0)
return node.exclusive ? "negative" : "non-positive";
return `${node.exclusive ? "less than" : "at most"} ${node.rule}`;
}
},
intersections: {
max: (l, r) => (l.isStricterThan(r) ? l : r),
min: (max, min, ctx) => max.overlapsRange(min) ?
max.overlapIsUnit(min) ?
ctx.$.node("unit", { unit: max.rule })
: null
: Disjoint.init("range", max, min)
},
obviatesBasisDescription: true
});
export class MaxNode extends BaseRange {
impliedBasis = $ark.intrinsic.number.internal;
traverseAllows = this.exclusive ? data => data < this.rule : data => data <= this.rule;
reduceJsonSchema(schema) {
if (this.exclusive)
schema.exclusiveMaximum = this.rule;
else
schema.maximum = this.rule;
return schema;
}
}
export const Max = {
implementation,
Node: MaxNode
};