Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
672 B
Text
18 lines
672 B
Text
import { NumericValue } from "@smithy/core/serde";
|
|
export function jsonReviver(key, value, context) {
|
|
if (context?.source) {
|
|
const numericString = context.source;
|
|
if (typeof value === "number") {
|
|
if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {
|
|
const isFractional = numericString.includes(".");
|
|
if (isFractional) {
|
|
return new NumericValue(numericString, "bigDecimal");
|
|
}
|
|
else {
|
|
return BigInt(numericString);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return value;
|
|
}
|