@sveltejs/kit 2.5.13 → 2.5.15

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": "2.5.13",
3
+ "version": "2.5.15",
4
4
  "description": "The fastest way to build Svelte apps",
5
5
  "keywords": [
6
6
  "framework",
@@ -27,12 +27,13 @@ export function read(asset) {
27
27
  }
28
28
 
29
29
  // handle inline assets internally
30
- if (asset.startsWith('data:')) {
31
- const [prelude, data] = asset.split(';');
32
- const type = prelude.slice(5) || 'application/octet-stream';
30
+ const match = /^data:([^;,]+)?(;base64)?,/.exec(asset);
31
+ if (match) {
32
+ const type = match[1] ?? 'application/octet-stream';
33
+ const data = asset.slice(match[0].length);
33
34
 
34
- if (data.startsWith('base64,')) {
35
- const decoded = b64_decode(data.slice(7));
35
+ if (match[2] !== undefined) {
36
+ const decoded = b64_decode(data);
36
37
 
37
38
  return new Response(decoded, {
38
39
  headers: {
@@ -52,9 +53,9 @@ export function read(asset) {
52
53
  });
53
54
  }
54
55
 
55
- const file = DEV
56
- ? decodeURIComponent(asset.startsWith('/@fs') ? asset : asset.slice(base.length + 1))
57
- : asset.slice(base.length + 1);
56
+ const file = decodeURIComponent(
57
+ DEV && asset.startsWith('/@fs') ? asset : asset.slice(base.length + 1)
58
+ );
58
59
 
59
60
  if (file in manifest._.server_assets) {
60
61
  const length = manifest._.server_assets[file];
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '2.5.13';
4
+ export const VERSION = '2.5.15';