forked from swc-project/swc
-
Notifications
You must be signed in to change notification settings - Fork 4
/
input.js
77 lines (66 loc) · 3.51 KB
/
input.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[405], {
/***/ 4186:
/***/ (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function () { return /* binding */ Home; }
/* harmony export */
});
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5893);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7294);
/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7160);
/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _gmod_binary_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9996);
/* harmony import */ var binary_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9567);
/* provided dependency */ var Buffer = __webpack_require__(1876)["Buffer"];
function Home() {
(0, react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
const ipHeader1 = new _gmod_binary_parser__WEBPACK_IMPORTED_MODULE_2__/* .Parser */._().uint8("compressionMethod", {
formatter: (b) => {
const method = [
"raw"
][b];
if (!method) {
// never gets here
console.log("in @gmod/binary-parser");
}
return method;
}
});
const ipHeader2 = new binary_parser__WEBPACK_IMPORTED_MODULE_3__/* .Parser */._().uint8("compressionMethod", {
formatter: (b) => {
const method = [
"raw"
][b];
if (!method) {
console.log("in binary-parser");
}
return method;
}
});
console.log({
ipHeader1,
ipHeader2
});
// wouldn't actually parse correctly, just shows minification crash
const buf = Buffer.from("450002c5939900002c06ef98adc24f6c850186d1", "hex");
console.log(ipHeader2.parse(buf));
console.log(ipHeader1.parse(buf));
}, []);
return /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_4___default().container),
children: "hello"
});
}
/***/
}),
},
/******/ function (__webpack_require__) { // webpackRuntimeModules
/******/ var __webpack_exec__ = function (moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
/******/ __webpack_require__.O(0, [390, 774, 888, 179], function () { return __webpack_exec__(8312); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
/******/
}
]);