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

simpl-schema

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpl-schema - npm Package Versions

1
8

1.2.1

Diff

Changelog

Source

1.2.1

Fix issues with Meteor Tracker reactivity sometimes not working when subschemas are involved.

aldeed
published 1.2.0 •

Changelog

Source

1.2.0

The performance of clean, specifically of looping through the object to apply autoValues and defaultValues, has been greatly improved for large objects.

aldeed
published 1.1.2 •

Changelog

Source

1.1.2

Passing a definition with no type to extend now works as expected, as long as the existing definition already has a type.

aldeed
published 1.1.1 •

Changelog

Source

1.1.1

Passing an array of schemas to new SimpleSchema() or extend() now throws an error rather than failing silently with strange results.

aldeed
published 1.1.0 •

Changelog

Source

1.1.0

  • The autoConvert cleaning now converts strings that are "true" or "false" to Boolean if the schema expects a Boolean.
  • The autoConvert cleaning now converts numbers to Boolean if the schema expects a Boolean, with 0 being false and all other numbers being true.
aldeed
published 1.0.0 •

Changelog

Source

1.0.0

BREAKING CHANGE: autoValue and defaultValue handling has been rewritten to fix all known issues. As part of this rewrite, the behavior has changed to address a point of common confusion.

Previously, when you cleaned an object to add autoValues, a defaultValue would be added (and an autoValue function would run) even if the parent object was not present. (It would be created.)

Now, an autoValue/defaultValue will run only if the object in which it appears exists. Usually this is what you want, but if you are relying on the previous behavior, you can achieve the same thing by making sure that all ancestor objects have a defaultValue: {}.

For example, this:

{
  profile: {
    type: Object,
    optional: true,
  },
  'profile.language': {
    type: String,
    defaultValue: 'en',
  },
}

previously cleaned {} to become { profile: { language: 'en' } } but now would remain {}. If you want cleaning to result in { profile: { language: 'en' } }, add the profile default value like:

{
  profile: {
    type: Object,
    optional: true,
    defaultValue: {},
  },
  'profile.language': {
    type: String,
    defaultValue: 'en',
  },
}

If profile were nested under another object, you'd have to add defaultValue: {} to that object definition, too, and so on.

  • Fix regression that resulted in _constructorOptions key is missing "type" error reappearing in some situations
  • Fix errors when validating an object that has a property named length
duriduri
published 0.5.0 •

Changelog

Source

0.5.0

  • Remove underscore dependency in favor of seperated lodash modules
aldeed
published 0.4.2 •

Changelog

Source

0.4.2

  • Fix to properly add defaultValues in objects that are being $pushed in an update modifier
  • Fix removeNullsFromArrays to remove only nulls
duriduri
published 0.4.1 •

Changelog

Source

0.4.1

Fix cleaning an object with a length property

aldeed
published 0.4.0 •

Changelog

Source

0.4.0

  • Added getFormValidator(), similar to validator() but instead of throwing an error, it returns a Promise that resolves with the errors. This can be used as a Composable Form Specification validator.
  • Throw a better error when keys that conflict with Object prototype keys are used (Thanks @xavierpriour)
  • Fix the incorrect "Found both autoValue and defaultValue options" warning (Thanks @SachaG)
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