@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/browser-env.cjs
CHANGED
|
@@ -48,7 +48,8 @@ async function copyToClipboard(content, opts = { throwOnError: false }) {
|
|
|
48
48
|
Object.fromEntries(
|
|
49
49
|
content.map(
|
|
50
50
|
(c) => {
|
|
51
|
-
|
|
51
|
+
var _a;
|
|
52
|
+
return [(_a = c == null ? void 0 : c.type) != null ? _a : "text/plain", c];
|
|
52
53
|
}
|
|
53
54
|
)
|
|
54
55
|
)
|
|
@@ -62,7 +63,7 @@ async function copyToClipboard(content, opts = { throwOnError: false }) {
|
|
|
62
63
|
try {
|
|
63
64
|
await navigator.clipboard.writeText(String(content));
|
|
64
65
|
return true;
|
|
65
|
-
} catch {
|
|
66
|
+
} catch (e) {
|
|
66
67
|
return fallback(content);
|
|
67
68
|
}
|
|
68
69
|
}
|
package/lib/browser-env.js
CHANGED
|
@@ -24,7 +24,8 @@ async function copyToClipboard(content, opts = { throwOnError: false }) {
|
|
|
24
24
|
Object.fromEntries(
|
|
25
25
|
content.map(
|
|
26
26
|
(c) => {
|
|
27
|
-
|
|
27
|
+
var _a;
|
|
28
|
+
return [(_a = c == null ? void 0 : c.type) != null ? _a : "text/plain", c];
|
|
28
29
|
}
|
|
29
30
|
)
|
|
30
31
|
)
|
|
@@ -38,7 +39,7 @@ async function copyToClipboard(content, opts = { throwOnError: false }) {
|
|
|
38
39
|
try {
|
|
39
40
|
await navigator.clipboard.writeText(String(content));
|
|
40
41
|
return true;
|
|
41
|
-
} catch {
|
|
42
|
+
} catch (e) {
|
|
42
43
|
return fallback(content);
|
|
43
44
|
}
|
|
44
45
|
}
|
package/lib/common-env.cjs
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
5
19
|
var __export = (target, all) => {
|
|
6
20
|
for (var name in all)
|
|
7
21
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,6 +29,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
29
|
return to;
|
|
16
30
|
};
|
|
17
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18
33
|
|
|
19
34
|
// src/common-env.ts
|
|
20
35
|
var common_env_exports = {};
|
|
@@ -44,7 +59,7 @@ var defaultOptions = {
|
|
|
44
59
|
}
|
|
45
60
|
};
|
|
46
61
|
function promiseRetry(func, options = defaultOptions, attempt = 1) {
|
|
47
|
-
const config = {
|
|
62
|
+
const config = __spreadValues(__spreadValues({}, defaultOptions), options);
|
|
48
63
|
return func(attempt).catch(
|
|
49
64
|
(err) => {
|
|
50
65
|
config.onError(err, attempt);
|
|
@@ -66,8 +81,8 @@ function promiseRetry(func, options = defaultOptions, attempt = 1) {
|
|
|
66
81
|
|
|
67
82
|
// src/StringBuilder.ts
|
|
68
83
|
var StringBuilder = class {
|
|
69
|
-
_chunks;
|
|
70
84
|
constructor() {
|
|
85
|
+
__publicField(this, "_chunks");
|
|
71
86
|
this._chunks = [];
|
|
72
87
|
}
|
|
73
88
|
/** {@inheritDoc IStringBuilder.append} */
|
|
@@ -132,8 +147,8 @@ function throwIfNotJSONResponse(res) {
|
|
|
132
147
|
|
|
133
148
|
// src/common-env.ts
|
|
134
149
|
var Optional = class _Optional {
|
|
135
|
-
value;
|
|
136
150
|
constructor(value) {
|
|
151
|
+
__publicField(this, "value");
|
|
137
152
|
this.value = value;
|
|
138
153
|
}
|
|
139
154
|
static of(val) {
|
package/lib/common-env.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18
|
+
|
|
1
19
|
// src/promise-retry.ts
|
|
2
20
|
var defaultOptions = {
|
|
3
21
|
maxAttempts: 10,
|
|
@@ -6,7 +24,7 @@ var defaultOptions = {
|
|
|
6
24
|
}
|
|
7
25
|
};
|
|
8
26
|
function promiseRetry(func, options = defaultOptions, attempt = 1) {
|
|
9
|
-
const config = {
|
|
27
|
+
const config = __spreadValues(__spreadValues({}, defaultOptions), options);
|
|
10
28
|
return func(attempt).catch(
|
|
11
29
|
(err) => {
|
|
12
30
|
config.onError(err, attempt);
|
|
@@ -28,8 +46,8 @@ function promiseRetry(func, options = defaultOptions, attempt = 1) {
|
|
|
28
46
|
|
|
29
47
|
// src/StringBuilder.ts
|
|
30
48
|
var StringBuilder = class {
|
|
31
|
-
_chunks;
|
|
32
49
|
constructor() {
|
|
50
|
+
__publicField(this, "_chunks");
|
|
33
51
|
this._chunks = [];
|
|
34
52
|
}
|
|
35
53
|
/** {@inheritDoc IStringBuilder.append} */
|
|
@@ -94,8 +112,8 @@ function throwIfNotJSONResponse(res) {
|
|
|
94
112
|
|
|
95
113
|
// src/common-env.ts
|
|
96
114
|
var Optional = class _Optional {
|
|
97
|
-
value;
|
|
98
115
|
constructor(value) {
|
|
116
|
+
__publicField(this, "value");
|
|
99
117
|
this.value = value;
|
|
100
118
|
}
|
|
101
119
|
static of(val) {
|
package/lib/index.d.cts
CHANGED
package/lib/index.d.ts
CHANGED