Compare commits

..
Author SHA1 Message Date
Railly Hugo 806d3c551f docs: update Geistdocs to 2.7.5 2026-09-30 16:30:06 -03:00
Railly Hugo 1026f455b7 docs: prepare native WebMCP migration 2026-09-25 16:57:11 -03:00
2 changed files with 1 additions and 13 deletions
-10
View File
@@ -152,16 +152,6 @@ describe("builtInValidationFunctions", () => {
expect(builtInValidationFunctions.numeric(NaN)).toBe(false);
expect(builtInValidationFunctions.numeric(null)).toBe(false);
});
it("fails for strings with trailing non-numeric characters", () => {
expect(builtInValidationFunctions.numeric("123abc")).toBe(false);
expect(builtInValidationFunctions.numeric("99bottles")).toBe(false);
});
it("fails for empty and whitespace-only strings", () => {
expect(builtInValidationFunctions.numeric("")).toBe(false);
expect(builtInValidationFunctions.numeric(" ")).toBe(false);
});
});
describe("url", () => {
+1 -3
View File
@@ -153,9 +153,7 @@ export const builtInValidationFunctions: Record<string, ValidationFunction> = {
*/
numeric: (value: unknown) => {
if (typeof value === "number") return !isNaN(value);
if (typeof value === "string") {
return value.trim() !== "" && !isNaN(Number(value));
}
if (typeof value === "string") return !isNaN(parseFloat(value));
return false;
},