UNPKG

@wordpress/url

Version:
8 lines (7 loc) 720 B
{ "version": 3, "sources": ["../src/has-query-arg.ts"], "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { getQueryArg } from './get-query-arg';\n\n/**\n * Determines whether the URL contains a given query arg.\n *\n * @param url URL.\n * @param arg Query arg name.\n *\n * @example\n * ```js\n * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true\n * ```\n *\n * @return Whether or not the URL contains the query arg.\n */\nexport function hasQueryArg( url: string, arg: string ): boolean {\n\treturn getQueryArg( url, arg ) !== undefined;\n}\n"], "mappings": ";AAGA,SAAS,mBAAmB;AAerB,SAAS,YAAa,KAAa,KAAuB;AAChE,SAAO,YAAa,KAAK,GAAI,MAAM;AACpC;", "names": [] }