UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

23 lines (22 loc) • 993 B
export * as z from "zod/v4"; export { defineLiveCollection } from "../content/config.js"; function createErrorFunction(message) { return () => { const error = new Error(`The ${message}() function is not available in live config files.`); // Remove the virtual module path from the stack trace const stackLines = error.stack?.split("\n"); if (stackLines && stackLines.length > 1) { stackLines.splice(1, 1); error.stack = stackLines.join("\n"); } throw error; }; } export const getCollection = createErrorFunction("getCollection"); export const render = createErrorFunction("render"); export const getEntry = createErrorFunction("getEntry"); export const getEntries = createErrorFunction("getEntries"); export const reference = createErrorFunction("reference"); export const getLiveCollection = createErrorFunction("getLiveCollection"); export const getLiveEntry = createErrorFunction("getLiveEntry"); export const defineCollection = createErrorFunction("defineCollection");