Packages narrative
packages / utils
utils
Functions
| Name | Description |
|---|---|
appFromHost | Extract the app segment from a dev host header. |
isDevelopment | Whether the current runtime is local development. Excludes |
isDevHost | True when the host belongs to a development TLD ( |
isLocalhost | True when the host is the bare |
isProduction | Whether the current runtime is a real production deployment. |
normalizeHost | Normalize a host header to a canonical |
parseHost | Tokenize a host header into its hostname/port/app/shop parts. |
portFromHost | Extract a numeric port from a host string, IPv6-safe. Returns null when no port is present or it is not a valid integer. |
resolveBuildEnv | Derives environment metadata from process variables, falling back to |
shopFromHost | Extract the shop identifier from an HTTP host header. Dev TLDs ( |
stripPort | Remove the port suffix from a host string. IPv6-safe. |
Interfaces
| Name | Description |
|---|---|
ParsedHost | Structured breakdown of a host header. |
Types
| Name | Description |
|---|---|
AppName | The app segment of a dev host — typically |
BuildEnv | Environment metadata captured once at build time. |
DevTld | The concrete type of |
Hostname | A normalized hostname: lowercased, port-stripped, no trailing dot. |
ShopHandle | A shop identifier as stored on the |
Variables
| Name | Description |
|---|---|
DEV_TLDS | Top-level domains treated as local development. |