Nullable

db · /index·type

Adds null to a type to represent an explicitly absent value, distinct from undefined which TypeScript uses for optional properties. Use when a field can be cleared to a known empty state.

Definition

@nordcom/commerce-db
type Nullable = T | null;

T | null

Example

import type { Nullable } from '@nordcom/commerce-db';
const avatar: Nullable<string> = user.avatar ?? null;

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Sourceindex.ts:29Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page