UNPKG

@wordpress/url

Version:
8 lines (7 loc) 836 B
{ "version": 3, "sources": ["../src/get-query-arg.ts"], "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\n\nexport interface QueryArgObject {\n\t[ key: string ]: QueryArgParsed;\n}\n\nexport type QueryArgParsed = string | string[] | QueryArgObject;\n\n/**\n * Returns a single query argument of the url\n *\n * @param url URL.\n * @param arg Query arg name.\n *\n * @example\n * ```js\n * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar\n * ```\n *\n * @return Query arg value.\n */\nexport function getQueryArg(\n\turl: string,\n\targ: string\n): QueryArgParsed | undefined {\n\treturn getQueryArgs( url )[ arg ];\n}\n"], "mappings": ";AAGA,SAAS,oBAAoB;AAqBtB,SAAS,YACf,KACA,KAC6B;AAC7B,SAAO,aAAc,GAAI,EAAG,GAAI;AACjC;", "names": [] }