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

Function getStringQueryParam

packages/sf-core/src/utils/https/index.js:58–66  ·  view source on GitHub ↗
(url, param)

Source from the content-addressed store, hash-verified

56 * @returns The string value of the query parameter
57 */
58const getStringQueryParam = (url, param) => {
59 // Native URL object uses .search (with leading ?) not .query
60 const queryString = url.search ? url.search.slice(1) : ''
61 const query = qs.parse(queryString)
62 const value = query[param]
63 // Check if the value is an array and return the first element if so.
64 // Otherwise, return the value directly.
65 return Array.isArray(value) ? value[0] : value
66}
67
68/**
69 * Parses a GitHub URL and returns repository information

Callers 2

parseBitbucketURLFunction · 0.85
parseBitbucketServerURLFunction · 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…