Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/c14e27d8fc8c76cbd36c946baca4ecce3d2e8eab466da863de71e519678406cc.json

1 line
7.6 KiB
JSON
Raw Normal View History

2024-11-04 02:58:45 +00:00
{"ast":null,"code":"function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nimport { log } from \"../utils/log.js\";\nvar WebSocketClient = /*#__PURE__*/function () {\n /**\n * @param {string} url\n */\n function WebSocketClient(url) {\n _classCallCheck(this, WebSocketClient);\n this.client = new WebSocket(url);\n this.client.onerror = function (error) {\n log.error(error);\n };\n }\n\n /**\n * @param {(...args: any[]) => void} f\n */\n return _createClass(WebSocketClient, [{\n key: \"onOpen\",\n value: function onOpen(f) {\n this.client.onopen = f;\n }\n\n /**\n * @param {(...args: any[]) => void} f\n */\n }, {\n key: \"onClose\",\n value: function onClose(f) {\n this.client.onclose = f;\n }\n\n // call f with the message string as the first argument\n /**\n * @param {(...args: any[]) => void} f\n */\n }, {\n key: \"onMessage\",\n value: function onMessage(f) {\n this.client.onmessage = function (e) {\n f(e.data);\n };\n }\n }]);\n}();\nexport { WebSocketClient as default };","map":{"version":3,"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","protoProps","staticProps","prototype","t","_toPrimitive","r","e","Symbol","toPrimitive","call","String","Number","log","WebSocketClient","url","client","WebSocket","onerror","error","value","onOpen","f","onopen","onClose","onclose","onMessage","onmessage","data","default"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/webpack-dev-server/client/clients/WebSocketClient.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r |