New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sveltekit-superforms

Package Overview
Dependencies
Maintainers
1
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sveltekit-superforms - npm Package Versions

1
46
22

2.7.0

Diff
ciscoheat
published 2.7.0 •

Changelog

Source

[2.7.0] - 2024-03-03

Added

  • newState option for reset, to set a new state for future resets. Can be used instead of the data option.

Fixed

  • Empty file entries didn't return null for nullable schema fields. Ensure that all required file fields aren't set to nullable.
  • Allowed string index in $errors and $tainted.
  • submit can now be passed directly to event handlers.
  • Updated to latest valibot-json-schema, with support for enum_, amongst others.
  • Zod adapter now supports ZodType.
ciscoheat
published 2.6.2 •

Changelog

Source

[2.6.2] - 2024-02-25

Fixed

  • Schema literals weren't treated as their typeof type, which prevented multi-type union detection.
  • FormPath and FormPathLeaves didn't narrow the types correctly for Date, Set and File.
  • stringProxy didn't accept FormPathLeaves as path.
  • Fixed removal of uploads for empty files (as is the default for empty file inputs), they are now ignored.
  • Exported Schema type, for any supported validation schema.
ciscoheat
published 2.6.1 •

Changelog

Source

[2.6.1] - 2024-02-24

Added

  • Type narrowing for FormPath and its relatives, to filter the paths based on a specific type, like FormPathLeaves<T, Date>.
  • Proxy types: FieldProxy, FormFieldProxy and ArrayProxy.
  • Added invalidateAll option 'force', to always use the load function form data, instead of the one returned from the form action. Useful when updating the form data partially, to ensure that the data is refreshed from the server (a "pessimistic" update compared to the default, which is optimistic). Setting this also bases the reset function on the latest load function data returned for the form.

Fixed

  • defaults didn't infer the input type, and didn't generate correct SuperValidated data, making superForm confused. Also fixed type signature and removed the jsonSchema option that wasn't applicable.
  • Using goto in events didn't work when the target page redirected.
  • FormPath and FormPathLeaves didn't handle fields with type unknown and any.
  • Missing boolean fields were valid in strict mode.
ciscoheat
published 2.6.0 •
ciscoheat
published 2.5.0 •

Changelog

Source

[2.5.0] - 2024-02-21

Added

  • get and set accessor for onChange.
  • submit method for superForm, a convenience instead of using requestSubmit. Requires use:enhance or that a HTMLElement inside the form (or the form itself) is passed as an argument.

Fixed

  • Type parameter was missing in ChangeEvent, which should be of the inferred schema type.
  • Type for onChange.paths wasn't strongly typed to FormPath.
  • Initial data was dereferenced after calling superForm, so it wasn't possible to update it when using reset.
  • FormOptions type required a type parameter that should've been defaulted to Record<string, unknown>.
  • Auto-overflow on SuperDebug, for small spaces.
ciscoheat
published 2.4.0 •

Changelog

Source

[2.4.0] - 2024-02-20

Added

  • Added config option to Valibot adapter, for the SchemaConfig type.

Fixed

  • Nullable fields weren't always detected in JSON Schemas.
  • Constraints weren't added when using default values for Arktype, Vine and Valibot schemas.
  • Fixed null support for Joi, Arktype and Vine schemas.
ciscoheat
published 2.3.0 •

Changelog

Source

[2.3.0] - 2024-02-18

Fixed

  • Depending on the JSON Schema, dates were sometimes set to undefined when posting invalid data.

Added

  • onSubmit.jsonData, to override what's being submitted, when dataType is set to 'json' and validation succeeds for $form.
  • onSubmit.validators, to temporarily override validators for the current submission.
ciscoheat
published 2.2.1 •

Changelog

Source

[2.2.1] - 2024-02-16

Fixed

  • Added focusOnError option to SuperForm.validateForm type (it was only in the implementation).
  • Enums could not be detected as an invalid value if the posted value was an empty string, instead it defaulted to the enum first value.
  • $posted was reset by mistake to false after posting, when resetForm option was true.
ciscoheat
published 2.2.0 •

Changelog

Source

[2.2.0] - 2024-02-15

Added

  • VineJS adapter!
  • Added focusOnError option to validateForm, default true.

Fixed

  • Autofocus is now working when using validateForm({ update: true }).
  • Default values are now applied properly for single-type unions, even a mix of integers and numbers.
  • SuperStruct types, $errors primarily, didn't handle nested data properly.

Changed

  • The inferred type parameters were swapped in message, it can now be used to specify the message type.
ciscoheat
published 2.1.0 •

Changelog

Source

[2.1.0] - 2024-02-12

Fixed

  • Enums can now be required again, as they don't need an explicit default value anymore. If no explicit default value exists, the first enum value will be used.
  • Empty arrays were set to undefined when using dataType: 'json'.