@dooboostore/simple-boot-http-server 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -14
- package/dist/cjs/SimpleBootHttpServer.js +20 -16
- package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
- package/dist/cjs/codes/Mimes.js +2 -0
- package/dist/cjs/codes/Mimes.js.map +2 -2
- package/dist/cjs/decorators/MethodMapping.js +2 -2
- package/dist/cjs/decorators/MethodMapping.js.map +2 -2
- package/dist/cjs/filters/ResourceFilter.js +0 -1
- package/dist/cjs/filters/ResourceFilter.js.map +2 -2
- package/dist/cjs/websocket/WebSocketManager.js +68 -40
- package/dist/cjs/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm/SimpleBootHttpServer.js +20 -16
- package/dist/esm/SimpleBootHttpServer.js.map +2 -2
- package/dist/esm/codes/Mimes.js +2 -0
- package/dist/esm/codes/Mimes.js.map +2 -2
- package/dist/esm/decorators/MethodMapping.js +2 -2
- package/dist/esm/decorators/MethodMapping.js.map +2 -2
- package/dist/esm/filters/ResourceFilter.js +0 -1
- package/dist/esm/filters/ResourceFilter.js.map +2 -2
- package/dist/esm/websocket/WebSocketManager.js +68 -40
- package/dist/esm/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +279 -137
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
- package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
- package/dist/types/codes/Mimes.d.ts +2 -0
- package/dist/types/codes/Mimes.d.ts.map +1 -1
- package/dist/types/decorators/MethodMapping.d.ts +8 -0
- package/dist/types/decorators/MethodMapping.d.ts.map +1 -1
- package/dist/types/filters/ResourceFilter.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketManager.d.ts +3 -1
- package/dist/types/websocket/WebSocketManager.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +279 -137
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
- package/dist/umd-bundle/websocket-client.umd.js +209 -9
- package/dist/umd-bundle/websocket-client.umd.js.map +4 -4
- package/package.json +8 -8
- package/src/SimpleBootHttpServer.ts +21 -16
- package/src/codes/Mimes.ts +2 -0
- package/src/decorators/MethodMapping.ts +14 -7
- package/src/filters/ResourceFilter.ts +0 -1
- package/src/websocket/WebSocketManager.ts +69 -41
|
@@ -36,9 +36,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
36
36
|
));
|
|
37
37
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
38
|
|
|
39
|
-
//
|
|
39
|
+
// ../../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
40
40
|
var require_Reflect = __commonJS({
|
|
41
|
-
"
|
|
41
|
+
"../../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js"() {
|
|
42
42
|
var Reflect2;
|
|
43
43
|
(function(Reflect3) {
|
|
44
44
|
(function(factory) {
|
|
@@ -1121,9 +1121,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
});
|
|
1123
1123
|
|
|
1124
|
-
//
|
|
1124
|
+
// ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json
|
|
1125
1125
|
var require_db = __commonJS({
|
|
1126
|
-
"
|
|
1126
|
+
"../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports, module) {
|
|
1127
1127
|
module.exports = {
|
|
1128
1128
|
"application/1d-interleaved-parityfec": {
|
|
1129
1129
|
source: "iana"
|
|
@@ -9646,16 +9646,16 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
9646
9646
|
}
|
|
9647
9647
|
});
|
|
9648
9648
|
|
|
9649
|
-
//
|
|
9649
|
+
// ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
|
|
9650
9650
|
var require_mime_db = __commonJS({
|
|
9651
|
-
"
|
|
9651
|
+
"../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports, module) {
|
|
9652
9652
|
module.exports = require_db();
|
|
9653
9653
|
}
|
|
9654
9654
|
});
|
|
9655
9655
|
|
|
9656
|
-
//
|
|
9656
|
+
// ../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js
|
|
9657
9657
|
var require_mime_types = __commonJS({
|
|
9658
|
-
"
|
|
9658
|
+
"../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports) {
|
|
9659
9659
|
"use strict";
|
|
9660
9660
|
var db = require_mime_db();
|
|
9661
9661
|
var extname2 = __require("path").extname;
|
|
@@ -9743,9 +9743,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
9743
9743
|
}
|
|
9744
9744
|
});
|
|
9745
9745
|
|
|
9746
|
-
//
|
|
9746
|
+
// ../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js
|
|
9747
9747
|
var require_dist = __commonJS({
|
|
9748
|
-
"
|
|
9748
|
+
"../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js"(exports, module) {
|
|
9749
9749
|
"use strict";
|
|
9750
9750
|
var zlib = __require("zlib");
|
|
9751
9751
|
module.exports = {
|
|
@@ -9771,9 +9771,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
9771
9771
|
}
|
|
9772
9772
|
});
|
|
9773
9773
|
|
|
9774
|
-
//
|
|
9774
|
+
// ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js
|
|
9775
9775
|
var require_helpers = __commonJS({
|
|
9776
|
-
"
|
|
9776
|
+
"../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js"(exports) {
|
|
9777
9777
|
var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
|
|
9778
9778
|
var extendStatics = function(d, b) {
|
|
9779
9779
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
@@ -9939,9 +9939,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
9939
9939
|
}
|
|
9940
9940
|
});
|
|
9941
9941
|
|
|
9942
|
-
//
|
|
9942
|
+
// ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js
|
|
9943
9943
|
var require_core = __commonJS({
|
|
9944
|
-
"
|
|
9944
|
+
"../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js"(exports) {
|
|
9945
9945
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9946
9946
|
var helpers_js_1 = require_helpers();
|
|
9947
9947
|
exports.JsonPatchError = helpers_js_1.PatchError;
|
|
@@ -10272,9 +10272,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10272
10272
|
}
|
|
10273
10273
|
});
|
|
10274
10274
|
|
|
10275
|
-
//
|
|
10275
|
+
// ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js
|
|
10276
10276
|
var require_duplex = __commonJS({
|
|
10277
|
-
"
|
|
10277
|
+
"../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js"(exports) {
|
|
10278
10278
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10279
10279
|
var helpers_js_1 = require_helpers();
|
|
10280
10280
|
var core_js_1 = require_core();
|
|
@@ -10446,9 +10446,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10446
10446
|
}
|
|
10447
10447
|
});
|
|
10448
10448
|
|
|
10449
|
-
//
|
|
10449
|
+
// ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js
|
|
10450
10450
|
var require_fast_json_patch = __commonJS({
|
|
10451
|
-
"
|
|
10451
|
+
"../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js"(exports) {
|
|
10452
10452
|
var core = require_core();
|
|
10453
10453
|
Object.assign(exports, core);
|
|
10454
10454
|
var duplex = require_duplex();
|
|
@@ -10461,9 +10461,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10461
10461
|
}
|
|
10462
10462
|
});
|
|
10463
10463
|
|
|
10464
|
-
//
|
|
10464
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js
|
|
10465
10465
|
var require_constants = __commonJS({
|
|
10466
|
-
"
|
|
10466
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js"(exports, module) {
|
|
10467
10467
|
"use strict";
|
|
10468
10468
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
10469
10469
|
var hasBlob = typeof Blob !== "undefined";
|
|
@@ -10484,9 +10484,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10484
10484
|
}
|
|
10485
10485
|
});
|
|
10486
10486
|
|
|
10487
|
-
//
|
|
10487
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js
|
|
10488
10488
|
var require_buffer_util = __commonJS({
|
|
10489
|
-
"
|
|
10489
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js"(exports, module) {
|
|
10490
10490
|
"use strict";
|
|
10491
10491
|
var { EMPTY_BUFFER } = require_constants();
|
|
10492
10492
|
var FastBuffer = Buffer[Symbol.species];
|
|
@@ -10559,9 +10559,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10559
10559
|
}
|
|
10560
10560
|
});
|
|
10561
10561
|
|
|
10562
|
-
//
|
|
10562
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/limiter.js
|
|
10563
10563
|
var require_limiter = __commonJS({
|
|
10564
|
-
"
|
|
10564
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/limiter.js"(exports, module) {
|
|
10565
10565
|
"use strict";
|
|
10566
10566
|
var kDone = Symbol("kDone");
|
|
10567
10567
|
var kRun = Symbol("kRun");
|
|
@@ -10609,9 +10609,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10609
10609
|
}
|
|
10610
10610
|
});
|
|
10611
10611
|
|
|
10612
|
-
//
|
|
10612
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/permessage-deflate.js
|
|
10613
10613
|
var require_permessage_deflate = __commonJS({
|
|
10614
|
-
"
|
|
10614
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/permessage-deflate.js"(exports, module) {
|
|
10615
10615
|
"use strict";
|
|
10616
10616
|
var zlib = __require("zlib");
|
|
10617
10617
|
var bufferUtil = require_buffer_util();
|
|
@@ -10992,9 +10992,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
10992
10992
|
}
|
|
10993
10993
|
});
|
|
10994
10994
|
|
|
10995
|
-
//
|
|
10995
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/validation.js
|
|
10996
10996
|
var require_validation = __commonJS({
|
|
10997
|
-
"
|
|
10997
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/validation.js"(exports, module) {
|
|
10998
10998
|
"use strict";
|
|
10999
10999
|
var { isUtf8 } = __require("buffer");
|
|
11000
11000
|
var { hasBlob } = require_constants();
|
|
@@ -11193,9 +11193,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11193
11193
|
}
|
|
11194
11194
|
});
|
|
11195
11195
|
|
|
11196
|
-
//
|
|
11196
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/receiver.js
|
|
11197
11197
|
var require_receiver = __commonJS({
|
|
11198
|
-
"
|
|
11198
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/receiver.js"(exports, module) {
|
|
11199
11199
|
"use strict";
|
|
11200
11200
|
var { Writable } = __require("stream");
|
|
11201
11201
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -11228,10 +11228,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11228
11228
|
* extensions
|
|
11229
11229
|
* @param {Boolean} [options.isServer=false] Specifies whether to operate in
|
|
11230
11230
|
* client or server mode
|
|
11231
|
-
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
11232
|
-
* buffered data chunks
|
|
11233
|
-
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
11234
|
-
* fragments
|
|
11235
11231
|
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
11236
11232
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
11237
11233
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -11242,8 +11238,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11242
11238
|
this._binaryType = options.binaryType || BINARY_TYPES[0];
|
|
11243
11239
|
this._extensions = options.extensions || {};
|
|
11244
11240
|
this._isServer = !!options.isServer;
|
|
11245
|
-
this._maxBufferedChunks = options.maxBufferedChunks | 0;
|
|
11246
|
-
this._maxFragments = options.maxFragments | 0;
|
|
11247
11241
|
this._maxPayload = options.maxPayload | 0;
|
|
11248
11242
|
this._skipUTF8Validation = !!options.skipUTF8Validation;
|
|
11249
11243
|
this[kWebSocket] = void 0;
|
|
@@ -11273,18 +11267,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11273
11267
|
*/
|
|
11274
11268
|
_write(chunk, encoding, cb) {
|
|
11275
11269
|
if (this._opcode === 8 && this._state == GET_INFO) return cb();
|
|
11276
|
-
if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
|
|
11277
|
-
cb(
|
|
11278
|
-
this.createError(
|
|
11279
|
-
RangeError,
|
|
11280
|
-
"Too many buffered chunks",
|
|
11281
|
-
false,
|
|
11282
|
-
1008,
|
|
11283
|
-
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
11284
|
-
)
|
|
11285
|
-
);
|
|
11286
|
-
return;
|
|
11287
|
-
}
|
|
11288
11270
|
this._bufferedBytes += chunk.length;
|
|
11289
11271
|
this._buffers.push(chunk);
|
|
11290
11272
|
this.startLoop(cb);
|
|
@@ -11614,17 +11596,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11614
11596
|
return;
|
|
11615
11597
|
}
|
|
11616
11598
|
if (data.length) {
|
|
11617
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
11618
|
-
const error = this.createError(
|
|
11619
|
-
RangeError,
|
|
11620
|
-
"Too many message fragments",
|
|
11621
|
-
false,
|
|
11622
|
-
1008,
|
|
11623
|
-
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
11624
|
-
);
|
|
11625
|
-
cb(error);
|
|
11626
|
-
return;
|
|
11627
|
-
}
|
|
11628
11599
|
this._messageLength = this._totalPayloadLength;
|
|
11629
11600
|
this._fragments.push(data);
|
|
11630
11601
|
}
|
|
@@ -11654,17 +11625,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11654
11625
|
cb(error);
|
|
11655
11626
|
return;
|
|
11656
11627
|
}
|
|
11657
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
11658
|
-
const error = this.createError(
|
|
11659
|
-
RangeError,
|
|
11660
|
-
"Too many message fragments",
|
|
11661
|
-
false,
|
|
11662
|
-
1008,
|
|
11663
|
-
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
11664
|
-
);
|
|
11665
|
-
cb(error);
|
|
11666
|
-
return;
|
|
11667
|
-
}
|
|
11668
11628
|
this._fragments.push(buf);
|
|
11669
11629
|
}
|
|
11670
11630
|
this.dataMessage(cb);
|
|
@@ -11825,15 +11785,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11825
11785
|
}
|
|
11826
11786
|
});
|
|
11827
11787
|
|
|
11828
|
-
//
|
|
11788
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/sender.js
|
|
11829
11789
|
var require_sender = __commonJS({
|
|
11830
|
-
"
|
|
11790
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/sender.js"(exports, module) {
|
|
11831
11791
|
"use strict";
|
|
11832
11792
|
var { Duplex } = __require("stream");
|
|
11833
11793
|
var { randomFillSync } = __require("crypto");
|
|
11834
|
-
var {
|
|
11835
|
-
types: { isUint8Array }
|
|
11836
|
-
} = __require("util");
|
|
11837
11794
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
11838
11795
|
var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
|
|
11839
11796
|
var { isBlob, isValidStatusCode } = require_validation();
|
|
@@ -11987,10 +11944,8 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
11987
11944
|
buf.writeUInt16BE(code, 0);
|
|
11988
11945
|
if (typeof data === "string") {
|
|
11989
11946
|
buf.write(data, 2);
|
|
11990
|
-
} else if (isUint8Array(data)) {
|
|
11991
|
-
buf.set(data, 2);
|
|
11992
11947
|
} else {
|
|
11993
|
-
|
|
11948
|
+
buf.set(data, 2);
|
|
11994
11949
|
}
|
|
11995
11950
|
}
|
|
11996
11951
|
const options = {
|
|
@@ -12318,9 +12273,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
12318
12273
|
}
|
|
12319
12274
|
});
|
|
12320
12275
|
|
|
12321
|
-
//
|
|
12276
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/event-target.js
|
|
12322
12277
|
var require_event_target = __commonJS({
|
|
12323
|
-
"
|
|
12278
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/event-target.js"(exports, module) {
|
|
12324
12279
|
"use strict";
|
|
12325
12280
|
var { kForOnEventAttribute, kListener } = require_constants();
|
|
12326
12281
|
var kCode = Symbol("kCode");
|
|
@@ -12547,9 +12502,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
12547
12502
|
}
|
|
12548
12503
|
});
|
|
12549
12504
|
|
|
12550
|
-
//
|
|
12505
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/extension.js
|
|
12551
12506
|
var require_extension = __commonJS({
|
|
12552
|
-
"
|
|
12507
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/extension.js"(exports, module) {
|
|
12553
12508
|
"use strict";
|
|
12554
12509
|
var { tokenChars } = require_validation();
|
|
12555
12510
|
function push(dest, name, elem) {
|
|
@@ -12700,9 +12655,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
12700
12655
|
}
|
|
12701
12656
|
});
|
|
12702
12657
|
|
|
12703
|
-
//
|
|
12658
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket.js
|
|
12704
12659
|
var require_websocket = __commonJS({
|
|
12705
|
-
"
|
|
12660
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket.js"(exports, module) {
|
|
12706
12661
|
"use strict";
|
|
12707
12662
|
var EventEmitter = __require("events");
|
|
12708
12663
|
var https = __require("https");
|
|
@@ -12871,10 +12826,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
12871
12826
|
* multiple times in the same tick
|
|
12872
12827
|
* @param {Function} [options.generateMask] The function used to generate the
|
|
12873
12828
|
* masking key
|
|
12874
|
-
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
12875
|
-
* buffered data chunks
|
|
12876
|
-
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
12877
|
-
* fragments
|
|
12878
12829
|
* @param {Number} [options.maxPayload=0] The maximum allowed message size
|
|
12879
12830
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
12880
12831
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -12886,8 +12837,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
12886
12837
|
binaryType: this.binaryType,
|
|
12887
12838
|
extensions: this._extensions,
|
|
12888
12839
|
isServer: this._isServer,
|
|
12889
|
-
maxBufferedChunks: options.maxBufferedChunks,
|
|
12890
|
-
maxFragments: options.maxFragments,
|
|
12891
12840
|
maxPayload: options.maxPayload,
|
|
12892
12841
|
skipUTF8Validation: options.skipUTF8Validation
|
|
12893
12842
|
});
|
|
@@ -13187,8 +13136,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13187
13136
|
autoPong: true,
|
|
13188
13137
|
closeTimeout: CLOSE_TIMEOUT,
|
|
13189
13138
|
protocolVersion: protocolVersions[1],
|
|
13190
|
-
maxBufferedChunks: 1024 * 1024,
|
|
13191
|
-
maxFragments: 128 * 1024,
|
|
13192
13139
|
maxPayload: 100 * 1024 * 1024,
|
|
13193
13140
|
skipUTF8Validation: false,
|
|
13194
13141
|
perMessageDeflate: true,
|
|
@@ -13431,8 +13378,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13431
13378
|
websocket.setSocket(socket, head, {
|
|
13432
13379
|
allowSynchronousEvents: opts.allowSynchronousEvents,
|
|
13433
13380
|
generateMask: opts.generateMask,
|
|
13434
|
-
maxBufferedChunks: opts.maxBufferedChunks,
|
|
13435
|
-
maxFragments: opts.maxFragments,
|
|
13436
13381
|
maxPayload: opts.maxPayload,
|
|
13437
13382
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
13438
13383
|
});
|
|
@@ -13596,9 +13541,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13596
13541
|
}
|
|
13597
13542
|
});
|
|
13598
13543
|
|
|
13599
|
-
//
|
|
13544
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/stream.js
|
|
13600
13545
|
var require_stream = __commonJS({
|
|
13601
|
-
"
|
|
13546
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/stream.js"(exports, module) {
|
|
13602
13547
|
"use strict";
|
|
13603
13548
|
var WebSocket3 = require_websocket();
|
|
13604
13549
|
var { Duplex } = __require("stream");
|
|
@@ -13694,9 +13639,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13694
13639
|
}
|
|
13695
13640
|
});
|
|
13696
13641
|
|
|
13697
|
-
//
|
|
13642
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/subprotocol.js
|
|
13698
13643
|
var require_subprotocol = __commonJS({
|
|
13699
|
-
"
|
|
13644
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/subprotocol.js"(exports, module) {
|
|
13700
13645
|
"use strict";
|
|
13701
13646
|
var { tokenChars } = require_validation();
|
|
13702
13647
|
function parse2(header) {
|
|
@@ -13739,9 +13684,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13739
13684
|
}
|
|
13740
13685
|
});
|
|
13741
13686
|
|
|
13742
|
-
//
|
|
13687
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket-server.js
|
|
13743
13688
|
var require_websocket_server = __commonJS({
|
|
13744
|
-
"
|
|
13689
|
+
"../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket-server.js"(exports, module) {
|
|
13745
13690
|
"use strict";
|
|
13746
13691
|
var EventEmitter = __require("events");
|
|
13747
13692
|
var http = __require("http");
|
|
@@ -13775,10 +13720,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13775
13720
|
* called
|
|
13776
13721
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
13777
13722
|
* @param {String} [options.host] The hostname where to bind the server
|
|
13778
|
-
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
13779
|
-
* buffered data chunks
|
|
13780
|
-
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
13781
|
-
* fragments
|
|
13782
13723
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
13783
13724
|
* size
|
|
13784
13725
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
@@ -13800,8 +13741,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
13800
13741
|
options = {
|
|
13801
13742
|
allowSynchronousEvents: true,
|
|
13802
13743
|
autoPong: true,
|
|
13803
|
-
maxBufferedChunks: 1024 * 1024,
|
|
13804
|
-
maxFragments: 128 * 1024,
|
|
13805
13744
|
maxPayload: 100 * 1024 * 1024,
|
|
13806
13745
|
skipUTF8Validation: false,
|
|
13807
13746
|
perMessageDeflate: false,
|
|
@@ -14081,8 +14020,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
14081
14020
|
socket.removeListener("error", socketOnError);
|
|
14082
14021
|
ws.setSocket(socket, head, {
|
|
14083
14022
|
allowSynchronousEvents: this.options.allowSynchronousEvents,
|
|
14084
|
-
maxBufferedChunks: this.options.maxBufferedChunks,
|
|
14085
|
-
maxFragments: this.options.maxFragments,
|
|
14086
14023
|
maxPayload: this.options.maxPayload,
|
|
14087
14024
|
skipUTF8Validation: this.options.skipUTF8Validation
|
|
14088
14025
|
});
|
|
@@ -14260,6 +14197,8 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
14260
14197
|
Mimes2["ImageXpixmap"] = "image/x-xpixmap";
|
|
14261
14198
|
Mimes2["ImageXxbm"] = "image/x-xbm";
|
|
14262
14199
|
Mimes2["MultipartFormData"] = "multipart/form-data";
|
|
14200
|
+
Mimes2["TextEventStream"] = "text/event-stream";
|
|
14201
|
+
Mimes2["ApplicationXndjson"] = "application/x-ndjson";
|
|
14263
14202
|
Mimes2["ApplicationJsonPostSimpleBootSsrIntentScheme"] = "application/json-post+simple-boot-ssr-intent-scheme";
|
|
14264
14203
|
Mimes2["Intent"] = "intent";
|
|
14265
14204
|
return Mimes2;
|
|
@@ -14392,6 +14331,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
14392
14331
|
Fetcher: () => Fetcher,
|
|
14393
14332
|
FormValidator: () => FormValidator,
|
|
14394
14333
|
FunctionUtils: () => FunctionUtils,
|
|
14334
|
+
HashUtils: () => HashUtils,
|
|
14395
14335
|
HttpFetcher: () => HttpFetcher,
|
|
14396
14336
|
HttpJsonFetcher: () => HttpJsonFetcher,
|
|
14397
14337
|
HttpResponseError: () => HttpResponseError,
|
|
@@ -14472,6 +14412,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
14472
14412
|
isCssCommentItem: () => isCssCommentItem,
|
|
14473
14413
|
isCssDeclarationItem: () => isCssDeclarationItem,
|
|
14474
14414
|
isCssRuleItem: () => isCssRuleItem,
|
|
14415
|
+
isDefined: () => isDefined,
|
|
14475
14416
|
isHttpResponseError: () => isHttpResponseError,
|
|
14476
14417
|
isPoint2DType: () => isPoint2DType,
|
|
14477
14418
|
isPoint3DType: () => isPoint3DType,
|
|
@@ -16431,6 +16372,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16431
16372
|
this.z = z ?? 0;
|
|
16432
16373
|
}
|
|
16433
16374
|
}
|
|
16375
|
+
/**
|
|
16376
|
+
* 성분 대입 (파괴적). 벡터 전달 시 그 성분을 복사.
|
|
16377
|
+
* @example
|
|
16378
|
+
* v.set(1, 2, 3); // v = (1, 2, 3)
|
|
16379
|
+
* v.set(otherVector); // v = other와 동일 성분
|
|
16380
|
+
*/
|
|
16434
16381
|
set(v, y = 0, z = 0) {
|
|
16435
16382
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16436
16383
|
this.set(v.x || 0, v.y || 0, v.z || 0);
|
|
@@ -16441,16 +16388,45 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16441
16388
|
}
|
|
16442
16389
|
return this;
|
|
16443
16390
|
}
|
|
16391
|
+
/**
|
|
16392
|
+
* 복사본 반환 (비파괴). 파괴적 메서드와 조합해 원본 보존용.
|
|
16393
|
+
* @example
|
|
16394
|
+
* const s = a.get(); s.add(b); // s = a+b, a는 그대로
|
|
16395
|
+
*/
|
|
16444
16396
|
get() {
|
|
16445
16397
|
return new _Vector(this.x, this.y, this.z);
|
|
16446
16398
|
}
|
|
16447
|
-
|
|
16448
|
-
|
|
16399
|
+
/**
|
|
16400
|
+
* 노름(norm). 평평한 공간(유클리드 공간)에서의 직선 거리.
|
|
16401
|
+
* - 수식: ‖v‖ = √(x² + y² + z²)
|
|
16402
|
+
* - 2D에서는 피타고라스 정리 그 자체. 3D는 두 번 적용한 것과 같음.
|
|
16403
|
+
* (바닥 대각선 √(x²+y²) → 공간 대각선 √((바닥)²+z²))
|
|
16404
|
+
* - "유클리드"는 평평한 공간의 기하학을 말함 (좌표계는 데카르트의 것, 유클리드는 좌표 없이 기하학을 세움).
|
|
16405
|
+
* 휘어진 공간(구면·쌍곡)에서는 이 공식이 성립하지 않음.
|
|
16406
|
+
* @example
|
|
16407
|
+
* new Vector(3, 4, 0).norm(); // 5
|
|
16408
|
+
* new Vector(6, 8, 0).norm(); // 10
|
|
16409
|
+
*/
|
|
16410
|
+
norm() {
|
|
16449
16411
|
const x = this.x;
|
|
16450
16412
|
const y = this.y;
|
|
16451
16413
|
const z = this.z;
|
|
16452
16414
|
return Math.sqrt(x * x + y * y + z * z);
|
|
16453
16415
|
}
|
|
16416
|
+
/**
|
|
16417
|
+
* norm()의 별칭 (p5.js 호환).
|
|
16418
|
+
* @example
|
|
16419
|
+
* new Vector(3, 4, 0).mag(); // 5
|
|
16420
|
+
*/
|
|
16421
|
+
mag() {
|
|
16422
|
+
return this.norm();
|
|
16423
|
+
}
|
|
16424
|
+
/**
|
|
16425
|
+
* 덧셈 (파괴적). 성분별 합. 기하학적으로 평행사변형의 대각선.
|
|
16426
|
+
* - 수식: a + b = (ax+bx, ay+by, az+bz)
|
|
16427
|
+
* @example
|
|
16428
|
+
* const a = new Vector(4, 2); a.add(new Vector(-2, 3)); // a = (2, 5)
|
|
16429
|
+
*/
|
|
16454
16430
|
add(v, y = 0, z = 0) {
|
|
16455
16431
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16456
16432
|
this.x += v.x;
|
|
@@ -16462,12 +16438,24 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16462
16438
|
this.z += z;
|
|
16463
16439
|
}
|
|
16464
16440
|
}
|
|
16441
|
+
/**
|
|
16442
|
+
* 덧셈 결과의 새 벡터 반환 (비파괴).
|
|
16443
|
+
* - 수식: a + b = (ax+bx, ay+by, az+bz)
|
|
16444
|
+
* @example
|
|
16445
|
+
* const s = a.toAdd(a, b); // s = a+b, a·b는 그대로
|
|
16446
|
+
*/
|
|
16465
16447
|
toAdd(v1, v2) {
|
|
16466
16448
|
return new _Vector(v1.x + v2.x, v1.y + v2.y, v1.x + v2.y);
|
|
16467
16449
|
}
|
|
16468
16450
|
// public static add(v1: Vector, v2: Vector): Vector {
|
|
16469
16451
|
// return new Vector(v1.x + v2.x, v1.y + v2.y, v1.x + v2.y);
|
|
16470
16452
|
// }
|
|
16453
|
+
/**
|
|
16454
|
+
* 뺄셈 (파괴적). a - b는 "a에서 b를 되돌리는" 벡터.
|
|
16455
|
+
* - 수식: a - b = (ax-bx, ay-by, az-bz)
|
|
16456
|
+
* @example
|
|
16457
|
+
* const a = new Vector(4, 2); a.sub(new Vector(1, 1)); // a = (3, 1)
|
|
16458
|
+
*/
|
|
16471
16459
|
sub(v, y = 0, z = 0) {
|
|
16472
16460
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16473
16461
|
this.x -= v.x;
|
|
@@ -16479,6 +16467,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16479
16467
|
this.z -= z;
|
|
16480
16468
|
}
|
|
16481
16469
|
}
|
|
16470
|
+
/**
|
|
16471
|
+
* 뺄셈 결과의 새 벡터 반환 (비파괴).
|
|
16472
|
+
* - 수식: a - b = (ax-bx, ay-by, az-bz)
|
|
16473
|
+
* @example
|
|
16474
|
+
* const d = a.toSub(b); // d = a-b, a·b는 그대로
|
|
16475
|
+
*/
|
|
16482
16476
|
toSub(v2) {
|
|
16483
16477
|
const v1 = this;
|
|
16484
16478
|
return new _Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
|
|
@@ -16487,6 +16481,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16487
16481
|
// public static sub(v1: Vector, v2: Vector): Vector {
|
|
16488
16482
|
// return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
|
|
16489
16483
|
// }
|
|
16484
|
+
/**
|
|
16485
|
+
* 스칼라배 또는 성분별 곱 (파괴적). 스칼라 k>1이면 늘어나고, 0<k<1이면 줄어듦. k<0이면 반대 방향.
|
|
16486
|
+
* - 수식(스칼라): k·v = (k·x, k·y, k·z)
|
|
16487
|
+
* @example
|
|
16488
|
+
* const v = new Vector(1, 2); v.mult(3); // v = (3, 6)
|
|
16489
|
+
*/
|
|
16490
16490
|
mult(v) {
|
|
16491
16491
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16492
16492
|
this.x *= v.x;
|
|
@@ -16499,6 +16499,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16499
16499
|
}
|
|
16500
16500
|
return this;
|
|
16501
16501
|
}
|
|
16502
|
+
/**
|
|
16503
|
+
* 성분별 곱 결과의 새 벡터 반환 (비파괴).
|
|
16504
|
+
* - 수식: (ax·bx, ay·by, az·bz)
|
|
16505
|
+
* @example
|
|
16506
|
+
* const m = a.toMult(b); // m = 성분별 곱, a·b는 그대로
|
|
16507
|
+
*/
|
|
16502
16508
|
toMult(v2) {
|
|
16503
16509
|
const v1 = this;
|
|
16504
16510
|
return new _Vector(v1.x *= v2.x, v1.y *= v2.y, v1.z *= v2.z);
|
|
@@ -16506,6 +16512,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16506
16512
|
// public static mult(v1: Vector, v2: Vector) {
|
|
16507
16513
|
// return new Vector(v1.x *= v2.x, v1.y *= v2.y, v1.z *= v2.z);
|
|
16508
16514
|
// }
|
|
16515
|
+
/**
|
|
16516
|
+
* 스칼라 나눗셈 또는 성분별 나눗셈 (파괴적). 정규화의 핵심 연산.
|
|
16517
|
+
* - 수식(스칼라): v/k = (x/k, y/k, z/k)
|
|
16518
|
+
* @example
|
|
16519
|
+
* const v = new Vector(6, 8); v.div(2); // v = (3, 4)
|
|
16520
|
+
*/
|
|
16509
16521
|
div(v) {
|
|
16510
16522
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16511
16523
|
this.x /= v.x;
|
|
@@ -16518,6 +16530,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16518
16530
|
}
|
|
16519
16531
|
return this;
|
|
16520
16532
|
}
|
|
16533
|
+
/**
|
|
16534
|
+
* 스칼라 나눗셈 결과의 새 벡터 반환 (비파괴).
|
|
16535
|
+
* - 수식: v/k = (x/k, y/k, z/k)
|
|
16536
|
+
* @example
|
|
16537
|
+
* const h = v.toDiv(2); // h = v/2, v는 그대로
|
|
16538
|
+
*/
|
|
16521
16539
|
toDiv(d) {
|
|
16522
16540
|
const v = this;
|
|
16523
16541
|
const rv = v.get();
|
|
@@ -16533,10 +16551,22 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16533
16551
|
// rv.z /= d;
|
|
16534
16552
|
// return rv;
|
|
16535
16553
|
// }
|
|
16554
|
+
/**
|
|
16555
|
+
* 두 점(벡터) 사이 거리. 차 벡터의 크기.
|
|
16556
|
+
* - 수식: d = √((dx)² + (dy)² + (dz)²)
|
|
16557
|
+
* @example
|
|
16558
|
+
* new Vector(0, 0).dist(new Vector(3, 4)); // 5
|
|
16559
|
+
*/
|
|
16536
16560
|
dist(v) {
|
|
16537
16561
|
const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
|
|
16538
16562
|
return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
16539
16563
|
}
|
|
16564
|
+
/**
|
|
16565
|
+
* 두 점(벡터) 사이 거리 (toDist는 dist와 동일, 비파괴).
|
|
16566
|
+
* - 수식: d = √((dx)² + (dy)² + (dz)²)
|
|
16567
|
+
* @example
|
|
16568
|
+
* a.toDist(b); // a와 b 사이 거리
|
|
16569
|
+
*/
|
|
16540
16570
|
toDist(v2) {
|
|
16541
16571
|
const v1 = this;
|
|
16542
16572
|
const dx = v1.x - v2.x, dy = v1.y - v2.y, dz = v1.z - v2.z;
|
|
@@ -16548,36 +16578,90 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16548
16578
|
// dz = v1.z - v2.z;
|
|
16549
16579
|
// return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
16550
16580
|
// }
|
|
16551
|
-
|
|
16581
|
+
/**
|
|
16582
|
+
* 내적(dot product). 두 벡터가 같은 방향을 향하는 정도.
|
|
16583
|
+
* - 수식: a·b = ax·bx + ay·by + az·bz = |a||b|cosθ
|
|
16584
|
+
* - θ=90°면 0(직교), 0°면 최대(같은 방향).
|
|
16585
|
+
* - 벡터 전달 시 y·z 생략 가능, 스칼라(x) 전달 시 y·z와 함께 사용.
|
|
16586
|
+
* @example
|
|
16587
|
+
* new Vector(5, 12).dot(new Vector(-5, 12)); // -25+144 = 119
|
|
16588
|
+
* new Vector(1, 0).dot(new Vector(0, 1)); // 0 (직각)
|
|
16589
|
+
* new Vector(1, 2).dot(3, 4); // 1*3+2*4 = 11
|
|
16590
|
+
*/
|
|
16591
|
+
dot(v, y = 0, z = 0) {
|
|
16552
16592
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
16553
16593
|
return this.x * v.x + this.y * v.y + this.z * v.z;
|
|
16554
16594
|
}
|
|
16555
16595
|
;
|
|
16556
16596
|
return this.x * v + this.y * y + this.z * z;
|
|
16557
16597
|
}
|
|
16598
|
+
/**
|
|
16599
|
+
* 외적(cross product). 두 벡터에 수직인 벡터. 오른손 법칙 방향.
|
|
16600
|
+
* - 수식: a×b = (ay·bz − az·by, az·bx − ax·bz, ax·by − ay·bx)
|
|
16601
|
+
* - 2D에서는 z값 = ax·by − ay·bx (부호 있는 면적, 회전 방향 판정용).
|
|
16602
|
+
* @example
|
|
16603
|
+
* new Vector(1, 0, 0).cross(new Vector(0, 1, 0)); // (0, 0, 1)
|
|
16604
|
+
*/
|
|
16558
16605
|
cross(v) {
|
|
16559
16606
|
const x = this.x, y = this.y, z = this.z;
|
|
16560
16607
|
return new _Vector(y * v.z - v.y * z, z * v.x - v.z * x, x * v.y - v.x * y);
|
|
16561
16608
|
}
|
|
16609
|
+
/**
|
|
16610
|
+
* 정규화 (파괴적). 방향은 그대로, 크기를 1로. 단위벡터 v̂ 생성.
|
|
16611
|
+
* - 수식: v̂ = v / |v|
|
|
16612
|
+
* - 영벡터(|v|=0)는 0으로 나누지 않고 그대로 둠.
|
|
16613
|
+
* @example
|
|
16614
|
+
* const v = new Vector(6, 8); v.normalize(); // v = (0.6, 0.8), |v| = 1
|
|
16615
|
+
*/
|
|
16562
16616
|
normalize() {
|
|
16563
|
-
const m = this.
|
|
16617
|
+
const m = this.norm();
|
|
16564
16618
|
if (m > 0) this.div(m);
|
|
16565
16619
|
}
|
|
16620
|
+
/**
|
|
16621
|
+
* 크기 상한 (파괴적). 속도가 high를 넘으면 방향 유지한 채 high로 자름. 물리 시뮬레이션 최고속도용.
|
|
16622
|
+
* - 수식: |v| > high → v = v̂ · high
|
|
16623
|
+
* @example
|
|
16624
|
+
* const v = new Vector(6, 8); v.limit(5); // |v|=10 → 5, v = (3, 4)
|
|
16625
|
+
*/
|
|
16566
16626
|
limit(high) {
|
|
16567
|
-
if (this.
|
|
16627
|
+
if (this.norm() > high) {
|
|
16568
16628
|
this.normalize();
|
|
16569
16629
|
this.mult(high);
|
|
16570
16630
|
}
|
|
16571
16631
|
}
|
|
16632
|
+
/**
|
|
16633
|
+
* 2D 방향각. +x축 기준 반시계 방향 라디안 (-π ~ π).
|
|
16634
|
+
* - 수식: θ = atan2(y, x)
|
|
16635
|
+
* @example
|
|
16636
|
+
* new Vector(1, 1).heading2D(); // π/4 (45°)
|
|
16637
|
+
* new Vector(-1, 0).heading2D(); // π (180°)
|
|
16638
|
+
*/
|
|
16572
16639
|
heading2D() {
|
|
16573
16640
|
return -Math.atan2(-this.y, this.x);
|
|
16574
16641
|
}
|
|
16642
|
+
/**
|
|
16643
|
+
* 무작위 방향 단위벡터 반환 (새 Vector, 자신은 변경 안 함).
|
|
16644
|
+
* @example
|
|
16645
|
+
* const r = new Vector().random2D(); // |r| = 1, 방향 랜덤
|
|
16646
|
+
*/
|
|
16575
16647
|
random2D() {
|
|
16576
16648
|
return this.fromAngle(Math.random() * (2 * Math.PI));
|
|
16577
16649
|
}
|
|
16650
|
+
/**
|
|
16651
|
+
* 각도→벡터. 각도 θ, 길이 L인 2D 벡터 반환 (새 Vector).
|
|
16652
|
+
* - 수식: (L·cosθ, L·sinθ, 0)
|
|
16653
|
+
* @example
|
|
16654
|
+
* new Vector().fromAngle(Math.PI / 3, 2); // (1, 1.73, 0)
|
|
16655
|
+
*/
|
|
16578
16656
|
fromAngle(angle, length = 1) {
|
|
16579
16657
|
return new _Vector(length * Math.cos(angle), length * Math.sin(angle), 0);
|
|
16580
16658
|
}
|
|
16659
|
+
/**
|
|
16660
|
+
* 구면좌표→3D 벡터 (새 Vector 반환, p5.js 컨벤션).
|
|
16661
|
+
* - 수식: (L·sinθ·sinφ, −L·cosθ, L·sinθ·cosφ)
|
|
16662
|
+
* @example
|
|
16663
|
+
* new Vector().fromAngles(Math.PI / 2, Math.PI / 2, 1); // (1, 0, 0)
|
|
16664
|
+
*/
|
|
16581
16665
|
fromAngles(theta, phi, length = 1) {
|
|
16582
16666
|
const cosPhi = Math.cos(phi);
|
|
16583
16667
|
const sinPhi = Math.sin(phi);
|
|
@@ -16589,18 +16673,43 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
16589
16673
|
length * sinTheta * cosPhi
|
|
16590
16674
|
);
|
|
16591
16675
|
}
|
|
16676
|
+
/**
|
|
16677
|
+
* 성분 배열 반환. [x, y, z] 순서.
|
|
16678
|
+
* @example
|
|
16679
|
+
* new Vector(1, 2, 3).array(); // [1, 2, 3]
|
|
16680
|
+
*/
|
|
16592
16681
|
array() {
|
|
16593
16682
|
return [this.x, this.y, this.z];
|
|
16594
16683
|
}
|
|
16684
|
+
/**
|
|
16685
|
+
* Point3D로 변환 (위치 의미로 바꿀 때).
|
|
16686
|
+
* @example
|
|
16687
|
+
* new Vector(1, 2, 3).toPoint3D(); // Point3D(1, 2, 3)
|
|
16688
|
+
*/
|
|
16595
16689
|
toPoint3D() {
|
|
16596
16690
|
return new Point3D(this.x, this.y, this.z);
|
|
16597
16691
|
}
|
|
16692
|
+
/**
|
|
16693
|
+
* Point2D로 변환 (z 버림).
|
|
16694
|
+
* @example
|
|
16695
|
+
* new Vector(1, 2, 3).toPoint2D(); // Point2D(1, 2)
|
|
16696
|
+
*/
|
|
16598
16697
|
toPoint2D() {
|
|
16599
16698
|
return new Point2D(this.x, this.y);
|
|
16600
16699
|
}
|
|
16700
|
+
/**
|
|
16701
|
+
* 복사본 반환 (get()과 동일, 비파괴).
|
|
16702
|
+
* @example
|
|
16703
|
+
* const c = v.copy(); // v와 같은 성분의 새 벡터
|
|
16704
|
+
*/
|
|
16601
16705
|
copy() {
|
|
16602
16706
|
return new _Vector(this.x, this.y, this.z);
|
|
16603
16707
|
}
|
|
16708
|
+
/**
|
|
16709
|
+
* 문자열 표현. "[x, y, z]" 형식.
|
|
16710
|
+
* @example
|
|
16711
|
+
* new Vector(1, 2).toString(); // "[1, 2, 0]"
|
|
16712
|
+
*/
|
|
16604
16713
|
toString() {
|
|
16605
16714
|
return "[" + this.x + ", " + this.y + ", " + this.z + "]";
|
|
16606
16715
|
}
|
|
@@ -21446,7 +21555,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
21446
21555
|
|
|
21447
21556
|
// ../core/dist/esm/url/UrlUtils.js
|
|
21448
21557
|
var UrlUtils;
|
|
21449
|
-
((UrlUtils2)
|
|
21558
|
+
(function(UrlUtils2) {
|
|
21450
21559
|
UrlUtils2.origin = (fullurl) => {
|
|
21451
21560
|
return new URL(fullurl).origin;
|
|
21452
21561
|
};
|
|
@@ -21484,15 +21593,28 @@ var dooboostoreSimpleBootHttpServer = (() => {
|
|
|
21484
21593
|
});
|
|
21485
21594
|
return searchParams;
|
|
21486
21595
|
};
|
|
21596
|
+
UrlUtils2.toAbsoluteUrl = (relative2, base) => {
|
|
21597
|
+
return new URL(relative2, base);
|
|
21598
|
+
};
|
|
21599
|
+
function toAbsoluteRequest(input, base) {
|
|
21600
|
+
if (input instanceof URL) {
|
|
21601
|
+
return UrlUtils2.toAbsoluteUrl(input.href, base);
|
|
21602
|
+
}
|
|
21603
|
+
if (typeof input === "string") {
|
|
21604
|
+
return UrlUtils2.toAbsoluteUrl(input, base).href;
|
|
21605
|
+
}
|
|
21606
|
+
return new Request(UrlUtils2.toAbsoluteUrl(input.url, base).href, input);
|
|
21607
|
+
}
|
|
21608
|
+
UrlUtils2.toAbsoluteRequest = toAbsoluteRequest;
|
|
21487
21609
|
UrlUtils2.manipulateSearchParams = (searchParams, options) => {
|
|
21488
21610
|
if (options?.delete) {
|
|
21489
|
-
|
|
21611
|
+
UrlUtils2.deleteSearchParam(searchParams, options.delete);
|
|
21490
21612
|
}
|
|
21491
21613
|
if (options?.append) {
|
|
21492
|
-
|
|
21614
|
+
UrlUtils2.appendSearchParam(searchParams, options.append);
|
|
21493
21615
|
}
|
|
21494
21616
|
if (options?.upsert) {
|
|
21495
|
-
|
|
21617
|
+
UrlUtils2.upsertSearchParam(searchParams, options.upsert);
|
|
21496
21618
|
}
|
|
21497
21619
|
return searchParams;
|
|
21498
21620
|
};
|
|
@@ -23886,6 +24008,23 @@ ${indentStr}}`;
|
|
|
23886
24008
|
};
|
|
23887
24009
|
}
|
|
23888
24010
|
|
|
24011
|
+
// ../core/dist/esm/hash/HashUtils.js
|
|
24012
|
+
var HashUtils;
|
|
24013
|
+
((HashUtils2) => {
|
|
24014
|
+
const core53 = (str, seed) => {
|
|
24015
|
+
let h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;
|
|
24016
|
+
for (let i = 0; i < str.length; i++) {
|
|
24017
|
+
const ch = str.charCodeAt(i);
|
|
24018
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
24019
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
24020
|
+
}
|
|
24021
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
24022
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
24023
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16).padStart(14, "0");
|
|
24024
|
+
};
|
|
24025
|
+
HashUtils2.hash53 = (str, seed = 0, xyz = 16) => `${core53(str, seed)}${core53(str, seed + 1)}`.slice(0, Math.max(1, xyz));
|
|
24026
|
+
})(HashUtils || (HashUtils = {}));
|
|
24027
|
+
|
|
23889
24028
|
// ../core/dist/esm/index.js
|
|
23890
24029
|
var src_default = {
|
|
23891
24030
|
// Core utilities are exported as named exports above
|
|
@@ -24003,7 +24142,7 @@ ${indentStr}}`;
|
|
|
24003
24142
|
return getUrlMapping(target, propertyKey);
|
|
24004
24143
|
};
|
|
24005
24144
|
var getPATCHS = (target) => {
|
|
24006
|
-
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === "
|
|
24145
|
+
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === "PATCH" /* PATCH */);
|
|
24007
24146
|
};
|
|
24008
24147
|
function OPTIONS(configOrTarget, propertyKey, descriptor) {
|
|
24009
24148
|
if (propertyKey && descriptor) {
|
|
@@ -24035,7 +24174,7 @@ ${indentStr}}`;
|
|
|
24035
24174
|
return getUrlMapping(target, propertyKey);
|
|
24036
24175
|
};
|
|
24037
24176
|
var getHEADS = (target) => {
|
|
24038
|
-
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === "
|
|
24177
|
+
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === "HEAD" /* HEAD */);
|
|
24039
24178
|
};
|
|
24040
24179
|
function TRACE(configOrTarget, propertyKey, descriptor) {
|
|
24041
24180
|
if (propertyKey && descriptor) {
|
|
@@ -27759,7 +27898,6 @@ ${indentStr}}`;
|
|
|
27759
27898
|
return it.test(url);
|
|
27760
27899
|
}
|
|
27761
27900
|
if (typeof it === "string") {
|
|
27762
|
-
console.log("url!!!!!!!", url);
|
|
27763
27901
|
return it === url;
|
|
27764
27902
|
}
|
|
27765
27903
|
if (typeof it === "function") {
|
|
@@ -28953,7 +29091,7 @@ ${indentStr}}`;
|
|
|
28953
29091
|
var import_http = __require("http");
|
|
28954
29092
|
var import_https = __require("https");
|
|
28955
29093
|
|
|
28956
|
-
//
|
|
29094
|
+
// ../../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/wrapper.mjs
|
|
28957
29095
|
var import_stream = __toESM(require_stream(), 1);
|
|
28958
29096
|
var import_extension = __toESM(require_extension(), 1);
|
|
28959
29097
|
var import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
|
|
@@ -29209,23 +29347,27 @@ ${indentStr}}`;
|
|
|
29209
29347
|
target: moduleInstance,
|
|
29210
29348
|
targetKey: it.propertyKey
|
|
29211
29349
|
}, otherStorage);
|
|
29212
|
-
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29216
|
-
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
|
|
29223
|
-
|
|
29224
|
-
|
|
29350
|
+
const resConfig = it.config?.res;
|
|
29351
|
+
if (resConfig?.manual === true) {
|
|
29352
|
+
} else {
|
|
29353
|
+
if (it.config?.resolver) {
|
|
29354
|
+
const execute = typeof it.config.resolver === "function" ? this.simstanceManager.getOrNewSim({ target: it.config.resolver }) : it.config.resolver;
|
|
29355
|
+
data = await execute?.resolve?.(data, rr);
|
|
29356
|
+
}
|
|
29357
|
+
const status = resConfig?.status ?? 200 /* Ok */;
|
|
29358
|
+
const headers = resConfig?.header ?? {};
|
|
29359
|
+
if (resConfig?.contentType) {
|
|
29360
|
+
headers[HttpHeaders.ContentType] = resConfig.contentType;
|
|
29361
|
+
}
|
|
29362
|
+
if ((resConfig?.contentType?.toLowerCase().indexOf("application/json" /* ApplicationJson */.toLowerCase()) ?? -1) > -1) {
|
|
29363
|
+
data = JSON.stringify(data);
|
|
29364
|
+
} else if (data && typeof data === "object") {
|
|
29365
|
+
data = JSON.stringify(data);
|
|
29366
|
+
}
|
|
29367
|
+
rr.resSetHeaders(headers);
|
|
29368
|
+
rr.resSetStatusCode(status);
|
|
29369
|
+
rr.resWrite(data);
|
|
29225
29370
|
}
|
|
29226
|
-
rr.resSetHeaders(headers);
|
|
29227
|
-
rr.resSetStatusCode(status);
|
|
29228
|
-
rr.resWrite(data);
|
|
29229
29371
|
}
|
|
29230
29372
|
}
|
|
29231
29373
|
if (this.option.noSuchRouteEndPointMappingThrow && methods.length <= 0 && rr.reqMethod()?.toUpperCase() !== "OPTIONS" /* OPTIONS */) {
|