@sveltejs/kit 1.0.0-next.474 → 1.0.0-next.475

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.474",
3
+ "version": "1.0.0-next.475",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -147,7 +147,7 @@ export function get_default_build_config({ config, input, ssr, outDir }) {
147
147
  * @returns {string}
148
148
  */
149
149
  export function assets_base(config) {
150
- return config.paths.assets || config.paths.base || './';
150
+ return config.paths.assets + '/' || config.paths.base + '/' || './';
151
151
  }
152
152
 
153
153
  const method_names = new Set(['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH']);
@@ -43,6 +43,7 @@ export function get_cookies(request, url) {
43
43
  },
44
44
  delete(name) {
45
45
  new_cookies.push({ name, value: '', options: { expires: new Date(0) } });
46
+ delete initial_cookies[name];
46
47
  }
47
48
  };
48
49
 
@@ -88,6 +88,15 @@ declare module '$app/environment' {
88
88
  declare module '$app/forms' {
89
89
  import type { ActionResult } from '@sveltejs/kit';
90
90
 
91
+ export type SubmitFunction<
92
+ Success extends Record<string, unknown> | undefined,
93
+ Invalid extends Record<string, unknown> | undefined
94
+ > = (input: {
95
+ data: FormData;
96
+ form: HTMLFormElement;
97
+ cancel: () => void;
98
+ }) => void | ((result: ActionResult<Success, Invalid>) => void);
99
+
91
100
  /**
92
101
  * This action enhances a `<form>` element that otherwise would work without JavaScript.
93
102
  * @param form The form element
@@ -111,11 +120,7 @@ declare module '$app/forms' {
111
120
  * - redirects in case of a redirect response
112
121
  * - redirects to the nearest error page in case of an unexpected error
113
122
  */
114
- submit?: (input: {
115
- data: FormData;
116
- form: HTMLFormElement;
117
- cancel: () => void;
118
- }) => void | ((result: ActionResult<Success, Invalid>) => void)
123
+ submit?: SubmitFunction<Success, Invalid>
119
124
  ): { destroy: () => void };
120
125
 
121
126
  /**