Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/fd839f77aadb6b02ec4e0a60dae3b296.json
2020-12-22 09:59:14 -05:00

1 line
1.1 KiB
JSON

{"ast":null,"code":"'use strict';\n\nvar URL = require('url-parse');\n\nvar debug = function debug() {};\n\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:utils:url');\n}\n\nmodule.exports = {\n getOrigin: function getOrigin(url) {\n if (!url) {\n return null;\n }\n\n var p = new URL(url);\n\n if (p.protocol === 'file:') {\n return null;\n }\n\n var port = p.port;\n\n if (!port) {\n port = p.protocol === 'https:' ? '443' : '80';\n }\n\n return p.protocol + '//' + p.hostname + ':' + port;\n },\n isOriginEqual: function isOriginEqual(a, b) {\n var res = this.getOrigin(a) === this.getOrigin(b);\n debug('same', a, b, res);\n return res;\n },\n isSchemeEqual: function isSchemeEqual(a, b) {\n return a.split(':')[0] === b.split(':')[0];\n },\n addPath: function addPath(url, path) {\n var qs = url.split('?');\n return qs[0] + path + (qs[1] ? '?' + qs[1] : '');\n },\n addQuery: function addQuery(url, q) {\n return url + (url.indexOf('?') === -1 ? '?' + q : '&' + q);\n }\n};","map":null,"metadata":{},"sourceType":"script"}