Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"eslint": "^9.6.0",
"playwright": "^1.44.1",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"typescript-eslint": "^8.0.0"
},
"packageManager": "[email protected]",
Expand Down
11 changes: 5 additions & 6 deletions packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,11 @@ export interface ActionFailure<T extends Record<string, unknown> | undefined = u
[uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure
}

type UnpackValidationError<T> =
T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;
type UnpackValidationError<T> = T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;

/**
* This object is passed to the `adapt` function of adapters.
Expand Down
5 changes: 2 additions & 3 deletions packages/kit/src/runtime/server/page/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,8 @@ function get_data(event, options, nodes, csp, global) {
str = devalue.uneval({ id, data, error }, replacer);
}

push(
`<script${csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : ''}>${global}.resolve(${str})</script>\n`
);
const nonce = csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : '';
push(`<script${nonce}>${global}.resolve(${str})</script>\n`);
if (count === 0) done();
}
);
Expand Down
11 changes: 5 additions & 6 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ declare module '@sveltejs/kit' {
[uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure
}

type UnpackValidationError<T> =
T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;
type UnpackValidationError<T> = T extends ActionFailure<infer X>
? X
: T extends void
? undefined // needs to be undefined, because void will corrupt union type
: T;

/**
* This object is passed to the `adapt` function of adapters.
Expand Down
1 change: 0 additions & 1 deletion packages/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@types/node": "^18.19.48",
"@types/prompts": "^2.4.9",
"@types/semver": "^7.5.6",
"prettier": "^3.1.1",
"svelte": "^4.2.10",
"vitest": "^2.0.1"
},
Expand Down
Loading
Loading