@rg-dev/stdlib 1.0.42 → 1.0.43
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/lib/browser-env.cjs +3 -2
- package/lib/browser-env.js +3 -2
- package/lib/common-env.cjs +18 -3
- package/lib/common-env.js +21 -3
- package/lib/index.d.cts +4 -2
- package/lib/index.d.ts +4 -2
- package/lib/node-download.cjs +258 -130
- package/lib/node-download.js +258 -130
- package/lib/node-env.cjs +25 -11
- package/lib/node-env.js +25 -11
- package/package.json +2 -2
- package/lib/index.cjs +0 -0
- package/lib/index.js +0 -0
package/lib/node-env.cjs
CHANGED
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __commonJS = (cb, mod) => function __require() {
|
|
8
22
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
23
|
};
|
|
@@ -28,6 +42,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
42
|
mod
|
|
29
43
|
));
|
|
30
44
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
46
|
|
|
32
47
|
// node_modules/command-exists/lib/command-exists.js
|
|
33
48
|
var require_command_exists = __commonJS({
|
|
@@ -207,9 +222,9 @@ var import_command_exists = __toESM(require_command_exists2(), 1);
|
|
|
207
222
|
|
|
208
223
|
// src/SSEResponse.ts
|
|
209
224
|
var SSEResponse = class {
|
|
210
|
-
res;
|
|
211
|
-
isOpen = true;
|
|
212
225
|
constructor(resObject) {
|
|
226
|
+
__publicField(this, "res");
|
|
227
|
+
__publicField(this, "isOpen", true);
|
|
213
228
|
this.res = resObject;
|
|
214
229
|
resObject.setHeader("Content-Type", "text/event-stream");
|
|
215
230
|
resObject.setHeader("Cache-Control", "no-cache");
|
|
@@ -255,19 +270,18 @@ var SSEResponse = class {
|
|
|
255
270
|
// src/SSEClient.ts
|
|
256
271
|
var import_events = require("events");
|
|
257
272
|
var SSEClient = class extends import_events.EventEmitter {
|
|
258
|
-
url;
|
|
259
|
-
payload;
|
|
260
|
-
headers;
|
|
261
|
-
controller;
|
|
262
273
|
constructor(options) {
|
|
263
274
|
super();
|
|
275
|
+
__publicField(this, "url");
|
|
276
|
+
__publicField(this, "payload");
|
|
277
|
+
__publicField(this, "headers");
|
|
278
|
+
__publicField(this, "controller");
|
|
264
279
|
this.url = options.url;
|
|
265
280
|
this.payload = options.payload || {};
|
|
266
|
-
this.headers = {
|
|
281
|
+
this.headers = __spreadValues({
|
|
267
282
|
"Content-Type": "application/json",
|
|
268
|
-
Accept: "*/*"
|
|
269
|
-
|
|
270
|
-
};
|
|
283
|
+
Accept: "*/*"
|
|
284
|
+
}, options.headers);
|
|
271
285
|
this.controller = new AbortController();
|
|
272
286
|
}
|
|
273
287
|
async connect() {
|
|
@@ -304,7 +318,7 @@ var SSEClient = class extends import_events.EventEmitter {
|
|
|
304
318
|
let data = line.slice(5).trim();
|
|
305
319
|
try {
|
|
306
320
|
data = JSON.parse(data);
|
|
307
|
-
} catch {
|
|
321
|
+
} catch (e) {
|
|
308
322
|
}
|
|
309
323
|
this.emit(eventName, data);
|
|
310
324
|
eventName = "message";
|
package/lib/node-env.js
CHANGED
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
22
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
23
|
}) : x)(function(x) {
|
|
@@ -29,6 +43,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
43
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
44
|
mod
|
|
31
45
|
));
|
|
46
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
32
47
|
|
|
33
48
|
// node_modules/command-exists/lib/command-exists.js
|
|
34
49
|
var require_command_exists = __commonJS({
|
|
@@ -193,9 +208,9 @@ import path from "path";
|
|
|
193
208
|
|
|
194
209
|
// src/SSEResponse.ts
|
|
195
210
|
var SSEResponse = class {
|
|
196
|
-
res;
|
|
197
|
-
isOpen = true;
|
|
198
211
|
constructor(resObject) {
|
|
212
|
+
__publicField(this, "res");
|
|
213
|
+
__publicField(this, "isOpen", true);
|
|
199
214
|
this.res = resObject;
|
|
200
215
|
resObject.setHeader("Content-Type", "text/event-stream");
|
|
201
216
|
resObject.setHeader("Cache-Control", "no-cache");
|
|
@@ -241,19 +256,18 @@ var SSEResponse = class {
|
|
|
241
256
|
// src/SSEClient.ts
|
|
242
257
|
import { EventEmitter } from "events";
|
|
243
258
|
var SSEClient = class extends EventEmitter {
|
|
244
|
-
url;
|
|
245
|
-
payload;
|
|
246
|
-
headers;
|
|
247
|
-
controller;
|
|
248
259
|
constructor(options) {
|
|
249
260
|
super();
|
|
261
|
+
__publicField(this, "url");
|
|
262
|
+
__publicField(this, "payload");
|
|
263
|
+
__publicField(this, "headers");
|
|
264
|
+
__publicField(this, "controller");
|
|
250
265
|
this.url = options.url;
|
|
251
266
|
this.payload = options.payload || {};
|
|
252
|
-
this.headers = {
|
|
267
|
+
this.headers = __spreadValues({
|
|
253
268
|
"Content-Type": "application/json",
|
|
254
|
-
Accept: "*/*"
|
|
255
|
-
|
|
256
|
-
};
|
|
269
|
+
Accept: "*/*"
|
|
270
|
+
}, options.headers);
|
|
257
271
|
this.controller = new AbortController();
|
|
258
272
|
}
|
|
259
273
|
async connect() {
|
|
@@ -290,7 +304,7 @@ var SSEClient = class extends EventEmitter {
|
|
|
290
304
|
let data = line.slice(5).trim();
|
|
291
305
|
try {
|
|
292
306
|
data = JSON.parse(data);
|
|
293
|
-
} catch {
|
|
307
|
+
} catch (e) {
|
|
294
308
|
}
|
|
295
309
|
this.emit(eventName, data);
|
|
296
310
|
eventName = "message";
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rg-dev/stdlib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"build": "tsup"
|
|
7
|
+
"build": "tsup && node after-build.mjs"
|
|
8
8
|
},
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
package/lib/index.cjs
DELETED
|
File without changes
|
package/lib/index.js
DELETED
|
File without changes
|