UNPKG

@trpc/next

Version:

The tRPC Next.js library

44 lines (43 loc) • 1.11 kB
require("@trpc/server/unstable-core-do-not-import"); require("@trpc/client"); //#region src/app-dir/shared.ts /** * @internal */ function generateCacheTag(procedurePath, input) { return input !== void 0 ? `${procedurePath}?input=${JSON.stringify(input)}` : procedurePath; } /** * @internal */ function generateCacheTags(procedurePath, input) { if (!procedurePath) return []; const parts = procedurePath.split("."); const tags = []; for (let i = 1; i <= parts.length; i++) tags.push(parts.slice(0, i).join(".")); if (input !== void 0) tags.push(`${procedurePath}?input=${JSON.stringify(input)}`); return tags; } function isFormData(value) { if (typeof FormData === "undefined") return false; return value instanceof FormData; } //#endregion Object.defineProperty(exports, "generateCacheTag", { enumerable: true, get: function() { return generateCacheTag; } }); Object.defineProperty(exports, "generateCacheTags", { enumerable: true, get: function() { return generateCacheTags; } }); Object.defineProperty(exports, "isFormData", { enumerable: true, get: function() { return isFormData; } });