UNPKG

serverless-offline

Version:

Emulate AWS λ and API Gateway locally when developing your Serverless project

16 lines (11 loc) 424 B
import { BASE_URL_PLACEHOLDER } from "../config/index.js" const { fromEntries } = Object export default function parseQueryStringParameters(url) { // dummy placeholder url for the WHATWG URL constructor // https://github.com/nodejs/node/issues/12682 const { searchParams } = new URL(url, BASE_URL_PLACEHOLDER) if (Array.from(searchParams).length === 0) { return null } return fromEntries(searchParams) }