Releases: Saeris/valimock
Releases · Saeris/valimock
valimock v1.6.0
- #77 (minor) Thanks @Saeris! - Add opt-in instrumentation hook (
new Valimock({ instrument: true })) and a perf-regression spec asserting call-count and depth ceilings on realistic-shape schemas. Catches catastrophic regressions like the v1.5.0 wrapper-recursion bug — proven locally to detect the bug at ~2,100x explosion in call counts. - #79 (patch) Thanks @Saeris! - Add Vitest
bench()files for iteration-time performance evaluation, reusing the fixture library from the regression canary. Includes ascripts/profile.mjsconvenience wrapper for CPU profiling. Pure tooling — no public-API or runtime changes.
Published to
- ✅ npm
valimock v1.5.4
- #74 (patch) Thanks @Saeris! - Dispatch and lookup optimizations: Map-based schema dispatch in the hot #mock path, precomputed lowercase keyNameGenerators lookup, WeakMap memoization of #getValidEnumValues, and a fast path through generateString for unconstrained strings. ~1.2-1.7x faster on string- and enum-heavy schemas.
- #75 (patch) Thanks @Saeris! - Cache findFakerForKeyName auto-discovery results in a module-level WeakMap keyed by Faker instance. Both positive and negative results are cached, so repeat lookups of the same keyName (cached hit) and repeat lookups of unknown keyNames (cached miss) both skip the full Object.keys(faker) walk. ~1.8-2.1x faster on string-heavy schemas.
Published to
- ✅ npm
valimock v1.5.3
- #72 (patch) Thanks @Saeris! - Lazify wrapper handlers (nullable / nullish / optional / undefinedable) so they descend into the wrapped schema only when the random roll picks the wrapped branch. Eliminates a ~4,700x slowdown on self-referencing schemas wrapped in nullish-lazy (the canonical
referencedMessage: v.nullish(v.lazy(() => self))pattern).
Published to
- ✅ npm
valimock v1.5.2
- #69 (patch) Thanks @Saeris! - Clean up package.json for ESM-only standards compliance: drop redundant
main/module/typestop-level fields and the non-standardmodulecondition insideexports. Theexports.importbranch (withtypeslisted first per Node's resolver requirement) is the canonical entrypoint for Node >=22 and modern bundlers, which is what this package already requires viaengines.node. Normalizesengines.nodefrom">=22.x"to the canonical semver">=22"; no behavior change (the two ranges are semver-equivalent), but the new form is idiomatic and whatnode-semveroutputs after parsing. - #70 (patch) Thanks @Saeris! - Fix intersect dropping variant discriminator when shared keys diverge, and let
customMocksoverride built-in schema handlers (notablycustomMocks.any: () => undefinedto restore pre-1.5 v.any behavior).
Published to
- ✅ npm
valimock v1.5.1
valimock v1.5.0
v1.4.0
v1.3.1
v1.3.0
v1.2.0
Minor Changes
-
2f875f1Thanks @Saeris! - Add support for new String validations and Keyword matchersNew Validations:
- base64
- bic
- creditCard
- decimal
- empty
- hexadecimal
- hexColor
- mac
- nanoid (unstable)
- octal
New keywords:
- username
- displayName
- firstName
- middleName
- lastName
- fullName
- gender
- sex
- zodiacSign
- isbn
- iban
- vin
- vrm
Also adds support for
empty()for both Strings and Arrays