Skip to content

Commit 4f121e3

Browse files
committed
put the logic in copy_payload so it gets treeshaken in most cases
1 parent 587c1b1 commit 4f121e3

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

packages/svelte/src/internal/server/payload.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ export class HeadPayload {
1111
this.title = title;
1212
this.uid = uid;
1313
}
14-
15-
clone() {
16-
const payload = new HeadPayload();
17-
18-
payload.out = this.out;
19-
payload.css = new Set(this.css);
20-
payload.title = this.title;
21-
payload.uid = this.uid;
22-
23-
return payload;
24-
}
2514
}
2615

2716
export class Payload {
@@ -50,7 +39,11 @@ export function copy_payload({ out, css, head, uid }) {
5039
payload.css = new Set(css);
5140
payload.uid = uid;
5241

53-
payload.head = head.clone();
42+
payload.head = new HeadPayload();
43+
payload.head.out = head.out;
44+
payload.head.css = new Set(head.css);
45+
payload.head.title = head.title;
46+
payload.head.uid = head.uid;
5447

5548
return payload;
5649
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy