@webamoki/web-svelte 0.5.13 → 0.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,4 +20,4 @@ export declare function prepareEmptyForm<S extends type.Any<Record<string, unkno
20
20
  delayed: import("svelte/store").Readable<boolean>;
21
21
  errors: import("sveltekit-superforms/client").SuperFormErrors<S["infer"]>;
22
22
  };
23
- export declare function serverValidateForm<S extends type.Any<Record<string, unknown>>>(request: Request, schema: S): Promise<SuperValidated<S["infer"], any, S["inferIn"]>>;
23
+ export declare function getServerForm<S extends type.Any<Record<string, unknown>>>(request: Request, schema: S): Promise<SuperValidated<S["infer"], any, S["inferIn"]>>;
@@ -1,7 +1,7 @@
1
1
  import { toast } from 'svelte-sonner';
2
2
  import { dateTransport } from './index.js';
3
3
  import { type } from 'arktype';
4
- import { defaults, fail, superForm, superValidate } from 'sveltekit-superforms';
4
+ import { defaults, superForm, superValidate } from 'sveltekit-superforms';
5
5
  import { arktype, arktypeClient } from 'sveltekit-superforms/adapters';
6
6
  export function prepareForm(validated, schema, options) {
7
7
  const form = superForm(validated, {
@@ -55,10 +55,6 @@ export function prepareEmptyForm(schema, options) {
55
55
  const errors = form.errors;
56
56
  return { form, data: form.form, delayed, errors };
57
57
  }
58
- export async function serverValidateForm(request, schema) {
59
- const form = await superValidate(request, arktype(schema), { transport: dateTransport });
60
- if (!form.valid) {
61
- throw fail(400, { form });
62
- }
63
- return form;
58
+ export async function getServerForm(request, schema) {
59
+ return await superValidate(request, arktype(schema), { transport: dateTransport });
64
60
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.5.13",
6
+ "version": "0.5.14",
7
7
  "license": "MIT",
8
8
  "files": [
9
9
  "dist",