Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rtvjs

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtvjs - npm Package Versions

2

5.0.0

Diff

Changelog

Source

5.0.0

Release date: 2024-08-03

No changes since v5.0.0-beta.0.

🚨 Note this release contains breaking changes.

stefcameron
published 5.0.0-beta.0 •

Changelog

Source

5.0.0-beta.0

Release date: 2024-08-03

There are no API additions/changes in this release. The focus is on ESM.

🚨 BREAKING

  • ESM-only for the browser: UMD and CJS browser builds have been removed (see ESM in browser for an example of how to import this directly into the browser as a global).
  • ESM and CJS for Node, with .cjs (require()) and .mjs (import) builds.
  • Library now uses/depends (as a peer) on lodash-es (ESM) instead of lodash (CJS).
  • When importing the library (e.g. import * as rtv from 'rtvjs'), it will import from the slim build by default
    • The assumption is it's being imported for use in an app/library that will provide the necessary externals in its build/package rather than import from the self-contained build and cause duplication of its dependencies (and possibly conflicts at runtime).
  • File structure under the published ./dist directory has changed: Files are now split between node and browser directories.
  • See Installation for information on which files are meant to be used where. Some previous formats are no longer available.
  • The main field in package.json has been removed in favor of exports.
  • Minimum supported version of Node is v16.12.0 (for ESM support).

Added

  • Minified version of the ESM build for use in browsers.

Changed

  • @babel/runtime and lodash-es are now peerDependencies since they are required for the slim builds.
stefcameron
published 4.1.1 •

Changelog

Source

4.1.1

Release date: 2024-02-17

There are no code changes in this release.

Changed

  • Links in package.json, README.md, API.md, and CHANGELOG.md updated to point to new GitHub repo.
stefcameron
published 4.1.0 •

Changelog

Source

4.1.0

Release date: 2022-05-12

Added

  • New mvv (Minimum Viable Value) property on the RtvSuccess object returned on successful validations.
    • This property contains the "smallest" value that would pass the same validation. See the new section in the README by the same title for more details.

Changed

  • Fixed: Using the exactShapes option while not specifying a shape in the $ Shape arguments would require the object being checked to be empty.
    • If a specific shape isn't specified, the flag is meant to be ignored since there is no explicit shape to check against.
    • Explicitly providing an empty shape {} with the exactShapes flag, however, will require the object to be empty (i.e. have no own-properties).
  • Fixed: Printing a typeset including the 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.
  • Ignore falsy values on nested shape property typesets (e.g. 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.
    • This can make it easier to combine multiple shapes into a larger shape using destructuring where you use a falsy value to override an inherited shape property in order to exclude it from the larger shape instead of having to explicitly 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).
    • For example: shape1 = { foo: rtv.NUMBER }; shape2 = { bar: rtv.STRING }; rtv.verify({ foo: 123 }, { ...shape1, ...shape2, bar: null }); will now succeed.
stefcameron
published 4.0.0 •

Changelog

Source

4.0.0

Release date: 2021-05-01

Changed

  • Dropped support for Node 10 which fell out of LTS as of yesterday. Node >= 12 is supported going forward.
  • Dropped 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.
stefcameron
published 3.1.4 •

Changelog

Source

3.1.4

Release date: 2021-03-27

Changed

  • Fixed: The slim builds weren't actually slim! They were still bundling @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.
stefcameron
published 3.1.3 •

Changelog

Source

3.1.3

Release date: 2021-01-30

Changed

  • Fixed: The 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}}].
  • Fixed: When validating objects against shapes, the 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.
stefcameron
published 3.1.2 •

Changelog

Source

3.1.2

Release date: 2021-01-14

Changed

  • Fixed: Setting the new exactShapes option in rtv.check() and rtv.verify() now properly fails the validation if any extra properties are found on the object being validated.
  • The 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.
stefcameron
published 3.1.1 •

Changelog

Source

3.1.1

Release date: 2021-01-09

Changed

  • The following peer dependencies have been removed from the package to avoid unnecessary "missing peer dependency" warnings when installing the package, since the default CJS and ESM builds are fully bundled and don't require them:
    • @babel/runtime: ^7.0.0
    • lodash: ^4.0.0
stefcameron
published 3.1.0 •

Changelog

Source

3.1.0

Release date: 2021-01-07

Changed

  • Additional builds, and non-breaking changes to existing builds:
    • The default CJS build (main field in package.json, unchanged, referencing ./dist/rtv.js) is now fully bundled again, like it was before.
    • The default ESM build (module field in package.json, unchanged, referencing ./dist/rtv.esm.js) is now fully bundled.
    • The UMD builds (./dist/rtv.umd.dev.js and ./dist/rtv.umd.js) are now fully bundled.
    • For each build type (CJS, ESM, UMD), there is now a .slim alternative which is non-bundled and relies on the following external dependencies:
      • lodash
      • @babel/runtime (CJS and ESM only)
2
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc