youtuber-blog-frontend/build/server/chunks/exports-DuWZopOC.js.map

1 line
11 KiB
Plaintext
Raw Normal View History

2024-05-29 18:43:41 +00:00
{"version":3,"file":"exports-DuWZopOC.js","sources":["../../../.svelte-kit/adapter-node/chunks/exports.js"],"sourcesContent":["const internal = new URL(\"sveltekit-internal://\");\nfunction resolve(base, path) {\n if (path[0] === \"/\" && path[1] === \"/\")\n return path;\n let url = new URL(base, internal);\n url = new URL(path, url);\n return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;\n}\nfunction normalize_path(path, trailing_slash) {\n if (path === \"/\" || trailing_slash === \"ignore\")\n return path;\n if (trailing_slash === \"never\") {\n return path.endsWith(\"/\") ? path.slice(0, -1) : path;\n } else if (trailing_slash === \"always\" && !path.endsWith(\"/\")) {\n return path + \"/\";\n }\n return path;\n}\nfunction decode_pathname(pathname) {\n return pathname.split(\"%25\").map(decodeURI).join(\"%25\");\n}\nfunction decode_params(params) {\n for (const key in params) {\n params[key] = decodeURIComponent(params[key]);\n }\n return params;\n}\nconst tracked_url_properties = (\n /** @type {const} */\n [\n \"href\",\n \"pathname\",\n \"search\",\n \"toString\",\n \"toJSON\"\n ]\n);\nfunction make_trackable(url, callback, search_params_callback) {\n const tracked = new URL(url);\n Object.defineProperty(tracked, \"searchParams\", {\n value: new Proxy(tracked.searchParams, {\n get(obj, key) {\n if (key === \"get\" || key === \"getAll\" || key === \"has\") {\n return (param) => {\n search_params_callback(param);\n return obj[key](param);\n };\n }\n callback();\n const value = Reflect.get(obj, key);\n return typeof value === \"function\" ? value.bind(obj) : value;\n }\n }),\n enumerable: true,\n configurable: true\n });\n for (const property of tracked_url_properties) {\n Object.defineProperty(tracked, property, {\n get() {\n callback();\n return url[property];\n },\n enumerable: true,\n configurable: true\n });\n }\n {\n tracked[Symbol.for(\"nodejs.util.inspect.custom\")] = (depth, opts, inspect) => {\n return inspect(url, opts);\n };\n }\n {\n disable_hash(tracked);\n }\n return tracked;\n}\nfunction disable_hash(url) {\n allow_nodejs_console_log(url);\n Object.defineProperty(url, \"hash\", {\n get() {\n throw new Error(\n \"Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead\"\n );\n }\n });\n}\nfunction disable_search(url) {\n allow_nodejs_console_log(url);\n for (const property of [\"search\", \"searchParams\"]) {\n Object.defineProperty(url, property, {\n get() {\n throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);\n }\n });\n }\n}\nfunction allow_nodejs_console_log(url) {\n {\n url[Symbol.for(\"nodejs.util.inspect.custom\")] = (depth, opts, inspect) => {\n return inspect(new URL(url), opts);\n };\n }\n}\nconst DATA_SUFFIX = \"/__data.json\";\nconst HTML_DATA_SUFFIX = \".html__data.json\";\nfunction has_data_suffix(pathname) {\n return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);\n}\nfunction add_data_suffix(pathname) {\n if (pathname.endsWith(\".html\"))\n return pathname.replace(/\\.html$/, HTML_DATA_SUFFIX);\n return pathname.replace(/\\/$/, \"\") + DATA_SUFFIX;\n}\nfunction strip_data_suffix(pathname) {\n if (pathname.endsWith(HTML_DATA_SUFFIX)) {\n return pathname.slice(0, -HTML_DATA_SUFFIX.length) + \".html\";\n }\n return pathname.slice(0, -DATA_SUFFIX.length);\n}\nfunction validator(expected) {\n function validate(module, file) {\n if (!module)\n return;\n for (const key in module) {\n if (key[0] === \"_\" || expected.has(key))\n continue;\n const values = [...expected.values()];\n const hint = hint_for_supported_files(key, file?.slice(file.lastIndexOf(\".\"))) ?? `valid exports are ${values.join(\", \")}, or anything with a '_' prefix`;\n throw new