Changelog
5.0.0
Release date: 2024-08-03
No changes since v5.0.0-beta.0.
🚨 Note this release contains breaking changes.
Changelog
5.0.0-beta.0
Release date: 2024-08-03
There are no API additions/changes in this release. The focus is on ESM.
.cjs
(require()
) and .mjs
(import
) builds.lodash-es
(ESM) instead of lodash
(CJS).import * as rtv from 'rtvjs'
), it will import from the slim build by default
./dist
directory has changed: Files are now split between node
and browser
directories.main
field in package.json
has been removed in favor of exports
.v16.12.0
(for ESM support).@babel/runtime
and lodash-es
are now peerDependencies
since they are required for the slim
builds.Changelog
4.1.1
Release date: 2024-02-17
There are no code changes in this release.
package.json
, README.md
, API.md
, and CHANGELOG.md
updated to point to new GitHub repo.Changelog
4.1.0
Release date: 2022-05-12
mvv
(Minimum Viable Value) property on the RtvSuccess
object returned on successful validations.
exactShapes
option while not specifying a shape in the $
Shape arguments would require the object being checked to be empty.
{}
with the exactShapes
flag, however, will require the object to be empty (i.e. have no own-properties).CLASS_OBJECT
type's ctor
argument resulted in {"ctor":"<validator>"}
. Now it results in {"ctor":"<constructor>"}
since the function is not a validator in this case.rtv.verify({ foo: 123 }, { foo: null })
will now pass, ignoring/not validating the foo
property instead of throwing an "invalid typeset" error because null
is not a valid typeset.
delete
the property from the shape (and having to build the larger shape seperately instead of inline in an rtv.check()
or rtv.verify()
call).shape1 = { foo: rtv.NUMBER }; shape2 = { bar: rtv.STRING }; rtv.verify({ foo: 123 }, { ...shape1, ...shape2, bar: null });
will now succeed.Changelog
4.0.0
Release date: 2021-05-01
npm
from engines
in package.json
since that was not helpful to package consumers installing it using npm@6
(or older) or another package manager such as yarn
, generating an "engines warning". We don't package the lock file since we package pre-built distributions, so there's no need to enforce a specific package manager on installation.Changelog
3.1.4
Release date: 2021-03-27
@babel/runtime
and lodash
. Note this change doesn't affect the default use of the package, which points to the full builds that bundle everything.Changelog
3.1.3
Release date: 2021-01-30
rtv.fullyQualify()
method was not properly supporting Array typesets with a qualifier and a shape, e.g. [rtv.OPTIONAL, {foo: rtv.STRING}]
. The method now correctly returns [rtv.OPTIONAL, rtv.OBJECT, {$ {foo: rtv.STRING}}]
.rootCause
of the RtvError
object resulting from a failed validation would sometimes report that extra properties were found in the object even though the exact
Shape Argument, or exactShapes
validation option was not set to true
. This is no longer the case.Changelog
3.1.2
Release date: 2021-01-14
exactShapes
option in rtv.check()
and rtv.verify()
now properly fails the validation if any extra properties are found on the object being validated.rootCause
of the resulting RtvError
, when exactShapes=true
(Type Validator Context Options) or exact=true
(Shape Object Arguments) is the direct cause, is now an Error
object which indicates the extra properties that were found on the value.Changelog
3.1.1
Release date: 2021-01-09
@babel/runtime: ^7.0.0
lodash: ^4.0.0
Changelog
3.1.0
Release date: 2021-01-07
main
field in package.json
, unchanged, referencing ./dist/rtv.js
) is now fully bundled again, like it was before.module
field in package.json
, unchanged, referencing ./dist/rtv.esm.js
) is now fully bundled../dist/rtv.umd.dev.js
and ./dist/rtv.umd.js
) are now fully bundled..slim
alternative which is non-bundled and relies on the following external dependencies:
lodash
@babel/runtime
(CJS and ESM only)