From 4c8dd09c08ae4ad86252f84430e4e514ba7400d0 Mon Sep 17 00:00:00 2001 From: Per-Kristian Nordnes Date: Thu, 30 Jan 2025 16:04:23 +0100 Subject: [PATCH] refactor(types): globalDocumentReference format to use ':' instead of '/' --- packages/@sanity/types/src/globalDocumentReference/asserters.ts | 2 +- packages/@sanity/types/src/globalDocumentReference/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@sanity/types/src/globalDocumentReference/asserters.ts b/packages/@sanity/types/src/globalDocumentReference/asserters.ts index 1dcaed40576..f5be83fbb82 100644 --- a/packages/@sanity/types/src/globalDocumentReference/asserters.ts +++ b/packages/@sanity/types/src/globalDocumentReference/asserters.ts @@ -9,5 +9,5 @@ export function isGlobalDocumentReference( return false } - return reference._ref.split('/').length === 3 + return reference._ref.split(':').length === 3 } diff --git a/packages/@sanity/types/src/globalDocumentReference/types.ts b/packages/@sanity/types/src/globalDocumentReference/types.ts index 32fab8b4806..9647acdf283 100644 --- a/packages/@sanity/types/src/globalDocumentReference/types.ts +++ b/packages/@sanity/types/src/globalDocumentReference/types.ts @@ -8,7 +8,7 @@ import {type ObjectSchemaType, type PreviewConfig} from '../schema' /** @beta */ export interface GlobalDocumentReferenceValue { _type: string - _ref: `${string}/${string}/${string}` + _ref: `${string}:${string}:${string}` _key?: string _weak?: boolean }