MCPcopy
hub / github.com/ionic-team/capacitor / checkAppId

Function checkAppId

cli/src/common.ts:120–136  ·  view source on GitHub ↗
(config: Config, id: string)

Source from the content-addressed store, hash-verified

118}
119
120export async function checkAppId(config: Config, id: string): Promise<string | null> {
121 if (!id) {
122 return `Invalid App ID. App ID is required and cannot be blank.`;
123 }
124 if (/^[a-zA-Z][\w]*(?:\.[a-zA-Z][\w]*)+$/.test(id.toLowerCase())) {
125 return null;
126 }
127 return `
128 Invalid App ID "${id}". Your App ID must meet the following requirements to be valid on both iOS and Android:
129 - Must be in Java package form with no dashes (ex: com.example.app)
130 - It must have at least two segments (one or more dots).
131 - Each segment must start with a letter.
132 - All characters must be alphanumeric or an underscore [a-zA-Z][a-zA-Z0-9]+.
133
134 If you would like to skip validation, run "cap init" with the "--skip-appid-validation" flag.
135 `;
136}
137
138export async function checkAppName(config: Config, name: string): Promise<string | null> {
139 // We allow pretty much anything right now, have fun

Callers 2

initCommandFunction · 0.90
checkAppConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected