Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

collection-options-brand.ts

13 lines386 Bytes

1export const collectionOptionsBrand: unique symbol = Symbol.for(
2 `@tanstack/db.collectionOptions`,
3) as never
4​
5export function hasCollectionOptionsBrandValue(
6 value: unknown,
7): value is { readonly [collectionOptionsBrand]: true } {
8 return (
9 typeof value === `object` &&
10 value !== null &&
11 (value as Record<PropertyKey, unknown>)[collectionOptionsBrand] === true
12 )