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

1 line
1.1 KiB
JSON

{"ast":null,"code":"'use strict';\n\nvar EventEmitter = require('events').EventEmitter,\n inherits = require('inherits'),\n JSON3 = require('json3'),\n objectUtils = require('./utils/object');\n\nvar debug = function debug() {};\n\nif (process.env.NODE_ENV !== 'production') {\n debug = require('debug')('sockjs-client:info-ajax');\n}\n\nfunction InfoAjax(url, AjaxObject) {\n EventEmitter.call(this);\n var self = this;\n var t0 = +new Date();\n this.xo = new AjaxObject('GET', url);\n this.xo.once('finish', function (status, text) {\n var info, rtt;\n\n if (status === 200) {\n rtt = +new Date() - t0;\n\n if (text) {\n try {\n info = JSON3.parse(text);\n } catch (e) {\n debug('bad json', text);\n }\n }\n\n if (!objectUtils.isObject(info)) {\n info = {};\n }\n }\n\n self.emit('finish', info, rtt);\n self.removeAllListeners();\n });\n}\n\ninherits(InfoAjax, EventEmitter);\n\nInfoAjax.prototype.close = function () {\n this.removeAllListeners();\n this.xo.close();\n};\n\nmodule.exports = InfoAjax;","map":null,"metadata":{},"sourceType":"script"}