@shellicar/svelte-adapter-azure-functions 0.1.1 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Stephen Hellicar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,35 +1,20 @@
1
1
  # @shellicar/svelte-adapter-azure-functions
2
2
 
3
- [![Azure Functions](https://img.shields.io/badge/Azure%20Functions-v4-0078D4?logo=azure-functions)][azure-functions]
4
- [![SvelteKit](https://img.shields.io/badge/SvelteKit-2-FF3E00?logo=svelte)][sveltekit]
5
- [![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript)][typescript]
6
- [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60A5FA?logo=biome)][biome]
3
+ > A [SvelteKit adapter](https://kit.svelte.dev/docs/adapters) that builds your app into an Azure Function.
7
4
 
8
- A [SvelteKit adapter](https://kit.svelte.dev/docs/adapters) that builds your app into an Azure Function.
5
+ [![npm package](https://img.shields.io/npm/v/@shellicar/svelte-adapter-azure-functions.svg)](https://npmjs.com/package/@shellicar/svelte-adapter-azure-functions)
6
+ [![build status](https://github.com/shellicar/svelte-adapter-azure-functions/actions/workflows/node.js.yml/badge.svg)](https://github.com/shellicar/svelte-adapter-azure-functions/actions/workflows/node.js.yml)
9
7
 
10
- ## Motivation
8
+ ## Installation & Quick Start
11
9
 
12
- Looking at the available SvelteKit adapters, there's one for Node.js and a community adapter for Azure Static Web Apps. I wanted to deploy to Azure Functions, so I created this adapter.
13
-
14
- ## Implementation
15
-
16
- The adapter generates a single Azure Function:
17
-
18
- ```typescript
19
- app.http('server', {
20
- handler,
21
- route: '{*url}',
22
- methods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT']
23
- });
10
+ ```sh
11
+ npm i --save @shellicar/svelte-adapter-azure-functions
24
12
  ```
25
13
 
26
- ## Usage
27
-
28
- ```bash
29
- pnpm add -D @shellicar/svelte-adapter-azure-functions
14
+ ```sh
15
+ pnpm add @shellicar/svelte-adapter-azure-functions
30
16
  ```
31
17
 
32
- In `svelte.config.js`:
33
18
  ```js
34
19
  import adapter from '@shellicar/svelte-adapter-azure-functions';
35
20
 
@@ -40,35 +25,6 @@ export default {
40
25
  };
41
26
  ```
42
27
 
43
- ## Configuration
44
-
45
- ### esbuildOptions
46
-
47
- ```js
48
- adapter({
49
- esbuildOptions: {
50
- minify: false
51
- }
52
- })
53
- ```
54
-
55
- Default options in [defaults.ts](./src/defaults.ts):
56
- ```typescript
57
- export const defaults = {
58
- bundle: true,
59
- platform: 'node',
60
- target: 'node20',
61
- format: 'esm',
62
- // ...see defaults.ts for full options
63
- };
64
- ```
65
-
66
- ## Credits
67
-
68
- * [svelte-adapter-azure-swa](https://github.com/geoffrich/svelte-adapter-azure-swa)
69
- * [esbuild-azure-functions](https://github.com/beyerleinf/esbuild-azure-functions)
28
+ ## Documentation
70
29
 
71
- [azure-functions]: https://learn.microsoft.com/azure/azure-functions/functions-reference-node?tabs=typescript%2Cwindows%2Cazure-cli&pivots=nodejs-model-v4
72
- [sveltekit]: https://kit.svelte.dev
73
- [typescript]: https://www.typescriptlang.org
74
- [biome]: https://biomejs.dev
30
+ For full documentation, visit [here](https://github.com/shellicar/svelte-adapter-azure-functions).
@@ -1 +1 @@
1
- import{getClientIPFromHeaders as e,getClientPrincipalFromHeaders as r,splitCookiesFromHeaders as t}from"./chunk-PSBHP5ZD.js";import{serverPromise as s}from"./chunk-GKOGVGYC.js";import{__name as a,init_cjs_shim as o}from"./chunk-AW5NC2LL.js";o();var n=a((async e=>{const{method:r,headers:t,url:s}=e,a={method:r,headers:Object.fromEntries(t)};return"GET"!==r&&"HEAD"!==r&&(a.body=await e.arrayBuffer()),new Request(s,a)}),"toRequest"),d=a((async(a,o)=>{const d=await n(a),i=await s,c=e(d.headers),h=r(d.headers),u=await i.respond(d,{getClientAddress:()=>c,platform:{clientPrincipal:h,context:o}}),{headers:m,cookies:f}=t(u.headers);return{status:u.status,body:u.body,headers:m,cookies:f}}),"handler");export{d as handler};//# sourceMappingURL=chunk-PJIDA4TG.js.map
1
+ import{getClientIPFromHeaders as e,getClientPrincipalFromHeaders as r,splitCookiesFromHeaders as t}from"./chunk-U5QCC3U4.js";import{serverPromise as s}from"./chunk-GKOGVGYC.js";import{__name as a,init_cjs_shim as o}from"./chunk-AW5NC2LL.js";o();var n=a((async e=>{const{method:r,headers:t,url:s}=e,a={method:r,headers:Object.fromEntries(t)};return"GET"!==r&&"HEAD"!==r&&(a.body=await e.arrayBuffer()),new Request(s,a)}),"toRequest"),d=a((async(a,o)=>{const d=await n(a),i=await s,c=e(d.headers),h=r(d.headers),u=await i.respond(d,{getClientAddress:()=>c,platform:{clientPrincipal:h,context:o}}),{headers:m,cookies:f}=t(u.headers);return{status:u.status,body:u.body,headers:m,cookies:f}}),"handler");export{d as handler};//# sourceMappingURL=chunk-MZGTF76B.js.map
@@ -0,0 +1 @@
1
+ import{__commonJS as e,__name as r,__toESM as t,init_cjs_shim as o}from"./chunk-AW5NC2LL.js";var s=e({"../../node_modules/.pnpm/set-cookie-parser@2.7.1/node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){o();var s={decodeValues:!0,map:!1,silent:!1};function i(e){return"string"==typeof e&&!!e.trim()}function n(e,r){var t=e.split(";").filter(i),o=a(t.shift()),n=o.name,c=o.value;r=r?Object.assign({},s,r):s;try{c=r.decodeValues?decodeURIComponent(c):c}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+c+"'. Set options.decodeValues to false to disable this feature.",e)}var p={name:n,value:c};return t.forEach((function(e){var r=e.split("="),t=r.shift().trimLeft().toLowerCase(),o=r.join("=");"expires"===t?p.expires=new Date(o):"max-age"===t?p.maxAge=parseInt(o,10):"secure"===t?p.secure=!0:"httponly"===t?p.httpOnly=!0:"samesite"===t?p.sameSite=o:"partitioned"===t?p.partitioned=!0:p[t]=o})),p}function a(e){var r="",t="",o=e.split("=");return o.length>1?(r=o.shift(),t=o.join("=")):t=e,{name:r,value:t}}function c(e,r){if(r=r?Object.assign({},s,r):s,!e)return r.map?{}:[];if(e.headers)if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var t=e.headers[Object.keys(e.headers).find((function(e){return"set-cookie"===e.toLowerCase()}))];t||!e.headers.cookie||r.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=t}if(Array.isArray(e)||(e=[e]),r.map){return e.filter(i).reduce((function(e,t){var o=n(t,r);return e[o.name]=o,e}),{})}return e.filter(i).map((function(e){return n(e,r)}))}function p(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,o,s,i,n,a=[],c=0;function p(){for(;c<e.length&&/\s/.test(e.charAt(c));)c+=1;return c<e.length}function l(){return"="!==(o=e.charAt(c))&&";"!==o&&","!==o}for(r(p,"skipWhitespace"),r(l,"notSpecialChar");c<e.length;){for(t=c,n=!1;p();)if(","===(o=e.charAt(c))){for(s=c,c+=1,p(),i=c;c<e.length&&l();)c+=1;c<e.length&&"="===e.charAt(c)?(n=!0,c=i,a.push(e.substring(t,s)),t=c):c=s+1}else c+=1;(!n||c>=e.length)&&a.push(e.substring(t,e.length))}return a}r(i,"isNonEmptyString"),r(n,"parseString"),r(a,"parseNameValuePair"),r(c,"parse"),r(p,"splitCookiesString"),t.exports=c,t.exports.parse=c,t.exports.parseString=n,t.exports.splitCookiesString=p}});o();var i=t(s(),1),n=r((e=>{const r={},t=[];return e.forEach(((e,o)=>{if("set-cookie"===o){const r=(0,i.splitCookiesString)(e);t.push(...(0,i.parse)(r))}else r[o]=e})),{headers:r,cookies:t}}),"splitCookiesFromHeaders"),a=r((e=>{const r=e.get("x-forwarded-for")??"127.0.0.1",[t]=r.split(", "),[o]=t.split(":");return o}),"getClientIPFromHeaders");function c(e){const r=e.get("x-ms-client-principal");if(r)try{const e=Buffer.from(r,"base64").toString("ascii");return JSON.parse(e)}catch(e){return void console.log("Unable to parse client principal:",e)}}r(c,"getClientPrincipalFromHeaders");export{n as splitCookiesFromHeaders,a as getClientIPFromHeaders,c as getClientPrincipalFromHeaders};//# sourceMappingURL=chunk-U5QCC3U4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/set-cookie-parser@2.7.1/node_modules/set-cookie-parser/lib/set-cookie.js","../src/headers.ts"],"sourcesContent":["\"use strict\";\n\nvar defaultParseOptions = {\n decodeValues: true,\n map: false,\n silent: false,\n};\n\nfunction isNonEmptyString(str) {\n return typeof str === \"string\" && !!str.trim();\n}\n\nfunction parseString(setCookieValue, options) {\n var parts = setCookieValue.split(\";\").filter(isNonEmptyString);\n\n var nameValuePairStr = parts.shift();\n var parsed = parseNameValuePair(nameValuePairStr);\n var name = parsed.name;\n var value = parsed.value;\n\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n try {\n value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value\n } catch (e) {\n console.error(\n \"set-cookie-parser encountered an error while decoding a cookie with value '\" +\n value +\n \"'. Set options.decodeValues to false to disable this feature.\",\n e\n );\n }\n\n var cookie = {\n name: name,\n value: value,\n };\n\n parts.forEach(function (part) {\n var sides = part.split(\"=\");\n var key = sides.shift().trimLeft().toLowerCase();\n var value = sides.join(\"=\");\n if (key === \"expires\") {\n cookie.expires = new Date(value);\n } else if (key === \"max-age\") {\n cookie.maxAge = parseInt(value, 10);\n } else if (key === \"secure\") {\n cookie.secure = true;\n } else if (key === \"httponly\") {\n cookie.httpOnly = true;\n } else if (key === \"samesite\") {\n cookie.sameSite = value;\n } else if (key === \"partitioned\") {\n cookie.partitioned = true;\n } else {\n cookie[key] = value;\n }\n });\n\n return cookie;\n}\n\nfunction parseNameValuePair(nameValuePairStr) {\n // Parses name-value-pair according to rfc6265bis draft\n\n var name = \"\";\n var value = \"\";\n var nameValueArr = nameValuePairStr.split(\"=\");\n if (nameValueArr.length > 1) {\n name = nameValueArr.shift();\n value = nameValueArr.join(\"=\"); // everything after the first =, joined by a \"=\" if there was more than one part\n } else {\n value = nameValuePairStr;\n }\n\n return { name: name, value: value };\n}\n\nfunction parse(input, options) {\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n if (!input) {\n if (!options.map) {\n return [];\n } else {\n return {};\n }\n }\n\n if (input.headers) {\n if (typeof input.headers.getSetCookie === \"function\") {\n // for fetch responses - they combine headers of the same type in the headers array,\n // but getSetCookie returns an uncombined array\n input = input.headers.getSetCookie();\n } else if (input.headers[\"set-cookie\"]) {\n // fast-path for node.js (which automatically normalizes header names to lower-case\n input = input.headers[\"set-cookie\"];\n } else {\n // slow-path for other environments - see #25\n var sch =\n input.headers[\n Object.keys(input.headers).find(function (key) {\n return key.toLowerCase() === \"set-cookie\";\n })\n ];\n // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36\n if (!sch && input.headers.cookie && !options.silent) {\n console.warn(\n \"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.\"\n );\n }\n input = sch;\n }\n }\n if (!Array.isArray(input)) {\n input = [input];\n }\n\n if (!options.map) {\n return input.filter(isNonEmptyString).map(function (str) {\n return parseString(str, options);\n });\n } else {\n var cookies = {};\n return input.filter(isNonEmptyString).reduce(function (cookies, str) {\n var cookie = parseString(str, options);\n cookies[cookie.name] = cookie;\n return cookies;\n }, cookies);\n }\n}\n\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n\n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/\nfunction splitCookiesString(cookiesString) {\n if (Array.isArray(cookiesString)) {\n return cookiesString;\n }\n if (typeof cookiesString !== \"string\") {\n return [];\n }\n\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n\n skipWhitespace();\n nextStart = pos;\n\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n\n return cookiesStrings;\n}\n\nmodule.exports = parse;\nmodule.exports.parse = parse;\nmodule.exports.parseString = parseString;\nmodule.exports.splitCookiesString = splitCookiesString;\n","import type { Cookie } from '@azure/functions';\nimport { parse, splitCookiesString } from 'set-cookie-parser';\nimport type { ClientPrincipal } from './types';\n\n/**\n * Splits 'set-cookie' headers into individual cookies\n */\nexport const splitCookiesFromHeaders = (headers: Headers): { headers: Record<string, string>; cookies: Cookie[] } => {\n const resHeaders: Record<string, string> = {};\n const resCookies: Cookie[] = [];\n\n headers.forEach((value, key) => {\n if (key === 'set-cookie') {\n const cookieStrings = splitCookiesString(value);\n resCookies.push(...(parse(cookieStrings) as Cookie[]));\n } else {\n resHeaders[key] = value;\n }\n });\n\n return { headers: resHeaders, cookies: resCookies };\n};\n\nexport const getClientIPFromHeaders = (headers: Headers): string => {\n const resHeader = headers.get('x-forwarded-for') ?? '127.0.0.1';\n const [origin] = resHeader.split(', ');\n const [ipAddress] = origin.split(':');\n return ipAddress;\n};\n\n/**\n * Gets the client principal from `x-ms-client-principal` header.\n */\nexport function getClientPrincipalFromHeaders(headers: Headers): ClientPrincipal | undefined {\n // Code adapted from the official SWA documentation\n // https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript#api-functions\n const header = headers.get('x-ms-client-principal');\n if (!header) {\n return undefined;\n }\n\n try {\n const encoded = Buffer.from(header, 'base64');\n const decoded = encoded.toString('ascii');\n const clientPrincipal = JSON.parse(decoded);\n\n return clientPrincipal;\n } catch (e) {\n console.log('Unable to parse client principal:', e);\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAEA,QAAI,sBAAsB;AAAA,MACxB,cAAc;AAAA,MACd,KAAK;AAAA,MACL,QAAQ;AAAA,IACV;AAEA,aAAS,iBAAiB,KAAK;AAC7B,aAAO,OAAO,QAAQ,YAAY,CAAC,CAAC,IAAI,KAAK;AAAA,IAC/C;AAFS;AAIT,aAAS,YAAY,gBAAgB,SAAS;AAC5C,UAAI,QAAQ,eAAe,MAAM,GAAG,EAAE,OAAO,gBAAgB;AAE7D,UAAI,mBAAmB,MAAM,MAAM;AACnC,UAAI,SAAS,mBAAmB,gBAAgB;AAChD,UAAI,OAAO,OAAO;AAClB,UAAI,QAAQ,OAAO;AAEnB,gBAAU,UACN,OAAO,OAAO,CAAC,GAAG,qBAAqB,OAAO,IAC9C;AAEJ,UAAI;AACF,gBAAQ,QAAQ,eAAe,mBAAmB,KAAK,IAAI;AAAA,MAC7D,SAAS,GAAG;AACV,gBAAQ;AAAA,UACN,gFACE,QACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAEA,UAAI,SAAS;AAAA,QACX;AAAA,QACA;AAAA,MACF;AAEA,YAAM,QAAQ,SAAU,MAAM;AAC5B,YAAI,QAAQ,KAAK,MAAM,GAAG;AAC1B,YAAI,MAAM,MAAM,MAAM,EAAE,SAAS,EAAE,YAAY;AAC/C,YAAIA,SAAQ,MAAM,KAAK,GAAG;AAC1B,YAAI,QAAQ,WAAW;AACrB,iBAAO,UAAU,IAAI,KAAKA,MAAK;AAAA,QACjC,WAAW,QAAQ,WAAW;AAC5B,iBAAO,S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GALsC;AAU/B,SAAS,8BAA8B,SAA+C;AAG3F,QAAM,SAAS,QAAQ,IAAI,uBAAuB;AAClD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,UAAU,OAAO,KAAK,QAAQ,QAAQ;AAC5C,UAAM,UAAU,QAAQ,SAAS,OAAO;AACxC,UAAM,kBAAkB,KAAK,MAAM,OAAO;AAE1C,WAAO;AAAA,EACT,SAAS,GAAG;AACV,YAAQ,IAAI,qCAAqC,CAAC;AAClD,WAAO;AAAA,EACT;AACF;AAlBgB;","names":["value","parse","cookies","splitCookiesString"]}
package/dist/handler.js CHANGED
@@ -1 +1 @@
1
- import{handler as o}from"./chunk-PJIDA4TG.js";import"./chunk-PSBHP5ZD.js";import"./chunk-GKOGVGYC.js";import"./chunk-AW5NC2LL.js";export{o as handler};//# sourceMappingURL=handler.js.map
1
+ import{handler as o}from"./chunk-MZGTF76B.js";import"./chunk-U5QCC3U4.js";import"./chunk-GKOGVGYC.js";import"./chunk-AW5NC2LL.js";export{o as handler};//# sourceMappingURL=handler.js.map
package/dist/headers.js CHANGED
@@ -1 +1 @@
1
- import{getClientIPFromHeaders as o,getClientPrincipalFromHeaders as r,splitCookiesFromHeaders as m}from"./chunk-PSBHP5ZD.js";import"./chunk-AW5NC2LL.js";export{o as getClientIPFromHeaders,r as getClientPrincipalFromHeaders,m as splitCookiesFromHeaders};//# sourceMappingURL=headers.js.map
1
+ import{getClientIPFromHeaders as o,getClientPrincipalFromHeaders as r,splitCookiesFromHeaders as m}from"./chunk-U5QCC3U4.js";import"./chunk-AW5NC2LL.js";export{o as getClientIPFromHeaders,r as getClientPrincipalFromHeaders,m as splitCookiesFromHeaders};//# sourceMappingURL=headers.js.map
package/dist/shims.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shims.ts","../node_modules/.pnpm/@sveltejs+kit@2.15.1_@sveltejs+vite-plugin-svelte@5.0.3_svelte@5.16.0_vite@6.0.6_@types+node@_3vyaly6met64vw3ow5k7jefbly/node_modules/@sveltejs/kit/src/exports/node/polyfills.js"],"sourcesContent":["import { installPolyfills } from '@sveltejs/kit/node/polyfills';\ninstallPolyfills();\n","import buffer from 'node:buffer';\nimport { webcrypto as crypto } from 'node:crypto';\n\n// `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0\nconst File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File;\n\n/** @type {Record<string, any>} */\nconst globals = {\n\tcrypto,\n\tFile\n};\n\n// exported for dev/preview and node environments\n/**\n * Make various web APIs available as globals:\n * - `crypto`\n * - `File`\n */\nexport function installPolyfills() {\n\tfor (const name in globals) {\n\t\tif (name in globalThis) continue;\n\n\t\tObject.defineProperty(globalThis, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: globals[name]\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;AAAA;;;ACAA;AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AAGpC,IAAM;AAAA;AAAA,EAA8D,OAAQ;AAAA;AAG5E,IAAM,UAAU;AAAA,EACf;AAAA,EACA;AACD;AAQO,SAAS,mBAAmB;AAClC,aAAW,QAAQ,SAAS;AAC3B,QAAI,QAAQ,WAAY;AAExB,WAAO,eAAe,YAAY,MAAM;AAAA,MACvC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO,QAAQ,IAAI;AAAA,IACpB,CAAC;AAAA,EACF;AACD;AAXgB;;;ADjBhB,iBAAiB;","names":[]}
1
+ {"version":3,"sources":["../src/shims.ts","../../../node_modules/.pnpm/@sveltejs+kit@2.15.2_@sveltejs+vite-plugin-svelte@5.0.3_svelte@5.17.1_vite@6.0.7_@types+node@_qlt44birs4qclslvkzfhazsygi/node_modules/@sveltejs/kit/src/exports/node/polyfills.js"],"sourcesContent":["import { installPolyfills } from '@sveltejs/kit/node/polyfills';\ninstallPolyfills();\n","import buffer from 'node:buffer';\nimport { webcrypto as crypto } from 'node:crypto';\n\n// `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0\nconst File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File;\n\n/** @type {Record<string, any>} */\nconst globals = {\n\tcrypto,\n\tFile\n};\n\n// exported for dev/preview and node environments\n/**\n * Make various web APIs available as globals:\n * - `crypto`\n * - `File`\n */\nexport function installPolyfills() {\n\tfor (const name in globals) {\n\t\tif (name in globalThis) continue;\n\n\t\tObject.defineProperty(globalThis, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: globals[name]\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;AAAA;;;ACAA;AAAA,OAAO,YAAY;AACnB,SAAS,aAAa,cAAc;AAGpC,IAAM;AAAA;AAAA,EAA8D,OAAQ;AAAA;AAG5E,IAAM,UAAU;AAAA,EACf;AAAA,EACA;AACD;AAQO,SAAS,mBAAmB;AAClC,aAAW,QAAQ,SAAS;AAC3B,QAAI,QAAQ,WAAY;AAExB,WAAO,eAAe,YAAY,MAAM;AAAA,MACvC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO,QAAQ,IAAI;AAAA,IACpB,CAAC;AAAA,EACF;AACD;AAXgB;;;ADjBhB,iBAAiB;","names":[]}