which-url 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,132 +7,156 @@ npm install which-url
7
7
  ```
8
8
 
9
9
  ```typescript
10
- import appUrl from 'which-url'
10
+ import { origin } from 'which-url'
11
11
 
12
- auth({ baseURL: appUrl.href }) // just works — local, preview, production
12
+ auth({ baseURL: origin })
13
+ fetch(`${origin}/api/data`)
13
14
  ```
14
15
 
15
- Works on Vercel, Netlify, Cloudflare Pages, Railway, Fly.io, Render, DigitalOcean, and Heroku — automatically.
16
+ ```
17
+ origin env
18
+ Local http://localhost:3000 "local"
19
+ Preview https://myapp-git-feat.vercel.app "preview"
20
+ Production https://myapp.com "production"
21
+ ```
16
22
 
17
- ## Usage
23
+ Works across environments (local, preview, production), runtimes (server, client, edge), and [platforms](#platform-support).
18
24
 
19
- ### Default export (object with dot access)
25
+ The default export gives you everything as an object:
20
26
 
21
27
  ```typescript
22
28
  import appUrl from 'which-url'
23
29
 
24
- appUrl.href // "https://myapp.vercel.app"
25
- appUrl.origin // "https://myapp.vercel.app"
26
- appUrl.hostname // "myapp.vercel.app"
27
- appUrl.host // "myapp.vercel.app"
28
- appUrl.protocol // "https:"
29
- appUrl.port // ""
30
-
31
- appUrl.env // "production" | "preview" | "local"
32
- appUrl.isProduction // boolean
33
- appUrl.isPreview // boolean
34
- appUrl.isLocal // boolean
30
+ appUrl.origin // "https://myapp.com"
31
+ appUrl.hostname // "myapp.com"
32
+ appUrl.protocol // "https:"
33
+ appUrl.env // "production"
34
+ appUrl.platform // "vercel"
35
+ appUrl.isProduction // true
35
36
  ```
36
37
 
37
- Property names follow the [WHATWG URL spec](https://url.spec.whatwg.org/) — nothing new to learn.
38
+ ## The problem
38
39
 
39
- ### Named exports (plain stringszero type friction)
40
+ Your app's base URL shows up everywhere OAuth callbacks, API calls, CORS, emails. Every one of these breaks if the URL is wrong:
40
41
 
41
42
  ```typescript
42
- import { href, hostname, origin, isProduction } from 'which-url'
43
+ // Auth needs the exact URL for OAuth redirects
44
+ auth({ baseURL: ??? })
43
45
 
44
- // Pass directly to any function that expects a string
45
- process.env.BETTER_AUTH_URL = href
46
- fetch(`${href}/api/data`)
47
- cookie.domain = hostname
46
+ // API calls from the client
47
+ fetch(`${???}/api/data`)
48
48
 
49
- if (isProduction) {
50
- // production-only logic
49
+ // Emails — links need to point somewhere real
50
+ `Click here to verify: ${???}/verify?token=${token}`
51
+
52
+ // CORS — needs to know its own origin
53
+ cors({ origin: ??? })
54
+ ```
55
+
56
+ Most teams end up with a helper that grows over time:
57
+
58
+ ```typescript
59
+ // lib/url.ts — every team has one of these
60
+ function getBaseUrl() {
61
+ if (typeof window !== 'undefined') return ''
62
+ if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`
63
+ return `http://localhost:${process.env.PORT ?? 3000}`
51
64
  }
65
+
66
+ // But wait — VERCEL_URL is the deployment URL, not your domain.
67
+ // And it doesn't work on the client. So you add more:
68
+ const baseUrl =
69
+ process.env.NEXT_PUBLIC_VERCEL_ENV === 'production'
70
+ ? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
71
+ : process.env.NEXT_PUBLIC_VERCEL_URL
72
+ ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
73
+ : `http://localhost:${process.env.PORT ?? 3000}`
74
+
75
+ // And then Netlify uses different env vars. And Cloudflare uses different ones.
76
+ // And someone forgets the https://. And preview URLs break in production...
52
77
  ```
53
78
 
54
79
  ## How it works
55
80
 
56
- `which-url` reads environment variables that hosting providers set automatically. No configuration needed.
57
-
58
- **Resolution priority:**
81
+ Reads environment variables that hosting providers set automatically:
59
82
 
60
83
  1. `APP_URL` env var (your override — always wins)
61
- 2. Provider auto-detection
62
- 3. `window.location.origin` (browser)
63
- 4. `http://localhost:${PORT || 3000}` (development)
64
- 5. Throws in production if nothing detected
65
-
66
- ## Provider support
67
-
68
- | Provider | Detection | URL source |
69
- |----------|-----------|------------|
70
- | **Vercel** | `VERCEL` | `VERCEL_PROJECT_PRODUCTION_URL` / `VERCEL_BRANCH_URL` / `VERCEL_URL` |
71
- | **Netlify** | `NETLIFY` | `URL` / `DEPLOY_PRIME_URL` / `DEPLOY_URL` |
72
- | **Cloudflare Pages** | `CF_PAGES` | `CF_PAGES_URL` |
73
- | **Railway** | `RAILWAY_PUBLIC_DOMAIN` | `RAILWAY_PUBLIC_DOMAIN` |
74
- | **Fly.io** | `FLY_APP_NAME` | `{app}.fly.dev` |
75
- | **Render** | `RENDER` | `RENDER_EXTERNAL_URL` |
76
- | **DigitalOcean** | `DIGITALOCEAN_APP_PLATFORM` | `APP_URL` |
77
- | **Heroku** | `HEROKU_APP_NAME` | `{app}.herokuapp.com` |
84
+ 2. Provider auto-detection (Vercel, Netlify, etc.)
85
+ 3. `window.location.origin` (browser fallback)
86
+ 4. `http://localhost:${PORT || 3000}` (development fallback)
87
+
88
+ If nothing is detected in production, the singleton logs a warning and returns empty strings. Call `createUrl()` directly if you want it to throw instead.
78
89
 
79
90
  ## Override with `APP_URL`
80
91
 
81
- Set `APP_URL` to override auto-detection. Useful for custom domains, tunnels, or unsupported providers.
92
+ Set `APP_URL` when auto-detection isn't enough custom domains, tunnels, or unsupported providers:
82
93
 
83
94
  ```bash
84
95
  # .env.local
85
96
  APP_URL=https://myapp.com
86
97
  ```
87
98
 
88
- `NEXT_PUBLIC_APP_URL` also works (for client-side access in Next.js).
89
-
90
- ## Local development
99
+ Works with or without protocol (`APP_URL=myapp.com` `https://myapp.com`).
91
100
 
92
- Zero configauto-detects `http://localhost:3000` (or `PORT` if set).
101
+ **Client-side frameworks:** All framework prefixes are supported automatically `NEXT_PUBLIC_APP_URL`, `VITE_APP_URL`, `PUBLIC_APP_URL`, `NUXT_ENV_APP_URL`, etc.
93
102
 
94
- ```bash
95
- # Custom port
96
- APP_URL=http://localhost:4000
103
+ ## Platform support
97
104
 
98
- # Custom local domain
99
- APP_URL=http://myapp.local:3000
105
+ | Platform | Detection | URL source | Verified |
106
+ |----------|-----------|------------|:--------:|
107
+ | **Vercel** | `VERCEL` | `VERCEL_PROJECT_PRODUCTION_URL` / `VERCEL_BRANCH_URL` / `VERCEL_URL` | [x] |
108
+ | **Netlify** | `NETLIFY` | `URL` / `DEPLOY_PRIME_URL` / `DEPLOY_URL` | [ ] |
109
+ | **Cloudflare Pages** | `CF_PAGES` | `CF_PAGES_URL` | [ ] |
110
+ | **Railway** | `RAILWAY_PUBLIC_DOMAIN` | `RAILWAY_PUBLIC_DOMAIN` | [ ] |
111
+ | **Fly.io** | `FLY_APP_NAME` | `{app}.fly.dev` | [ ] |
112
+ | **Render** | `RENDER` | `RENDER_EXTERNAL_URL` | [ ] |
113
+ | **DigitalOcean** | `DIGITALOCEAN_APP_PLATFORM` | `APP_URL` | [ ] |
114
+ | **Heroku** | `HEROKU_APP_NAME` | `{app}.herokuapp.com` | [ ] |
100
115
 
101
- # Local HTTPS (mkcert)
102
- APP_URL=https://localhost:3000
116
+ On the client, Vercel's framework-prefixed env vars (`NEXT_PUBLIC_VERCEL_URL`, `VITE_VERCEL_URL`, etc.) are detected automatically.
103
117
 
104
- # Tunnel
105
- APP_URL=https://abc123.ngrok-free.app
106
- ```
118
+ **Help us verify:** If you're using one of these providers, [open an issue](https://github.com/manishrc/which-url/issues) with the output of `import appUrl from 'which-url'; console.log(appUrl)` from your deployment. We'll mark it as verified.
107
119
 
108
- For tunnels with dynamic URLs:
120
+ ## Examples
109
121
 
110
- ```bash
111
- APP_URL=$(curl -s localhost:4040/api/tunnels | jq -r '.tunnels[0].public_url') npm run dev
112
- ```
122
+ ```typescript
123
+ import { origin, hostname, isProduction } from 'which-url'
113
124
 
114
- ## Error handling
125
+ // Better Auth
126
+ betterAuth({ baseURL: origin })
115
127
 
116
- In **production**, `which-url` throws if it can't detect the URL — preventing silent misconfiguration (broken OAuth, CORS, emails pointing to localhost).
128
+ // API calls
129
+ fetch(`${origin}/api/data`)
117
130
 
118
- Use `createUrl` with a fallback to opt into lenient behavior:
131
+ // CORS
132
+ cors({ origin })
119
133
 
120
- ```typescript
121
- import { createUrl } from 'which-url'
134
+ // Cookies
135
+ cookie.domain = hostname
122
136
 
123
- const url = createUrl({ fallback: 'https://fallback.example.com' })
124
- url.href // never throws
137
+ // Environment checks
138
+ if (isProduction) {
139
+ enableAnalytics()
140
+ }
125
141
  ```
126
142
 
127
- In **development**, it always falls back to localhost.
128
-
129
143
  ## Gotchas
130
144
 
131
145
  ### Vercel: Redeploy after assigning a custom domain
132
146
 
133
147
  Framework-prefixed env vars like `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` are inlined into the bundle at **build time** — the bundler replaces references with their literal values. If you assign a custom domain after deploying, the old deployment still has the previous URL baked in. Trigger a new deployment for the updated domain to take effect.
134
148
 
135
- ## Cloudflare Workers
149
+ ## Advanced
150
+
151
+ ### Tunnels (ngrok, Cloudflare Tunnel)
152
+
153
+ Tunnel URLs can't be auto-detected — they're external to the app process. Set `APP_URL`:
154
+
155
+ ```bash
156
+ APP_URL=https://abc123.ngrok-free.app npm run dev
157
+ ```
158
+
159
+ ### Cloudflare Workers
136
160
 
137
161
  Cloudflare Workers use runtime `env` bindings instead of `process.env`. Set `APP_URL` in `wrangler.toml`:
138
162
 
@@ -141,29 +165,17 @@ Cloudflare Workers use runtime `env` bindings instead of `process.env`. Set `APP
141
165
  APP_URL = "https://myapp.workers.dev"
142
166
  ```
143
167
 
144
- Modern wrangler polyfills `process.env` from `[vars]`, so `which-url` picks it up automatically. Cloudflare Pages build-time env vars also work.
145
-
146
- ## Integrations
147
-
148
- ### Better Auth
149
-
150
- ```typescript
151
- import appUrl from 'which-url'
152
- import { betterAuth } from 'better-auth'
168
+ Modern wrangler polyfills `process.env` from `[vars]`, so `which-url` picks it up automatically.
153
169
 
154
- export const auth = betterAuth({
155
- baseURL: appUrl.href,
156
- // ...
157
- })
158
- ```
170
+ ### `createUrl(options?)`
159
171
 
160
- ### NextAuth / Auth.js
172
+ Re-resolves the URL from the current environment. Unlike the singleton (which catches errors), `createUrl()` throws in production if no URL is detected.
161
173
 
162
174
  ```typescript
163
- import appUrl from 'which-url'
175
+ import { createUrl } from 'which-url'
164
176
 
165
- // No need to set NEXTAUTH_URL manually
166
- process.env.NEXTAUTH_URL = appUrl.href
177
+ const url = createUrl({ fallback: 'https://fallback.example.com' })
178
+ url.origin // never throws
167
179
  ```
168
180
 
169
181
  ## API
@@ -174,30 +186,19 @@ An object with URL properties and environment helpers.
174
186
 
175
187
  ### Named exports
176
188
 
177
- | Export | Type | Description |
178
- |--------|------|-------------|
179
- | `href` | `string` | Full URL (`https://myapp.vercel.app`) |
180
- | `origin` | `string` | Origin (`https://myapp.vercel.app`) |
181
- | `hostname` | `string` | Hostname (`myapp.vercel.app`) |
182
- | `host` | `string` | Host with port (`myapp.vercel.app`) |
183
- | `protocol` | `string` | Protocol (`https:`) |
184
- | `port` | `string` | Port (empty if default) |
189
+ | Export | Type | Example |
190
+ |--------|------|---------|
191
+ | `origin` | `string` | `"https://myapp.vercel.app"` |
192
+ | `hostname` | `string` | `"myapp.vercel.app"` |
193
+ | `host` | `string` | `"myapp.vercel.app"` or `"localhost:3000"` |
194
+ | `href` | `string` | Same as `origin` |
195
+ | `protocol` | `string` | `"https:"` |
196
+ | `port` | `string` | `""` or `"3000"` |
185
197
  | `env` | `AppEnv` | `"production"` \| `"preview"` \| `"local"` |
186
- | `isProduction` | `boolean` | `true` if production |
187
- | `isPreview` | `boolean` | `true` if preview/staging |
188
- | `isLocal` | `boolean` | `true` if local development |
189
- | `createUrl(options?)` | `function` | Create a new instance with custom options |
190
-
191
- ### `createUrl(options?)`
192
-
193
- ```typescript
194
- createUrl({ fallback?: string }): WhichUrl
195
- ```
196
-
197
- Re-resolves the URL from current environment. Use for:
198
- - Custom fallbacks (never throws)
199
- - Re-resolution in tests
200
- - Dynamic configuration
198
+ | `platform` | `Platform` | `"vercel"` \| `"netlify"` \| ... \| `null` |
199
+ | `isProduction` | `boolean` | |
200
+ | `isPreview` | `boolean` | |
201
+ | `isLocal` | `boolean` | |
201
202
 
202
203
  ## License
203
204
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { WhichUrl, AppEnv, CreateUrlOptions } from "./types";
1
+ import type { WhichUrl, AppEnv, Platform, CreateUrlOptions } from "./types";
2
2
  export declare function createUrl(options?: CreateUrlOptions): WhichUrl;
3
3
  declare let _resolved: WhichUrl;
4
4
  export declare const href: string;
@@ -8,9 +8,10 @@ export declare const host: string;
8
8
  export declare const protocol: string;
9
9
  export declare const port: string;
10
10
  export declare const env: AppEnv;
11
+ export declare const platform: Platform;
11
12
  export declare const isProduction: boolean;
12
13
  export declare const isPreview: boolean;
13
14
  export declare const isLocal: boolean;
14
15
  export default _resolved;
15
- export type { WhichUrl, AppEnv, CreateUrlOptions };
16
+ export type { WhichUrl, AppEnv, Platform, CreateUrlOptions };
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEjE,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,CAgB9D;AAGD,QAAA,IAAI,SAAS,EAAE,QAAQ,CAAA;AAsBvB,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,MAAM,EAAE,MAAyB,CAAA;AAC9C,eAAO,MAAM,QAAQ,EAAE,MAA2B,CAAA;AAClD,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,QAAQ,EAAE,MAA2B,CAAA;AAClD,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,GAAG,EAAE,MAAsB,CAAA;AACxC,eAAO,MAAM,YAAY,EAAE,OAAgC,CAAA;AAC3D,eAAO,MAAM,SAAS,EAAE,OAA6B,CAAA;AACrD,eAAO,MAAM,OAAO,EAAE,OAA2B,CAAA;AAGjD,eAAe,SAAS,CAAA;AAExB,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE3E,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,CAkB9D;AAGD,QAAA,IAAI,SAAS,EAAE,QAAQ,CAAA;AAuBvB,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,MAAM,EAAE,MAAyB,CAAA;AAC9C,eAAO,MAAM,QAAQ,EAAE,MAA2B,CAAA;AAClD,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,QAAQ,EAAE,MAA2B,CAAA;AAClD,eAAO,MAAM,IAAI,EAAE,MAAuB,CAAA;AAC1C,eAAO,MAAM,GAAG,EAAE,MAAsB,CAAA;AACxC,eAAO,MAAM,QAAQ,EAAE,QAA6B,CAAA;AACpD,eAAO,MAAM,YAAY,EAAE,OAAgC,CAAA;AAC3D,eAAO,MAAM,SAAS,EAAE,OAA6B,CAAA;AACrD,eAAO,MAAM,OAAO,EAAE,OAA2B,CAAA;AAGjD,eAAe,SAAS,CAAA;AAExB,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
package/dist/index.js CHANGED
@@ -169,6 +169,15 @@ function resolveUrl(options) {
169
169
  }
170
170
  throw new Error("which-url: Cannot detect app URL. Set APP_URL environment variable.");
171
171
  }
172
+ function resolvePlatform() {
173
+ const env = getEnv();
174
+ for (const p of providers) {
175
+ if (p.detect(env)) {
176
+ return p.name;
177
+ }
178
+ }
179
+ return null;
180
+ }
172
181
 
173
182
  // src/env.ts
174
183
  var validEnvs = ["production", "preview", "local"];
@@ -195,6 +204,7 @@ function createUrl(options) {
195
204
  const resolved = resolveUrl(options);
196
205
  const parsed = new URL(resolved);
197
206
  const env = resolveEnv();
207
+ const platform = resolvePlatform();
198
208
  return {
199
209
  href: parsed.origin,
200
210
  origin: parsed.origin,
@@ -203,6 +213,7 @@ function createUrl(options) {
203
213
  protocol: parsed.protocol,
204
214
  port: parsed.port,
205
215
  env,
216
+ platform,
206
217
  isProduction: env === "production",
207
218
  isPreview: env === "preview",
208
219
  isLocal: env === "local"
@@ -221,6 +232,7 @@ try {
221
232
  protocol: "",
222
233
  port: "",
223
234
  env: "local",
235
+ platform: null,
224
236
  isProduction: false,
225
237
  isPreview: false,
226
238
  isLocal: true
@@ -233,6 +245,7 @@ var host = _resolved.host;
233
245
  var protocol = _resolved.protocol;
234
246
  var port = _resolved.port;
235
247
  var env = _resolved.env;
248
+ var platform = _resolved.platform;
236
249
  var isProduction = _resolved.isProduction;
237
250
  var isPreview = _resolved.isPreview;
238
251
  var isLocal = _resolved.isLocal;
@@ -240,6 +253,7 @@ var src_default = _resolved;
240
253
  export {
241
254
  protocol,
242
255
  port,
256
+ platform,
243
257
  origin,
244
258
  isProduction,
245
259
  isPreview,
package/dist/resolve.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import type { CreateUrlOptions } from "./types";
1
+ import type { CreateUrlOptions, Platform } from "./types";
2
2
  export declare function resolveUrl(options?: CreateUrlOptions): string;
3
+ export declare function resolvePlatform(): Platform;
3
4
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAoC7D"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEzD,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAoC7D;AAED,wBAAgB,eAAe,IAAI,QAAQ,CAQ1C"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export type AppEnv = "production" | "preview" | "local";
2
+ export type Platform = "vercel" | "netlify" | "cloudflare" | "railway" | "fly" | "render" | "digitalocean" | "heroku" | null;
2
3
  export interface WhichUrl {
3
4
  href: string;
4
5
  origin: string;
@@ -7,6 +8,7 @@ export interface WhichUrl {
7
8
  protocol: string;
8
9
  port: string;
9
10
  env: AppEnv;
11
+ platform: Platform;
10
12
  isProduction: boolean;
11
13
  isPreview: boolean;
12
14
  isLocal: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAA;AAEvD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,OAAO,CAAA;IAC5D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACtE,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,MAAM,CAAA;CAChE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAA;AAEvD,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,SAAS,GACT,KAAK,GACL,QAAQ,GACR,cAAc,GACd,QAAQ,GACR,IAAI,CAAA;AAER,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,QAAQ,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,OAAO,CAAA;IAC5D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACtE,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,MAAM,CAAA;CAChE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "which-url",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Auto-detect your app's URL across hosting providers. Zero config.",
5
5
  "type": "module",
6
6
  "exports": {