@shipstatic/types 0.1.10 → 0.1.11
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/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/src/index.ts +8 -0
package/dist/index.d.ts
CHANGED
|
@@ -226,3 +226,7 @@ export declare function validateApiKey(apiKey: string): void;
|
|
|
226
226
|
* Validate API URL format
|
|
227
227
|
*/
|
|
228
228
|
export declare function validateApiUrl(apiUrl: string): void;
|
|
229
|
+
/**
|
|
230
|
+
* Validate subdomain format (deployment pattern)
|
|
231
|
+
*/
|
|
232
|
+
export declare function validateSubdomain(input: string): boolean;
|
package/dist/index.js
CHANGED
|
@@ -204,3 +204,10 @@ export function validateApiUrl(apiUrl) {
|
|
|
204
204
|
throw ShipError.validation('API URL must be a valid URL');
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Validate subdomain format (deployment pattern)
|
|
209
|
+
*/
|
|
210
|
+
export function validateSubdomain(input) {
|
|
211
|
+
// Deployment subdomain format: word-word-7chars (e.g. "happy-cat-abc1234")
|
|
212
|
+
return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
|
|
213
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -409,4 +409,12 @@ export function validateApiUrl(apiUrl: string): void {
|
|
|
409
409
|
}
|
|
410
410
|
throw ShipError.validation('API URL must be a valid URL');
|
|
411
411
|
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Validate subdomain format (deployment pattern)
|
|
416
|
+
*/
|
|
417
|
+
export function validateSubdomain(input: string): boolean {
|
|
418
|
+
// Deployment subdomain format: word-word-7chars (e.g. "happy-cat-abc1234")
|
|
419
|
+
return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
|
|
412
420
|
}
|