@gardenfi/core 0.2.0-beta.70 → 0.2.0-beta.72
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/dist/index.cjs +1 -31
- package/dist/index.js +26 -7808
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +87 -0
- package/dist/index11.cjs +20 -0
- package/dist/index11.js +380 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +22 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +396 -0
- package/dist/index14.cjs +1 -0
- package/dist/index14.js +23 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +4 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +140 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +4 -0
- package/dist/index18.cjs +3 -0
- package/dist/index18.js +30 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +17 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +412 -0
- package/dist/index20.cjs +2 -0
- package/dist/index20.js +27 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +43 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +201 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +4 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +4 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +4 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +30 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +17 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +177 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +24 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +5 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +4 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +37 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +11 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +4 -0
- package/dist/index34.cjs +6 -0
- package/dist/index34.js +949 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +4 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +22 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +34 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +64 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +35 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +18 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +89 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +51 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +28 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +4 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +4 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +22 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +37 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +369 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +23 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +58 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +110 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +5 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +75 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +4 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +60 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +4 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +42 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +45 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +20 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +111 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +23 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +5 -0
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +228 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +6 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +160 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +4 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +15 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +4 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +35 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +4 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +358 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +241 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +76 -0
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +70 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +64 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +14 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +47 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +65 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +228 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +5 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +171 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +30 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +23 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +62 -0
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +72 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +130 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +9 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +4 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +28 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +4 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +63 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/utils.d.ts +1 -3
- package/package.json +2 -2
package/dist/index75.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { __module as p } from "./index85.js";
|
|
2
|
+
var a = typeof Reflect == "object" ? Reflect : null, h = a && typeof a.apply == "function" ? a.apply : function(e, n, r) {
|
|
3
|
+
return Function.prototype.apply.call(e, n, r);
|
|
4
|
+
}, l;
|
|
5
|
+
a && typeof a.ownKeys == "function" ? l = a.ownKeys : Object.getOwnPropertySymbols ? l = function(e) {
|
|
6
|
+
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
7
|
+
} : l = function(e) {
|
|
8
|
+
return Object.getOwnPropertyNames(e);
|
|
9
|
+
};
|
|
10
|
+
function C(t) {
|
|
11
|
+
console && console.warn && console.warn(t);
|
|
12
|
+
}
|
|
13
|
+
var L = Number.isNaN || function(e) {
|
|
14
|
+
return e !== e;
|
|
15
|
+
};
|
|
16
|
+
function o() {
|
|
17
|
+
o.init.call(this);
|
|
18
|
+
}
|
|
19
|
+
p.exports = o;
|
|
20
|
+
p.exports.once = M;
|
|
21
|
+
o.EventEmitter = o;
|
|
22
|
+
o.prototype._events = void 0;
|
|
23
|
+
o.prototype._eventsCount = 0;
|
|
24
|
+
o.prototype._maxListeners = void 0;
|
|
25
|
+
var m = 10;
|
|
26
|
+
function v(t) {
|
|
27
|
+
if (typeof t != "function")
|
|
28
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(o, "defaultMaxListeners", {
|
|
31
|
+
enumerable: !0,
|
|
32
|
+
get: function() {
|
|
33
|
+
return m;
|
|
34
|
+
},
|
|
35
|
+
set: function(t) {
|
|
36
|
+
if (typeof t != "number" || t < 0 || L(t))
|
|
37
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
38
|
+
m = t;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
o.init = function() {
|
|
42
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
43
|
+
};
|
|
44
|
+
o.prototype.setMaxListeners = function(e) {
|
|
45
|
+
if (typeof e != "number" || e < 0 || L(e))
|
|
46
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
47
|
+
return this._maxListeners = e, this;
|
|
48
|
+
};
|
|
49
|
+
function y(t) {
|
|
50
|
+
return t._maxListeners === void 0 ? o.defaultMaxListeners : t._maxListeners;
|
|
51
|
+
}
|
|
52
|
+
o.prototype.getMaxListeners = function() {
|
|
53
|
+
return y(this);
|
|
54
|
+
};
|
|
55
|
+
o.prototype.emit = function(e) {
|
|
56
|
+
for (var n = [], r = 1; r < arguments.length; r++) n.push(arguments[r]);
|
|
57
|
+
var i = e === "error", f = this._events;
|
|
58
|
+
if (f !== void 0)
|
|
59
|
+
i = i && f.error === void 0;
|
|
60
|
+
else if (!i)
|
|
61
|
+
return !1;
|
|
62
|
+
if (i) {
|
|
63
|
+
var s;
|
|
64
|
+
if (n.length > 0 && (s = n[0]), s instanceof Error)
|
|
65
|
+
throw s;
|
|
66
|
+
var u = new Error("Unhandled error." + (s ? " (" + s.message + ")" : ""));
|
|
67
|
+
throw u.context = s, u;
|
|
68
|
+
}
|
|
69
|
+
var c = f[e];
|
|
70
|
+
if (c === void 0)
|
|
71
|
+
return !1;
|
|
72
|
+
if (typeof c == "function")
|
|
73
|
+
h(c, this, n);
|
|
74
|
+
else
|
|
75
|
+
for (var d = c.length, x = E(c, d), r = 0; r < d; ++r)
|
|
76
|
+
h(x[r], this, n);
|
|
77
|
+
return !0;
|
|
78
|
+
};
|
|
79
|
+
function g(t, e, n, r) {
|
|
80
|
+
var i, f, s;
|
|
81
|
+
if (v(n), f = t._events, f === void 0 ? (f = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (f.newListener !== void 0 && (t.emit(
|
|
82
|
+
"newListener",
|
|
83
|
+
e,
|
|
84
|
+
n.listener ? n.listener : n
|
|
85
|
+
), f = t._events), s = f[e]), s === void 0)
|
|
86
|
+
s = f[e] = n, ++t._eventsCount;
|
|
87
|
+
else if (typeof s == "function" ? s = f[e] = r ? [n, s] : [s, n] : r ? s.unshift(n) : s.push(n), i = y(t), i > 0 && s.length > i && !s.warned) {
|
|
88
|
+
s.warned = !0;
|
|
89
|
+
var u = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
90
|
+
u.name = "MaxListenersExceededWarning", u.emitter = t, u.type = e, u.count = s.length, C(u);
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
o.prototype.addListener = function(e, n) {
|
|
95
|
+
return g(this, e, n, !1);
|
|
96
|
+
};
|
|
97
|
+
o.prototype.on = o.prototype.addListener;
|
|
98
|
+
o.prototype.prependListener = function(e, n) {
|
|
99
|
+
return g(this, e, n, !0);
|
|
100
|
+
};
|
|
101
|
+
function j() {
|
|
102
|
+
if (!this.fired)
|
|
103
|
+
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
104
|
+
}
|
|
105
|
+
function _(t, e, n) {
|
|
106
|
+
var r = { fired: !1, wrapFn: void 0, target: t, type: e, listener: n }, i = j.bind(r);
|
|
107
|
+
return i.listener = n, r.wrapFn = i, i;
|
|
108
|
+
}
|
|
109
|
+
o.prototype.once = function(e, n) {
|
|
110
|
+
return v(n), this.on(e, _(this, e, n)), this;
|
|
111
|
+
};
|
|
112
|
+
o.prototype.prependOnceListener = function(e, n) {
|
|
113
|
+
return v(n), this.prependListener(e, _(this, e, n)), this;
|
|
114
|
+
};
|
|
115
|
+
o.prototype.removeListener = function(e, n) {
|
|
116
|
+
var r, i, f, s, u;
|
|
117
|
+
if (v(n), i = this._events, i === void 0)
|
|
118
|
+
return this;
|
|
119
|
+
if (r = i[e], r === void 0)
|
|
120
|
+
return this;
|
|
121
|
+
if (r === n || r.listener === n)
|
|
122
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, r.listener || n));
|
|
123
|
+
else if (typeof r != "function") {
|
|
124
|
+
for (f = -1, s = r.length - 1; s >= 0; s--)
|
|
125
|
+
if (r[s] === n || r[s].listener === n) {
|
|
126
|
+
u = r[s].listener, f = s;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (f < 0)
|
|
130
|
+
return this;
|
|
131
|
+
f === 0 ? r.shift() : R(r, f), r.length === 1 && (i[e] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", e, u || n);
|
|
132
|
+
}
|
|
133
|
+
return this;
|
|
134
|
+
};
|
|
135
|
+
o.prototype.off = o.prototype.removeListener;
|
|
136
|
+
o.prototype.removeAllListeners = function(e) {
|
|
137
|
+
var n, r, i;
|
|
138
|
+
if (r = this._events, r === void 0)
|
|
139
|
+
return this;
|
|
140
|
+
if (r.removeListener === void 0)
|
|
141
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : r[e] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete r[e]), this;
|
|
142
|
+
if (arguments.length === 0) {
|
|
143
|
+
var f = Object.keys(r), s;
|
|
144
|
+
for (i = 0; i < f.length; ++i)
|
|
145
|
+
s = f[i], s !== "removeListener" && this.removeAllListeners(s);
|
|
146
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
147
|
+
}
|
|
148
|
+
if (n = r[e], typeof n == "function")
|
|
149
|
+
this.removeListener(e, n);
|
|
150
|
+
else if (n !== void 0)
|
|
151
|
+
for (i = n.length - 1; i >= 0; i--)
|
|
152
|
+
this.removeListener(e, n[i]);
|
|
153
|
+
return this;
|
|
154
|
+
};
|
|
155
|
+
function w(t, e, n) {
|
|
156
|
+
var r = t._events;
|
|
157
|
+
if (r === void 0)
|
|
158
|
+
return [];
|
|
159
|
+
var i = r[e];
|
|
160
|
+
return i === void 0 ? [] : typeof i == "function" ? n ? [i.listener || i] : [i] : n ? N(i) : E(i, i.length);
|
|
161
|
+
}
|
|
162
|
+
o.prototype.listeners = function(e) {
|
|
163
|
+
return w(this, e, !0);
|
|
164
|
+
};
|
|
165
|
+
o.prototype.rawListeners = function(e) {
|
|
166
|
+
return w(this, e, !1);
|
|
167
|
+
};
|
|
168
|
+
o.listenerCount = function(t, e) {
|
|
169
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : b.call(t, e);
|
|
170
|
+
};
|
|
171
|
+
o.prototype.listenerCount = b;
|
|
172
|
+
function b(t) {
|
|
173
|
+
var e = this._events;
|
|
174
|
+
if (e !== void 0) {
|
|
175
|
+
var n = e[t];
|
|
176
|
+
if (typeof n == "function")
|
|
177
|
+
return 1;
|
|
178
|
+
if (n !== void 0)
|
|
179
|
+
return n.length;
|
|
180
|
+
}
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
o.prototype.eventNames = function() {
|
|
184
|
+
return this._eventsCount > 0 ? l(this._events) : [];
|
|
185
|
+
};
|
|
186
|
+
function E(t, e) {
|
|
187
|
+
for (var n = new Array(e), r = 0; r < e; ++r)
|
|
188
|
+
n[r] = t[r];
|
|
189
|
+
return n;
|
|
190
|
+
}
|
|
191
|
+
function R(t, e) {
|
|
192
|
+
for (; e + 1 < t.length; e++)
|
|
193
|
+
t[e] = t[e + 1];
|
|
194
|
+
t.pop();
|
|
195
|
+
}
|
|
196
|
+
function N(t) {
|
|
197
|
+
for (var e = new Array(t.length), n = 0; n < e.length; ++n)
|
|
198
|
+
e[n] = t[n].listener || t[n];
|
|
199
|
+
return e;
|
|
200
|
+
}
|
|
201
|
+
function M(t, e) {
|
|
202
|
+
return new Promise(function(n, r) {
|
|
203
|
+
function i(s) {
|
|
204
|
+
t.removeListener(e, f), r(s);
|
|
205
|
+
}
|
|
206
|
+
function f() {
|
|
207
|
+
typeof t.removeListener == "function" && t.removeListener("error", i), n([].slice.call(arguments));
|
|
208
|
+
}
|
|
209
|
+
O(t, e, f, { once: !0 }), e !== "error" && A(t, i, { once: !0 });
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function A(t, e, n) {
|
|
213
|
+
typeof t.on == "function" && O(t, "error", e, n);
|
|
214
|
+
}
|
|
215
|
+
function O(t, e, n, r) {
|
|
216
|
+
if (typeof t.on == "function")
|
|
217
|
+
r.once ? t.once(e, n) : t.on(e, n);
|
|
218
|
+
else if (typeof t.addEventListener == "function")
|
|
219
|
+
t.addEventListener(e, function i(f) {
|
|
220
|
+
r.once && t.removeEventListener(e, i), n(f);
|
|
221
|
+
});
|
|
222
|
+
else
|
|
223
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
|
|
224
|
+
}
|
|
225
|
+
var T = p.exports;
|
|
226
|
+
export {
|
|
227
|
+
T as e
|
|
228
|
+
};
|
package/dist/index76.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index75.cjs");var r=e.eventsExports.EventEmitter;exports.streamBrowser=r;
|
package/dist/index76.js
ADDED
package/dist/index77.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index34.cjs");const j=require("./index61.cjs"),x=require("./index35.cjs");var f,v;function k(){if(v)return f;v=1;function c(i,r){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(i);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(i,a).enumerable})),e.push.apply(e,t)}return e}function o(i){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?c(Object(e),!0).forEach(function(t){g(i,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))})}return i}function g(i,r,e){return r=d(r),r in i?Object.defineProperty(i,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[r]=e,i}function y(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}function p(i,r){for(var e=0;e<r.length;e++){var t=r[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(i,d(t.key),t)}}function _(i,r,e){return r&&p(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),i}function d(i){var r=m(i,"string");return typeof r=="symbol"?r:String(r)}function m(i,r){if(typeof i!="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var t=e.call(i,r||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(i)}var O=x.__exports,u=O.Buffer,b=j,s=b.inspect,w=s&&s.custom||"inspect";function P(i,r,e){u.prototype.copy.call(i,r,e)}return f=function(){function i(){y(this,i),this.head=null,this.tail=null,this.length=0}return _(i,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(this.length===0)return"";for(var t=this.head,a=""+t.data;t=t.next;)a+=e+t.data;return a}},{key:"concat",value:function(e){if(this.length===0)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),a=this.head,l=0;a;)P(a.data,t,l),l+=a.data.length,a=a.next;return t}},{key:"consume",value:function(e,t){var a;return e<this.head.data.length?(a=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):e===this.head.data.length?a=this.shift():a=t?this._getString(e):this._getBuffer(e),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,a=1,l=t.data;for(e-=l.length;t=t.next;){var n=t.data,h=e>n.length?n.length:e;if(h===n.length?l+=n:l+=n.slice(0,e),e-=h,e===0){h===n.length?(++a,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(h));break}++a}return this.length-=a,l}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),a=this.head,l=1;for(a.data.copy(t),e-=a.data.length;a=a.next;){var n=a.data,h=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,h),e-=h,e===0){h===n.length?(++l,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=n.slice(h));break}++l}return this.length-=l,t}},{key:w,value:function(e,t){return s(this,o(o({},t),{},{depth:0,customInspect:!1}))}}]),i}(),f}exports.__require=k;
|
package/dist/index77.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import "./index34.js";
|
|
2
|
+
import j from "./index61.js";
|
|
3
|
+
import { __exports as x } from "./index35.js";
|
|
4
|
+
var s, v;
|
|
5
|
+
function q() {
|
|
6
|
+
if (v) return s;
|
|
7
|
+
v = 1;
|
|
8
|
+
function o(i, r) {
|
|
9
|
+
var e = Object.keys(i);
|
|
10
|
+
if (Object.getOwnPropertySymbols) {
|
|
11
|
+
var t = Object.getOwnPropertySymbols(i);
|
|
12
|
+
r && (t = t.filter(function(a) {
|
|
13
|
+
return Object.getOwnPropertyDescriptor(i, a).enumerable;
|
|
14
|
+
})), e.push.apply(e, t);
|
|
15
|
+
}
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
function c(i) {
|
|
19
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
20
|
+
var e = arguments[r] != null ? arguments[r] : {};
|
|
21
|
+
r % 2 ? o(Object(e), !0).forEach(function(t) {
|
|
22
|
+
g(i, t, e[t]);
|
|
23
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(e)) : o(Object(e)).forEach(function(t) {
|
|
24
|
+
Object.defineProperty(i, t, Object.getOwnPropertyDescriptor(e, t));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
function g(i, r, e) {
|
|
30
|
+
return r = d(r), r in i ? Object.defineProperty(i, r, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[r] = e, i;
|
|
31
|
+
}
|
|
32
|
+
function p(i, r) {
|
|
33
|
+
if (!(i instanceof r))
|
|
34
|
+
throw new TypeError("Cannot call a class as a function");
|
|
35
|
+
}
|
|
36
|
+
function y(i, r) {
|
|
37
|
+
for (var e = 0; e < r.length; e++) {
|
|
38
|
+
var t = r[e];
|
|
39
|
+
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(i, d(t.key), t);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function m(i, r, e) {
|
|
43
|
+
return r && y(i.prototype, r), Object.defineProperty(i, "prototype", { writable: !1 }), i;
|
|
44
|
+
}
|
|
45
|
+
function d(i) {
|
|
46
|
+
var r = _(i, "string");
|
|
47
|
+
return typeof r == "symbol" ? r : String(r);
|
|
48
|
+
}
|
|
49
|
+
function _(i, r) {
|
|
50
|
+
if (typeof i != "object" || i === null) return i;
|
|
51
|
+
var e = i[Symbol.toPrimitive];
|
|
52
|
+
if (e !== void 0) {
|
|
53
|
+
var t = e.call(i, r || "default");
|
|
54
|
+
if (typeof t != "object") return t;
|
|
55
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
56
|
+
}
|
|
57
|
+
return (r === "string" ? String : Number)(i);
|
|
58
|
+
}
|
|
59
|
+
var O = x, u = O.Buffer, b = j, f = b.inspect, w = f && f.custom || "inspect";
|
|
60
|
+
function P(i, r, e) {
|
|
61
|
+
u.prototype.copy.call(i, r, e);
|
|
62
|
+
}
|
|
63
|
+
return s = /* @__PURE__ */ function() {
|
|
64
|
+
function i() {
|
|
65
|
+
p(this, i), this.head = null, this.tail = null, this.length = 0;
|
|
66
|
+
}
|
|
67
|
+
return m(i, [{
|
|
68
|
+
key: "push",
|
|
69
|
+
value: function(e) {
|
|
70
|
+
var t = {
|
|
71
|
+
data: e,
|
|
72
|
+
next: null
|
|
73
|
+
};
|
|
74
|
+
this.length > 0 ? this.tail.next = t : this.head = t, this.tail = t, ++this.length;
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "unshift",
|
|
78
|
+
value: function(e) {
|
|
79
|
+
var t = {
|
|
80
|
+
data: e,
|
|
81
|
+
next: this.head
|
|
82
|
+
};
|
|
83
|
+
this.length === 0 && (this.tail = t), this.head = t, ++this.length;
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "shift",
|
|
87
|
+
value: function() {
|
|
88
|
+
if (this.length !== 0) {
|
|
89
|
+
var e = this.head.data;
|
|
90
|
+
return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, e;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "clear",
|
|
95
|
+
value: function() {
|
|
96
|
+
this.head = this.tail = null, this.length = 0;
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "join",
|
|
100
|
+
value: function(e) {
|
|
101
|
+
if (this.length === 0) return "";
|
|
102
|
+
for (var t = this.head, a = "" + t.data; t = t.next; ) a += e + t.data;
|
|
103
|
+
return a;
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "concat",
|
|
107
|
+
value: function(e) {
|
|
108
|
+
if (this.length === 0) return u.alloc(0);
|
|
109
|
+
for (var t = u.allocUnsafe(e >>> 0), a = this.head, l = 0; a; )
|
|
110
|
+
P(a.data, t, l), l += a.data.length, a = a.next;
|
|
111
|
+
return t;
|
|
112
|
+
}
|
|
113
|
+
// Consumes a specified amount of bytes or characters from the buffered data.
|
|
114
|
+
}, {
|
|
115
|
+
key: "consume",
|
|
116
|
+
value: function(e, t) {
|
|
117
|
+
var a;
|
|
118
|
+
return e < this.head.data.length ? (a = this.head.data.slice(0, e), this.head.data = this.head.data.slice(e)) : e === this.head.data.length ? a = this.shift() : a = t ? this._getString(e) : this._getBuffer(e), a;
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
key: "first",
|
|
122
|
+
value: function() {
|
|
123
|
+
return this.head.data;
|
|
124
|
+
}
|
|
125
|
+
// Consumes a specified amount of characters from the buffered data.
|
|
126
|
+
}, {
|
|
127
|
+
key: "_getString",
|
|
128
|
+
value: function(e) {
|
|
129
|
+
var t = this.head, a = 1, l = t.data;
|
|
130
|
+
for (e -= l.length; t = t.next; ) {
|
|
131
|
+
var n = t.data, h = e > n.length ? n.length : e;
|
|
132
|
+
if (h === n.length ? l += n : l += n.slice(0, e), e -= h, e === 0) {
|
|
133
|
+
h === n.length ? (++a, t.next ? this.head = t.next : this.head = this.tail = null) : (this.head = t, t.data = n.slice(h));
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
++a;
|
|
137
|
+
}
|
|
138
|
+
return this.length -= a, l;
|
|
139
|
+
}
|
|
140
|
+
// Consumes a specified amount of bytes from the buffered data.
|
|
141
|
+
}, {
|
|
142
|
+
key: "_getBuffer",
|
|
143
|
+
value: function(e) {
|
|
144
|
+
var t = u.allocUnsafe(e), a = this.head, l = 1;
|
|
145
|
+
for (a.data.copy(t), e -= a.data.length; a = a.next; ) {
|
|
146
|
+
var n = a.data, h = e > n.length ? n.length : e;
|
|
147
|
+
if (n.copy(t, t.length - e, 0, h), e -= h, e === 0) {
|
|
148
|
+
h === n.length ? (++l, a.next ? this.head = a.next : this.head = this.tail = null) : (this.head = a, a.data = n.slice(h));
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
++l;
|
|
152
|
+
}
|
|
153
|
+
return this.length -= l, t;
|
|
154
|
+
}
|
|
155
|
+
// Make sure the linked list only shows the minimal necessary information.
|
|
156
|
+
}, {
|
|
157
|
+
key: w,
|
|
158
|
+
value: function(e, t) {
|
|
159
|
+
return f(this, c(c({}, t), {}, {
|
|
160
|
+
// Only inspect one level.
|
|
161
|
+
depth: 0,
|
|
162
|
+
// It should not recurse.
|
|
163
|
+
customInspect: !1
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
}]), i;
|
|
167
|
+
}(), s;
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
q as __require
|
|
171
|
+
};
|
package/dist/index78.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t,e){var i=this,a=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return a||d?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(l,this,t)):process.nextTick(l,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(r){!e&&r?i._writableState?i._writableState.errorEmitted?process.nextTick(s,i):(i._writableState.errorEmitted=!0,process.nextTick(o,i,r)):process.nextTick(o,i,r):e?(process.nextTick(s,i),e(r)):process.nextTick(s,i)}),this)}function o(t,e){l(t,e),s(t)}function s(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function S(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function l(t,e){t.emit("error",e)}function _(t,e){var i=t._readableState,a=t._writableState;i&&i.autoDestroy||a&&a.autoDestroy?t.destroy(e):t.emit("error",e)}var b={destroy:n,undestroy:S,errorOrDestroy:_};exports.destroy_1=b;
|
package/dist/index78.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function n(t, e) {
|
|
2
|
+
var i = this, a = this._readableState && this._readableState.destroyed, o = this._writableState && this._writableState.destroyed;
|
|
3
|
+
return a || o ? (e ? e(t) : t && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(l, this, t)) : process.nextTick(l, this, t)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(t || null, function(r) {
|
|
4
|
+
!e && r ? i._writableState ? i._writableState.errorEmitted ? process.nextTick(s, i) : (i._writableState.errorEmitted = !0, process.nextTick(d, i, r)) : process.nextTick(d, i, r) : e ? (process.nextTick(s, i), e(r)) : process.nextTick(s, i);
|
|
5
|
+
}), this);
|
|
6
|
+
}
|
|
7
|
+
function d(t, e) {
|
|
8
|
+
l(t, e), s(t);
|
|
9
|
+
}
|
|
10
|
+
function s(t) {
|
|
11
|
+
t._writableState && !t._writableState.emitClose || t._readableState && !t._readableState.emitClose || t.emit("close");
|
|
12
|
+
}
|
|
13
|
+
function _() {
|
|
14
|
+
this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
|
|
15
|
+
}
|
|
16
|
+
function l(t, e) {
|
|
17
|
+
t.emit("error", e);
|
|
18
|
+
}
|
|
19
|
+
function S(t, e) {
|
|
20
|
+
var i = t._readableState, a = t._writableState;
|
|
21
|
+
i && i.autoDestroy || a && a.autoDestroy ? t.destroy(e) : t.emit("error", e);
|
|
22
|
+
}
|
|
23
|
+
var h = {
|
|
24
|
+
destroy: n,
|
|
25
|
+
undestroy: _,
|
|
26
|
+
errorOrDestroy: S
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
h as d
|
|
30
|
+
};
|
package/dist/index79.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index80.cjs");const h=require("./index83.cjs");var n=h.__exports.codes.ERR_INVALID_OPT_VALUE;function u(e,a,t){return e.highWaterMark!=null?e.highWaterMark:a?e[t]:null}function g(e,a,t,i){var r=u(a,i,t);if(r!=null){if(!(isFinite(r)&&Math.floor(r)===r)||r<0){var o=i?t:"highWaterMark";throw new n(o,r)}return Math.floor(r)}return e.objectMode?16:16*1024}var M={getHighWaterMark:g};exports.state=M;
|
package/dist/index79.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "./index80.js";
|
|
2
|
+
import { __exports as i } from "./index83.js";
|
|
3
|
+
var n = i.codes.ERR_INVALID_OPT_VALUE;
|
|
4
|
+
function M(t, e, a) {
|
|
5
|
+
return t.highWaterMark != null ? t.highWaterMark : e ? t[a] : null;
|
|
6
|
+
}
|
|
7
|
+
function g(t, e, a, h) {
|
|
8
|
+
var r = M(e, h, a);
|
|
9
|
+
if (r != null) {
|
|
10
|
+
if (!(isFinite(r) && Math.floor(r) === r) || r < 0) {
|
|
11
|
+
var o = h ? a : "highWaterMark";
|
|
12
|
+
throw new n(o, r);
|
|
13
|
+
}
|
|
14
|
+
return Math.floor(r);
|
|
15
|
+
}
|
|
16
|
+
return t.objectMode ? 16 : 16 * 1024;
|
|
17
|
+
}
|
|
18
|
+
var k = {
|
|
19
|
+
getHighWaterMark: g
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
k as s
|
|
23
|
+
};
|
package/dist/index8.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@catalogfi/utils"),i=require("viem");require("./index14.cjs");const g=require("tiny-secp256k1"),f=require("@gardenfi/utils"),y=require("./index15.cjs");function m(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const p=m(g);class a{constructor(e){this.privKey=e}static fromPrivKey(e){return new a(r.trim0x(e))}static async fromWalletClient(e){if(!e.account)return r.Err("No account found");try{const t=await e.signTypedData({account:e.account,types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"}],Data:[{name:"Message",type:"string"},{name:"Version",type:"string"},{name:"Nonce",type:"uint256"}]},domain:{name:"WBTC GARDEN",version:"1"},primaryType:"Data",message:{Message:"Initialize your account",Version:"1.0.2",Nonce:1n}});return r.Ok(new a(r.trim0x(i.sha256(t))))}catch(t){return r.Err("Failed to initialize: "+t)}}getMasterPrivKey(){return this.privKey}generateSecret(e){const t=this.signMessage(e),n=i.sha256(f.with0x(t)),o=i.sha256(n);return r.Ok({secret:n,secretHash:o})}signMessage(e){const t=y.__exports.ECPairFactory(p),n="Garden.fi"+e.toString(),o=Buffer.from(n,"utf8"),u=i.sha256(o),c=Buffer.from(r.trim0x(this.privKey),"hex");if(c.length!==32)throw new Error("Invalid private key length. Expected 32 bytes.");return t.fromPrivateKey(c).sign(Buffer.from(r.trim0x(u),"hex")).toString("hex")}}exports.SecretManager=a;
|
package/dist/index8.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { trim0x as n, Err as c, Ok as m } from "@catalogfi/utils";
|
|
2
|
+
import { sha256 as s } from "viem";
|
|
3
|
+
import "./index14.js";
|
|
4
|
+
import * as u from "tiny-secp256k1";
|
|
5
|
+
import { with0x as f } from "@gardenfi/utils";
|
|
6
|
+
import { __exports as y } from "./index15.js";
|
|
7
|
+
class a {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
this.privKey = e;
|
|
10
|
+
}
|
|
11
|
+
static fromPrivKey(e) {
|
|
12
|
+
return new a(n(e));
|
|
13
|
+
}
|
|
14
|
+
static async fromWalletClient(e) {
|
|
15
|
+
if (!e.account) return c("No account found");
|
|
16
|
+
try {
|
|
17
|
+
const r = await e.signTypedData({
|
|
18
|
+
account: e.account,
|
|
19
|
+
types: {
|
|
20
|
+
EIP712Domain: [
|
|
21
|
+
{ name: "name", type: "string" },
|
|
22
|
+
{ name: "version", type: "string" }
|
|
23
|
+
],
|
|
24
|
+
Data: [
|
|
25
|
+
{ name: "Message", type: "string" },
|
|
26
|
+
{ name: "Version", type: "string" },
|
|
27
|
+
{ name: "Nonce", type: "uint256" }
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
domain: {
|
|
31
|
+
name: "WBTC GARDEN",
|
|
32
|
+
version: "1"
|
|
33
|
+
},
|
|
34
|
+
primaryType: "Data",
|
|
35
|
+
message: {
|
|
36
|
+
Message: "Initialize your account",
|
|
37
|
+
Version: "1.0.2",
|
|
38
|
+
Nonce: 1n
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return m(new a(n(s(r))));
|
|
42
|
+
} catch (r) {
|
|
43
|
+
return c("Failed to initialize: " + r);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
getMasterPrivKey() {
|
|
47
|
+
return this.privKey;
|
|
48
|
+
}
|
|
49
|
+
generateSecret(e) {
|
|
50
|
+
const r = this.signMessage(e), t = s(f(r)), i = s(t);
|
|
51
|
+
return m({ secret: t, secretHash: i });
|
|
52
|
+
}
|
|
53
|
+
signMessage(e) {
|
|
54
|
+
const r = y.ECPairFactory(u), t = "Garden.fi" + e.toString(), i = Buffer.from(t, "utf8"), g = s(i), o = Buffer.from(n(this.privKey), "hex");
|
|
55
|
+
if (o.length !== 32)
|
|
56
|
+
throw new Error("Invalid private key length. Expected 32 bytes.");
|
|
57
|
+
return r.fromPrivateKey(o).sign(Buffer.from(n(g), "hex")).toString("hex");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
a as SecretManager
|
|
62
|
+
};
|
package/dist/index80.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./index83.cjs");function l(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}var _={};function o(r,n,t){t||(t=Error);function e(E,c,u){return typeof n=="string"?n:n(E,c,u)}var i=function(E){l(c,E);function c(u,R,T){return E.call(this,e(u,R,T))||this}return c}(t);i.prototype.name=t.name,i.prototype.code=r,_[r]=i}function f(r,n){if(Array.isArray(r)){var t=r.length;return r=r.map(function(e){return String(e)}),t>2?"one of ".concat(n," ").concat(r.slice(0,t-1).join(", "),", or ")+r[t-1]:t===2?"one of ".concat(n," ").concat(r[0]," or ").concat(r[1]):"of ".concat(n," ").concat(r[0])}else return"of ".concat(n," ").concat(String(r))}function p(r,n,t){return r.substr(0,n.length)===n}function y(r,n,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-n.length,t)===n}function s(r,n,t){return typeof t!="number"&&(t=0),t+n.length>r.length?!1:r.indexOf(n,t)!==-1}o("ERR_INVALID_OPT_VALUE",function(r,n){return'The value "'+n+'" is invalid for option "'+r+'"'},TypeError);o("ERR_INVALID_ARG_TYPE",function(r,n,t){var e;typeof n=="string"&&p(n,"not ")?(e="must not be",n=n.replace(/^not /,"")):e="must be";var i;if(y(r," argument"))i="The ".concat(r," ").concat(e," ").concat(f(n,"type"));else{var E=s(r,".")?"property":"argument";i='The "'.concat(r,'" ').concat(E," ").concat(e," ").concat(f(n,"type"))}return i+=". Received type ".concat(typeof t),i},TypeError);o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");o("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});o("ERR_STREAM_PREMATURE_CLOSE","Premature close");o("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});o("ERR_MULTIPLE_CALLBACK","Callback called multiple times");o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");o("ERR_STREAM_WRITE_AFTER_END","write after end");o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);o("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");a.__exports.codes=_;module.exports=a.__exports;
|
package/dist/index80.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { __exports as T } from "./index83.js";
|
|
2
|
+
function l(r, n) {
|
|
3
|
+
r.prototype = Object.create(n.prototype), r.prototype.constructor = r, r.__proto__ = n;
|
|
4
|
+
}
|
|
5
|
+
var a = {};
|
|
6
|
+
function o(r, n, t) {
|
|
7
|
+
t || (t = Error);
|
|
8
|
+
function e(i, c, u) {
|
|
9
|
+
return typeof n == "string" ? n : n(i, c, u);
|
|
10
|
+
}
|
|
11
|
+
var E = /* @__PURE__ */ function(i) {
|
|
12
|
+
l(c, i);
|
|
13
|
+
function c(u, R, _) {
|
|
14
|
+
return i.call(this, e(u, R, _)) || this;
|
|
15
|
+
}
|
|
16
|
+
return c;
|
|
17
|
+
}(t);
|
|
18
|
+
E.prototype.name = t.name, E.prototype.code = r, a[r] = E;
|
|
19
|
+
}
|
|
20
|
+
function f(r, n) {
|
|
21
|
+
if (Array.isArray(r)) {
|
|
22
|
+
var t = r.length;
|
|
23
|
+
return r = r.map(function(e) {
|
|
24
|
+
return String(e);
|
|
25
|
+
}), t > 2 ? "one of ".concat(n, " ").concat(r.slice(0, t - 1).join(", "), ", or ") + r[t - 1] : t === 2 ? "one of ".concat(n, " ").concat(r[0], " or ").concat(r[1]) : "of ".concat(n, " ").concat(r[0]);
|
|
26
|
+
} else
|
|
27
|
+
return "of ".concat(n, " ").concat(String(r));
|
|
28
|
+
}
|
|
29
|
+
function p(r, n, t) {
|
|
30
|
+
return r.substr(0, n.length) === n;
|
|
31
|
+
}
|
|
32
|
+
function y(r, n, t) {
|
|
33
|
+
return (t === void 0 || t > r.length) && (t = r.length), r.substring(t - n.length, t) === n;
|
|
34
|
+
}
|
|
35
|
+
function A(r, n, t) {
|
|
36
|
+
return typeof t != "number" && (t = 0), t + n.length > r.length ? !1 : r.indexOf(n, t) !== -1;
|
|
37
|
+
}
|
|
38
|
+
o("ERR_INVALID_OPT_VALUE", function(r, n) {
|
|
39
|
+
return 'The value "' + n + '" is invalid for option "' + r + '"';
|
|
40
|
+
}, TypeError);
|
|
41
|
+
o("ERR_INVALID_ARG_TYPE", function(r, n, t) {
|
|
42
|
+
var e;
|
|
43
|
+
typeof n == "string" && p(n, "not ") ? (e = "must not be", n = n.replace(/^not /, "")) : e = "must be";
|
|
44
|
+
var E;
|
|
45
|
+
if (y(r, " argument"))
|
|
46
|
+
E = "The ".concat(r, " ").concat(e, " ").concat(f(n, "type"));
|
|
47
|
+
else {
|
|
48
|
+
var i = A(r, ".") ? "property" : "argument";
|
|
49
|
+
E = 'The "'.concat(r, '" ').concat(i, " ").concat(e, " ").concat(f(n, "type"));
|
|
50
|
+
}
|
|
51
|
+
return E += ". Received type ".concat(typeof t), E;
|
|
52
|
+
}, TypeError);
|
|
53
|
+
o("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
54
|
+
o("ERR_METHOD_NOT_IMPLEMENTED", function(r) {
|
|
55
|
+
return "The " + r + " method is not implemented";
|
|
56
|
+
});
|
|
57
|
+
o("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
58
|
+
o("ERR_STREAM_DESTROYED", function(r) {
|
|
59
|
+
return "Cannot call " + r + " after a stream was destroyed";
|
|
60
|
+
});
|
|
61
|
+
o("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
62
|
+
o("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
63
|
+
o("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
64
|
+
o("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
65
|
+
o("ERR_UNKNOWN_ENCODING", function(r) {
|
|
66
|
+
return "Unknown encoding: " + r;
|
|
67
|
+
}, TypeError);
|
|
68
|
+
o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
69
|
+
T.codes = a;
|
|
70
|
+
export {
|
|
71
|
+
T as default
|
|
72
|
+
};
|
package/dist/index81.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index73.cjs");var S,h;function I(){if(h)return S;h=1;var m;function u(t,e,n){return e=_(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t){var e=R(t,"string");return typeof e=="symbol"?e:String(e)}function R(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var p=k.endOfStream,i=Symbol("lastResolve"),s=Symbol("lastReject"),d=Symbol("error"),b=Symbol("ended"),f=Symbol("lastPromise"),P=Symbol("handlePromise"),c=Symbol("stream");function a(t,e){return{value:t,done:e}}function w(t){var e=t[i];if(e!==null){var n=t[c].read();n!==null&&(t[f]=null,t[i]=null,t[s]=null,e(a(n,!1)))}}function O(t){process.nextTick(w,t)}function g(t,e){return function(n,r){t.then(function(){if(e[b]){n(a(void 0,!0));return}e[P](n,r)},r)}}var A=Object.getPrototypeOf(function(){}),E=Object.setPrototypeOf((m={get stream(){return this[c]},next:function(){var e=this,n=this[d];if(n!==null)return Promise.reject(n);if(this[b])return Promise.resolve(a(void 0,!0));if(this[c].destroyed)return new Promise(function(v,y){process.nextTick(function(){e[d]?y(e[d]):v(a(void 0,!0))})});var r=this[f],l;if(r)l=new Promise(g(r,this));else{var o=this[c].read();if(o!==null)return Promise.resolve(a(o,!1));l=new Promise(this[P])}return this[f]=l,l}},u(m,Symbol.asyncIterator,function(){return this}),u(m,"return",function(){var e=this;return new Promise(function(n,r){e[c].destroy(null,function(l){if(l){r(l);return}n(a(void 0,!0))})})}),m),A),j=function(e){var n,r=Object.create(E,(n={},u(n,c,{value:e,writable:!0}),u(n,i,{value:null,writable:!0}),u(n,s,{value:null,writable:!0}),u(n,d,{value:null,writable:!0}),u(n,b,{value:e._readableState.endEmitted,writable:!0}),u(n,P,{value:function(o,v){var y=r[c].read();y?(r[f]=null,r[i]=null,r[s]=null,o(a(y,!1))):(r[i]=o,r[s]=v)},writable:!0}),n));return r[f]=null,p(e,function(l){if(l&&l.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=r[s];o!==null&&(r[f]=null,r[i]=null,r[s]=null,o(l)),r[d]=l;return}var v=r[i];v!==null&&(r[f]=null,r[i]=null,r[s]=null,v(a(void 0,!0))),r[b]=!0}),e.on("readable",O.bind(null,r)),r};return S=j,S}exports.__require=I;
|