UNPKG

svelte-object

Version:

A nested component Svelte 5 Runes pattern for structuring objects/arrays and their properties

9 lines (8 loc) 252 B
export function isMax(e, max) { if (typeof e.value !== 'string' || max === undefined || max === null) return; const tooBig = e.value.length > max; if (!tooBig) return; e.error(`Value must be less or equal to ${max}`); }