You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
13 KiB
1 lines
13 KiB
{"ast":null,"code":"/**\n * @param {{ protocol?: string, auth?: string, hostname?: string, port?: string, pathname?: string, search?: string, hash?: string, slashes?: boolean }} objURL\n * @returns {string}\n */\nfunction format(objURL) {\n var protocol = objURL.protocol || \"\";\n\n if (protocol && protocol.substr(-1) !== \":\") {\n protocol += \":\";\n }\n\n var auth = objURL.auth || \"\";\n\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, \":\");\n auth += \"@\";\n }\n\n var host = \"\";\n\n if (objURL.hostname) {\n host = auth + (objURL.hostname.indexOf(\":\") === -1 ? objURL.hostname : \"[\".concat(objURL.hostname, \"]\"));\n\n if (objURL.port) {\n host += \":\".concat(objURL.port);\n }\n }\n\n var pathname = objURL.pathname || \"\";\n\n if (objURL.slashes) {\n host = \"//\".concat(host || \"\");\n\n if (pathname && pathname.charAt(0) !== \"/\") {\n pathname = \"/\".concat(pathname);\n }\n } else if (!host) {\n host = \"\";\n }\n\n var search = objURL.search || \"\";\n\n if (search && search.charAt(0) !== \"?\") {\n search = \"?\".concat(search);\n }\n\n var hash = objURL.hash || \"\";\n\n if (hash && hash.charAt(0) !== \"#\") {\n hash = \"#\".concat(hash);\n }\n\n pathname = pathname.replace(/[?#]/g,\n /**\n * @param {string} match\n * @returns {string}\n */\n function (match) {\n return encodeURIComponent(match);\n });\n search = search.replace(\"#\", \"%23\");\n return \"\".concat(protocol).concat(host).concat(pathname).concat(search).concat(hash);\n}\n/**\n * @param {URL & { fromCurrentScript?: boolean }} parsedURL\n * @returns {string}\n */\n\n\nfunction createSocketURL(parsedURL) {\n var hostname = parsedURL.hostname; // Node.js module parses it as `::`\n // `new URL(urlString, [baseURLString])` parses it as '[::]'\n\n var isInAddrAny = hostname === \"0.0.0.0\" || hostname === \"::\" || hostname === \"[::]\"; // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n if (isInAddrAny && self.location.hostname && self.location.protocol.indexOf(\"http\") === 0) {\n hostname = self.location.hostname;\n }\n\n var socketURLProtocol = parsedURL.protocol || self.location.protocol; // When https is used in the app, secure web sockets are always necessary because the browser doesn't accept non-secure web sockets.\n\n if (socketURLProtocol === \"auto:\" || hostname && isInAddrAny && self.location.protocol === \"https:\") {\n socketURLProtocol = self.location.protocol;\n }\n\n socketURLProtocol = socketURLProtocol.replace(/^(?:http|.+-extension|file)/i, \"ws\");\n var socketURLAuth = \"\"; // `new URL(urlString, [baseURLstring])` doesn't have `auth` property\n // Parse authentication credentials in case we need them\n\n if (parsedURL.username) {\n socketURLAuth = parsedURL.username; // Since HTTP basic authentication does not allow empty username,\n // we only include password if the username is not empty.\n\n if (parsedURL.password) {\n // Result: <username>:<password>\n socketURLAuth = socketURLAuth.concat(\":\", parsedURL.password);\n }\n } // In case the host is a raw IPv6 address, it can be enclosed in\n // the brackets as the brackets are needed in the final URL string.\n // Need to remove those as url.format blindly adds its own set of brackets\n // if the host string contains colons. That would lead to non-working\n // double brackets (e.g. [[::]]) host\n //\n // All of these web socket url params are optionally passed in through resourceQuery,\n // so we need to fall back to the default if they are not provided\n\n\n var socketURLHostname = (hostname || self.location.hostname || \"localhost\").replace(/^\\[(.*)\\]$/, \"$1\");\n var socketURLPort = parsedURL.port;\n\n if (!socketURLPort || socketURLPort === \"0\") {\n socketURLPort = self.location.port;\n } // If path is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n\n\n var socketURLPathname = \"/ws\";\n\n if (parsedURL.pathname && !parsedURL.fromCurrentScript) {\n socketURLPathname = parsedURL.pathname;\n }\n\n return format({\n protocol: socketURLProtocol,\n auth: socketURLAuth,\n hostname: socketURLHostname,\n port: socketURLPort,\n pathname: socketURLPathname,\n slashes: true\n });\n}\n\nexport default createSocketURL;","map":{"version":3,"names":["format","objURL","protocol","substr","auth","encodeURIComponent","replace","host","hostname","indexOf","concat","port","pathname","slashes","charAt","search","hash","match","createSocketURL","parsedURL","isInAddrAny","self","location","socketURLProtocol","socketURLAuth","username","password","socketURLHostname","socketURLPort","socketURLPathname","fromCurrentScript"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/webpack-dev-server/client/utils/createSocketURL.js"],"sourcesContent":["/**\n * @param {{ protocol?: string, auth?: string, hostname?: string, port?: string, pathname?: string, search?: string, hash?: string, slashes?: boolean }} objURL\n * @returns {string}\n */\nfunction format(objURL) {\n var protocol = objURL.protocol || \"\";\n\n if (protocol && protocol.substr(-1) !== \":\") {\n protocol += \":\";\n }\n\n var auth = objURL.auth || \"\";\n\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, \":\");\n auth += \"@\";\n }\n\n var host = \"\";\n\n if (objURL.hostname) {\n host = auth + (objURL.hostname.indexOf(\":\") === -1 ? objURL.hostname : \"[\".concat(objURL.hostname, \"]\"));\n\n if (objURL.port) {\n host += \":\".concat(objURL.port);\n }\n }\n\n var pathname = objURL.pathname || \"\";\n\n if (objURL.slashes) {\n host = \"//\".concat(host || \"\");\n\n if (pathname && pathname.charAt(0) !== \"/\") {\n pathname = \"/\".concat(pathname);\n }\n } else if (!host) {\n host = \"\";\n }\n\n var search = objURL.search || \"\";\n\n if (search && search.charAt(0) !== \"?\") {\n search = \"?\".concat(search);\n }\n\n var hash = objURL.hash || \"\";\n\n if (hash && hash.charAt(0) !== \"#\") {\n hash = \"#\".concat(hash);\n }\n\n pathname = pathname.replace(/[?#]/g,\n /**\n * @param {string} match\n * @returns {string}\n */\n function (match) {\n return encodeURIComponent(match);\n });\n search = search.replace(\"#\", \"%23\");\n return \"\".concat(protocol).concat(host).concat(pathname).concat(search).concat(hash);\n}\n/**\n * @param {URL & { fromCurrentScript?: boolean }} parsedURL\n * @returns {string}\n */\n\n\nfunction createSocketURL(parsedURL) {\n var hostname = parsedURL.hostname; // Node.js module parses it as `::`\n // `new URL(urlString, [baseURLString])` parses it as '[::]'\n\n var isInAddrAny = hostname === \"0.0.0.0\" || hostname === \"::\" || hostname === \"[::]\"; // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n if (isInAddrAny && self.location.hostname && self.location.protocol.indexOf(\"http\") === 0) {\n hostname = self.location.hostname;\n }\n\n var socketURLProtocol = parsedURL.protocol || self.location.protocol; // When https is used in the app, secure web sockets are always necessary because the browser doesn't accept non-secure web sockets.\n\n if (socketURLProtocol === \"auto:\" || hostname && isInAddrAny && self.location.protocol === \"https:\") {\n socketURLProtocol = self.location.protocol;\n }\n\n socketURLProtocol = socketURLProtocol.replace(/^(?:http|.+-extension|file)/i, \"ws\");\n var socketURLAuth = \"\"; // `new URL(urlString, [baseURLstring])` doesn't have `auth` property\n // Parse authentication credentials in case we need them\n\n if (parsedURL.username) {\n socketURLAuth = parsedURL.username; // Since HTTP basic authentication does not allow empty username,\n // we only include password if the username is not empty.\n\n if (parsedURL.password) {\n // Result: <username>:<password>\n socketURLAuth = socketURLAuth.concat(\":\", parsedURL.password);\n }\n } // In case the host is a raw IPv6 address, it can be enclosed in\n // the brackets as the brackets are needed in the final URL string.\n // Need to remove those as url.format blindly adds its own set of brackets\n // if the host string contains colons. That would lead to non-working\n // double brackets (e.g. [[::]]) host\n //\n // All of these web socket url params are optionally passed in through resourceQuery,\n // so we need to fall back to the default if they are not provided\n\n\n var socketURLHostname = (hostname || self.location.hostname || \"localhost\").replace(/^\\[(.*)\\]$/, \"$1\");\n var socketURLPort = parsedURL.port;\n\n if (!socketURLPort || socketURLPort === \"0\") {\n socketURLPort = self.location.port;\n } // If path is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n\n\n var socketURLPathname = \"/ws\";\n\n if (parsedURL.pathname && !parsedURL.fromCurrentScript) {\n socketURLPathname = parsedURL.pathname;\n }\n\n return format({\n protocol: socketURLProtocol,\n auth: socketURLAuth,\n hostname: socketURLHostname,\n port: socketURLPort,\n pathname: socketURLPathname,\n slashes: true\n });\n}\n\nexport default createSocketURL;"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,MAAT,CAAgBC,MAAhB,EAAwB;EACtB,IAAIC,QAAQ,GAAGD,MAAM,CAACC,QAAP,IAAmB,EAAlC;;EAEA,IAAIA,QAAQ,IAAIA,QAAQ,CAACC,MAAT,CAAgB,CAAC,CAAjB,MAAwB,GAAxC,EAA6C;IAC3CD,QAAQ,IAAI,GAAZ;EACD;;EAED,IAAIE,IAAI,GAAGH,MAAM,CAACG,IAAP,IAAe,EAA1B;;EAEA,IAAIA,IAAJ,EAAU;IACRA,IAAI,GAAGC,kBAAkB,CAACD,IAAD,CAAzB;IACAA,IAAI,GAAGA,IAAI,CAACE,OAAL,CAAa,MAAb,EAAqB,GAArB,CAAP;IACAF,IAAI,IAAI,GAAR;EACD;;EAED,IAAIG,IAAI,GAAG,EAAX;;EAEA,IAAIN,MAAM,CAACO,QAAX,EAAqB;IACnBD,IAAI,GAAGH,IAAI,IAAIH,MAAM,CAACO,QAAP,CAAgBC,OAAhB,CAAwB,GAAxB,MAAiC,CAAC,CAAlC,GAAsCR,MAAM,CAACO,QAA7C,GAAwD,IAAIE,MAAJ,CAAWT,MAAM,CAACO,QAAlB,EAA4B,GAA5B,CAA5D,CAAX;;IAEA,IAAIP,MAAM,CAACU,IAAX,EAAiB;MACfJ,IAAI,IAAI,IAAIG,MAAJ,CAAWT,MAAM,CAACU,IAAlB,CAAR;IACD;EACF;;EAED,IAAIC,QAAQ,GAAGX,MAAM,CAACW,QAAP,IAAmB,EAAlC;;EAEA,IAAIX,MAAM,CAACY,OAAX,EAAoB;IAClBN,IAAI,GAAG,KAAKG,MAAL,CAAYH,IAAI,IAAI,EAApB,CAAP;;IAEA,IAAIK,QAAQ,IAAIA,QAAQ,CAACE,MAAT,CAAgB,CAAhB,MAAuB,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