Packages narrative
packages / utils

utils

Functions

NameDescription
appFromHostExtract the app segment from a dev host header.
isDevelopmentWhether the current runtime is local development. Excludes
isDevHostTrue when the host belongs to a development TLD (
isLocalhostTrue when the host is the bare
isProductionWhether the current runtime is a real production deployment.
normalizeHostNormalize a host header to a canonical
parseHostTokenize a host header into its hostname/port/app/shop parts.
portFromHostExtract a numeric port from a host string, IPv6-safe. Returns null when no port is present or it is not a valid integer.
resolveBuildEnvDerives environment metadata from process variables, falling back to
shopFromHostExtract the shop identifier from an HTTP host header. Dev TLDs (
stripPortRemove the port suffix from a host string. IPv6-safe.

Interfaces

NameDescription
ParsedHostStructured breakdown of a host header.

Types

NameDescription
AppNameThe app segment of a dev host — typically
BuildEnvEnvironment metadata captured once at build time.
DevTldThe concrete type of
HostnameA normalized hostname: lowercased, port-stripped, no trailing dot.
ShopHandleA shop identifier as stored on the

Variables

NameDescription
DEV_TLDSTop-level domains treated as local development.

On this page