MCPcopy Index your code
hub / github.com/serverless/serverless / validateUrl

Function validateUrl

packages/sf-core/src/utils/https/index.js:34–39  ·  view source on GitHub ↗
({ url, hostname, service, owner, repo })

Source from the content-addressed store, hash-verified

32 * @param repo - Repository name
33 */
34const validateUrl = ({ url, hostname, service, owner, repo }) => {
35 if (url.hostname !== hostname || !owner || !repo) {
36 const errorMessage = `The URL must be a valid ${service} URL in the following format: https://${hostname}/owner/repo`
37 throw new Error(errorMessage)
38 }
39}
40
41/**
42 * Check if the URL is pointing to a Git repository

Callers 3

parseGitHubURLFunction · 0.85
parseBitbucketURLFunction · 0.85
parseGitlabURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…