@jspm/core
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -1,10 +0,9 @@ | ||
import { e as exports } from './chunk-6c718bbe.js'; | ||
import exports from './stream.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-CcCWfKp1.js'; | ||
import './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
@@ -11,0 +10,0 @@ var _stream_duplex = exports.Duplex; |
@@ -1,10 +0,9 @@ | ||
import { e as exports } from './chunk-6c718bbe.js'; | ||
import exports from './stream.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-CcCWfKp1.js'; | ||
import './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
@@ -11,0 +10,0 @@ var _stream_passthrough = exports.PassThrough; |
import { Readable } from './stream.js'; | ||
export { Readable as default } from './stream.js'; | ||
import './chunk-6c718bbe.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-CcCWfKp1.js'; | ||
import './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
@@ -18,2 +14,2 @@ var ReadableState = Readable.ReadableState; | ||
export { ReadableState, _fromList, from }; | ||
export { ReadableState, _fromList, Readable as default, from }; |
@@ -1,10 +0,9 @@ | ||
import { e as exports } from './chunk-6c718bbe.js'; | ||
import exports from './stream.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-CcCWfKp1.js'; | ||
import './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
@@ -11,0 +10,0 @@ var _stream_transform = exports.Transform; |
@@ -1,10 +0,9 @@ | ||
import { e as exports } from './chunk-6c718bbe.js'; | ||
import exports from './stream.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-CcCWfKp1.js'; | ||
import './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
@@ -11,0 +10,0 @@ var _stream_writable = exports.Writable; |
import { strict } from '../assert.js'; | ||
export { strict as default, strict } from '../assert.js'; | ||
import '../chunk-b4205b57.js'; | ||
import '../chunk-5decc758.js'; | ||
import '../util.js'; | ||
import '../chunk-DtcTpLWz.js'; | ||
import '../chunk-CkFCi-G1.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
@@ -28,2 +29,2 @@ const { | ||
export { AssertionError, CallTracker, deepEqual, deepStrictEqual, doesNotMatch, doesNotReject, doesNotThrow, equal, fail, ifError, match, notDeepEqual, notDeepStrictEqual, notEqual, notStrictEqual, ok, rejects, strictEqual, throws }; | ||
export { AssertionError, CallTracker, deepEqual, deepStrictEqual, strict as default, doesNotMatch, doesNotReject, doesNotThrow, equal, fail, ifError, match, notDeepEqual, notDeepStrictEqual, notEqual, notStrictEqual, ok, rejects, strict, strictEqual, throws }; |
@@ -1,28 +0,20 @@ | ||
import './util.js'; | ||
import et from './assert.js'; | ||
import { X } from './chunk-b4205b57.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-CbQqNoLO.js'; | ||
import { e as et } from './chunk-CjPlbOtt.js'; | ||
import { X } from './chunk-D3uu3VYh.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
var _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
/*global window, global*/ | ||
var util = X; | ||
var assert = et; | ||
function now() { | ||
return new Date().getTime(); | ||
} | ||
var slice = Array.prototype.slice; | ||
var console; | ||
var times = {}; | ||
if (typeof _global !== "undefined" && _global.console) { | ||
@@ -35,5 +27,3 @@ console = _global.console; | ||
} | ||
var functions = [[log, "log"], [info, "info"], [warn, "warn"], [error, "error"], [time, "time"], [timeEnd, "timeEnd"], [trace, "trace"], [dir, "dir"], [consoleAssert, "assert"]]; | ||
for (var i = 0; i < functions.length; i++) { | ||
@@ -43,3 +33,2 @@ var tuple = functions[i]; | ||
var name = tuple[1]; | ||
if (!console[name]) { | ||
@@ -49,30 +38,21 @@ console[name] = f; | ||
} | ||
exports$1 = console; | ||
function log() {} | ||
function info() { | ||
console.log.apply(console, arguments); | ||
} | ||
function warn() { | ||
console.log.apply(console, arguments); | ||
} | ||
function error() { | ||
console.warn.apply(console, arguments); | ||
} | ||
function time(label) { | ||
times[label] = now(); | ||
} | ||
function timeEnd(label) { | ||
var time = times[label]; | ||
if (!time) { | ||
throw new Error("No such label: " + label); | ||
} | ||
delete times[label]; | ||
@@ -82,3 +62,2 @@ var duration = now() - time; | ||
} | ||
function trace() { | ||
@@ -90,7 +69,5 @@ var err = new Error(); | ||
} | ||
function dir(object) { | ||
console.log(util.inspect(object) + "\n"); | ||
} | ||
function consoleAssert(expression) { | ||
@@ -102,3 +79,2 @@ if (!expression) { | ||
} | ||
return exports$1; | ||
@@ -105,0 +81,0 @@ } |
@@ -1,9 +0,8 @@ | ||
import './util.js'; | ||
import { p as process } from './chunk-2eac56ff.js'; | ||
import { X } from './chunk-b4205b57.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-5decc758.js'; | ||
import exports$2 from './util.js'; | ||
import { p as process } from './chunk-DEMDiNwt.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
function dew() { | ||
@@ -13,8 +12,8 @@ if (_dewExec) return exports$1; | ||
var process$1 = process; | ||
const util = X; // Port from node core lib/internal/errors.js | ||
const util = exports$2; | ||
// Port from node core lib/internal/errors.js | ||
class ERR_INVALID_ARG_TYPE extends TypeError { | ||
constructor(message, actual) { | ||
super(); | ||
if (actual == null) { | ||
@@ -37,10 +36,7 @@ message += `. Received ${actual}`; | ||
}); | ||
if (inspected.length > 25) { | ||
inspected = `${inspected.slice(0, 25)}...`; | ||
} | ||
message += `. Received type ${typeof actual} (${inspected})`; | ||
} | ||
this.code = this.constructor.name; | ||
@@ -58,3 +54,2 @@ Object.defineProperties(this, { | ||
}, | ||
enumerable: false, | ||
@@ -66,5 +61,3 @@ writable: true, | ||
} | ||
} | ||
class ActiveChannel { | ||
@@ -75,24 +68,19 @@ subscribe(subscription) { | ||
} | ||
this._subscribers.push(subscription); | ||
} | ||
unsubscribe(subscription) { | ||
const index = this._subscribers.indexOf(subscription); | ||
if (index === -1) return false; | ||
this._subscribers.splice(index, 1); | ||
if (index >= 0) { | ||
this._subscribers.splice(index, 1); // When there are no more active subscribers, restore to fast prototype. | ||
if (!this._subscribers.length) { | ||
// eslint-disable-next-line no-use-before-define | ||
Object.setPrototypeOf(this, Channel.prototype); | ||
} | ||
// When there are no more active subscribers, restore to fast prototype. | ||
if (!this._subscribers.length) { | ||
// eslint-disable-next-line no-use-before-define | ||
Object.setPrototypeOf(this, Channel.prototype); | ||
} | ||
return true; | ||
} | ||
get hasSubscribers() { | ||
return true; | ||
} | ||
publish(data) { | ||
@@ -110,5 +98,3 @@ for (let i = 0; i < this._subscribers.length; i++) { | ||
} | ||
} | ||
class Channel { | ||
@@ -119,3 +105,2 @@ constructor(name) { | ||
} | ||
static [Symbol.hasInstance](instance) { | ||
@@ -125,3 +110,2 @@ const prototype = Object.getPrototypeOf(instance); | ||
} | ||
subscribe(subscription) { | ||
@@ -132,34 +116,26 @@ Object.setPrototypeOf(this, ActiveChannel.prototype); | ||
} | ||
unsubscribe() { | ||
return false; | ||
} | ||
get hasSubscribers() { | ||
return false; | ||
} | ||
publish() {} | ||
} | ||
const channels = {}; | ||
function channel(name) { | ||
const channel = channels[name]; | ||
if (channel) return channel; | ||
if (typeof name !== "string" && typeof name !== "symbol") { | ||
throw new ERR_INVALID_ARG_TYPE("The \"channel\" argument must be one of type string or symbol", name); | ||
} | ||
return channels[name] = new Channel(name); | ||
} | ||
function hasSubscribers(name) { | ||
const channel = channels[name]; | ||
if (!channel) { | ||
return false; | ||
} | ||
return channel.hasSubscribers; | ||
} | ||
function deleteChannel(name) { | ||
@@ -170,6 +146,4 @@ if (channels[name]) { | ||
} | ||
return false; | ||
} | ||
exports$1 = { | ||
@@ -176,0 +150,0 @@ channel, |
@@ -1,35 +0,29 @@ | ||
import './events.js'; | ||
import { y } from './chunk-4bd36a8f.js'; | ||
import './chunk-DtDiafJB.js'; | ||
import { y } from './chunk-tHuMsdT0.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
exports$1 = function () { | ||
// Import Events | ||
var events = y; // Export Domain | ||
var events = y; | ||
// Export Domain | ||
var domain = {}; | ||
domain.createDomain = domain.create = function () { | ||
var d = new events.EventEmitter(); | ||
function emitError(e) { | ||
d.emit("error", e); | ||
} | ||
d.add = function (emitter) { | ||
emitter.on("error", emitError); | ||
}; | ||
d.remove = function (emitter) { | ||
emitter.removeListener("error", emitError); | ||
}; | ||
d.bind = function (fn) { | ||
return function () { | ||
var args = Array.prototype.slice.call(arguments); | ||
try { | ||
@@ -42,3 +36,2 @@ fn.apply(null, args); | ||
}; | ||
d.intercept = function (fn) { | ||
@@ -50,3 +43,2 @@ return function (err) { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
try { | ||
@@ -60,3 +52,2 @@ fn.apply(null, args); | ||
}; | ||
d.run = function (fn) { | ||
@@ -68,6 +59,4 @@ try { | ||
} | ||
return this; | ||
}; | ||
d.dispose = function () { | ||
@@ -77,13 +66,9 @@ this.removeAllListeners(); | ||
}; | ||
d.enter = d.exit = function () { | ||
return this; | ||
}; | ||
return d; | ||
}; | ||
return domain; | ||
}.call(exports$1); | ||
return exports$1; | ||
@@ -90,0 +75,0 @@ } |
@@ -1,6 +0,390 @@ | ||
import { y } from './chunk-4bd36a8f.js'; | ||
export { y as default } from './chunk-4bd36a8f.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
var R = typeof Reflect === "object" ? Reflect : null; | ||
var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply(target, receiver, args) { | ||
return Function.prototype.apply.call(target, receiver, args); | ||
}; | ||
var ReflectOwnKeys; | ||
if (R && typeof R.ownKeys === "function") { | ||
ReflectOwnKeys = R.ownKeys; | ||
} else if (Object.getOwnPropertySymbols) { | ||
ReflectOwnKeys = function ReflectOwnKeys(target) { | ||
return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); | ||
}; | ||
} else { | ||
ReflectOwnKeys = function ReflectOwnKeys(target) { | ||
return Object.getOwnPropertyNames(target); | ||
}; | ||
} | ||
function ProcessEmitWarning(warning) { | ||
if (console && console.warn) console.warn(warning); | ||
} | ||
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { | ||
return value !== value; | ||
}; | ||
function EventEmitter() { | ||
EventEmitter.init.call(this); | ||
} | ||
exports$1 = EventEmitter; | ||
exports$1.once = once; | ||
// Backwards-compat with node 0.10.x | ||
EventEmitter.EventEmitter = EventEmitter; | ||
EventEmitter.prototype._events = undefined; | ||
EventEmitter.prototype._eventsCount = 0; | ||
EventEmitter.prototype._maxListeners = undefined; | ||
// By default EventEmitters will print a warning if more than 10 listeners are | ||
// added to it. This is a useful default which helps finding memory leaks. | ||
var defaultMaxListeners = 10; | ||
function checkListener(listener) { | ||
if (typeof listener !== "function") { | ||
throw new TypeError("The \"listener\" argument must be of type Function. Received type " + typeof listener); | ||
} | ||
} | ||
Object.defineProperty(EventEmitter, "defaultMaxListeners", { | ||
enumerable: true, | ||
get: function () { | ||
return defaultMaxListeners; | ||
}, | ||
set: function (arg) { | ||
if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { | ||
throw new RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + arg + "."); | ||
} | ||
defaultMaxListeners = arg; | ||
} | ||
}); | ||
EventEmitter.init = function () { | ||
if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { | ||
this._events = Object.create(null); | ||
this._eventsCount = 0; | ||
} | ||
this._maxListeners = this._maxListeners || undefined; | ||
}; | ||
// Obviously not all Emitters should be limited to 10. This function allows | ||
// that to be increased. Set to zero for unlimited. | ||
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { | ||
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { | ||
throw new RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + n + "."); | ||
} | ||
this._maxListeners = n; | ||
return this; | ||
}; | ||
function _getMaxListeners(that) { | ||
if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners; | ||
return that._maxListeners; | ||
} | ||
EventEmitter.prototype.getMaxListeners = function getMaxListeners() { | ||
return _getMaxListeners(this); | ||
}; | ||
EventEmitter.prototype.emit = function emit(type) { | ||
var args = []; | ||
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); | ||
var doError = type === "error"; | ||
var events = this._events; | ||
if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; | ||
// If there is no 'error' event listener then throw. | ||
if (doError) { | ||
var er; | ||
if (args.length > 0) er = args[0]; | ||
if (er instanceof Error) { | ||
// Note: The comments on the `throw` lines are intentional, they show | ||
// up in Node's output if this results in an unhandled exception. | ||
throw er; // Unhandled 'error' event | ||
} | ||
// At least give some kind of context to the user | ||
var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : "")); | ||
err.context = er; | ||
throw err; // Unhandled 'error' event | ||
} | ||
var handler = events[type]; | ||
if (handler === undefined) return false; | ||
if (typeof handler === "function") { | ||
ReflectApply(handler, this, args); | ||
} else { | ||
var len = handler.length; | ||
var listeners = arrayClone(handler, len); | ||
for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args); | ||
} | ||
return true; | ||
}; | ||
function _addListener(target, type, listener, prepend) { | ||
var m; | ||
var events; | ||
var existing; | ||
checkListener(listener); | ||
events = target._events; | ||
if (events === undefined) { | ||
events = target._events = Object.create(null); | ||
target._eventsCount = 0; | ||
} else { | ||
// To avoid recursion in the case that type === "newListener"! Before | ||
// adding it to the listeners, first emit "newListener". | ||
if (events.newListener !== undefined) { | ||
target.emit("newListener", type, listener.listener ? listener.listener : listener); | ||
// Re-assign `events` because a newListener handler could have caused the | ||
// this._events to be assigned to a new object | ||
events = target._events; | ||
} | ||
existing = events[type]; | ||
} | ||
if (existing === undefined) { | ||
// Optimize the case of one listener. Don't need the extra array object. | ||
existing = events[type] = listener; | ||
++target._eventsCount; | ||
} else { | ||
if (typeof existing === "function") { | ||
// Adding the second element, need to change to array. | ||
existing = events[type] = prepend ? [listener, existing] : [existing, listener]; | ||
// If we've already got an array, just append. | ||
} else if (prepend) { | ||
existing.unshift(listener); | ||
} else { | ||
existing.push(listener); | ||
} | ||
// Check for listener leak | ||
m = _getMaxListeners(target); | ||
if (m > 0 && existing.length > m && !existing.warned) { | ||
existing.warned = true; | ||
// No error code for this since it is a Warning | ||
// eslint-disable-next-line no-restricted-syntax | ||
var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners " + "added. Use emitter.setMaxListeners() to " + "increase limit"); | ||
w.name = "MaxListenersExceededWarning"; | ||
w.emitter = target; | ||
w.type = type; | ||
w.count = existing.length; | ||
ProcessEmitWarning(w); | ||
} | ||
} | ||
return target; | ||
} | ||
EventEmitter.prototype.addListener = function addListener(type, listener) { | ||
return _addListener(this, type, listener, false); | ||
}; | ||
EventEmitter.prototype.on = EventEmitter.prototype.addListener; | ||
EventEmitter.prototype.prependListener = function prependListener(type, listener) { | ||
return _addListener(this, type, listener, true); | ||
}; | ||
function onceWrapper() { | ||
if (!this.fired) { | ||
this.target.removeListener(this.type, this.wrapFn); | ||
this.fired = true; | ||
if (arguments.length === 0) return this.listener.call(this.target); | ||
return this.listener.apply(this.target, arguments); | ||
} | ||
} | ||
function _onceWrap(target, type, listener) { | ||
var state = { | ||
fired: false, | ||
wrapFn: undefined, | ||
target: target, | ||
type: type, | ||
listener: listener | ||
}; | ||
var wrapped = onceWrapper.bind(state); | ||
wrapped.listener = listener; | ||
state.wrapFn = wrapped; | ||
return wrapped; | ||
} | ||
EventEmitter.prototype.once = function once(type, listener) { | ||
checkListener(listener); | ||
this.on(type, _onceWrap(this, type, listener)); | ||
return this; | ||
}; | ||
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { | ||
checkListener(listener); | ||
this.prependListener(type, _onceWrap(this, type, listener)); | ||
return this; | ||
}; | ||
// Emits a 'removeListener' event if and only if the listener was removed. | ||
EventEmitter.prototype.removeListener = function removeListener(type, listener) { | ||
var list, events, position, i, originalListener; | ||
checkListener(listener); | ||
events = this._events; | ||
if (events === undefined) return this; | ||
list = events[type]; | ||
if (list === undefined) return this; | ||
if (list === listener || list.listener === listener) { | ||
if (--this._eventsCount === 0) this._events = Object.create(null);else { | ||
delete events[type]; | ||
if (events.removeListener) this.emit("removeListener", type, list.listener || listener); | ||
} | ||
} else if (typeof list !== "function") { | ||
position = -1; | ||
for (i = list.length - 1; i >= 0; i--) { | ||
if (list[i] === listener || list[i].listener === listener) { | ||
originalListener = list[i].listener; | ||
position = i; | ||
break; | ||
} | ||
} | ||
if (position < 0) return this; | ||
if (position === 0) list.shift();else { | ||
spliceOne(list, position); | ||
} | ||
if (list.length === 1) events[type] = list[0]; | ||
if (events.removeListener !== undefined) this.emit("removeListener", type, originalListener || listener); | ||
} | ||
return this; | ||
}; | ||
EventEmitter.prototype.off = EventEmitter.prototype.removeListener; | ||
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { | ||
var listeners, events, i; | ||
events = this._events; | ||
if (events === undefined) return this; | ||
// not listening for removeListener, no need to emit | ||
if (events.removeListener === undefined) { | ||
if (arguments.length === 0) { | ||
this._events = Object.create(null); | ||
this._eventsCount = 0; | ||
} else if (events[type] !== undefined) { | ||
if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type]; | ||
} | ||
return this; | ||
} | ||
// emit removeListener for all listeners on all events | ||
if (arguments.length === 0) { | ||
var keys = Object.keys(events); | ||
var key; | ||
for (i = 0; i < keys.length; ++i) { | ||
key = keys[i]; | ||
if (key === "removeListener") continue; | ||
this.removeAllListeners(key); | ||
} | ||
this.removeAllListeners("removeListener"); | ||
this._events = Object.create(null); | ||
this._eventsCount = 0; | ||
return this; | ||
} | ||
listeners = events[type]; | ||
if (typeof listeners === "function") { | ||
this.removeListener(type, listeners); | ||
} else if (listeners !== undefined) { | ||
// LIFO order | ||
for (i = listeners.length - 1; i >= 0; i--) { | ||
this.removeListener(type, listeners[i]); | ||
} | ||
} | ||
return this; | ||
}; | ||
function _listeners(target, type, unwrap) { | ||
var events = target._events; | ||
if (events === undefined) return []; | ||
var evlistener = events[type]; | ||
if (evlistener === undefined) return []; | ||
if (typeof evlistener === "function") return unwrap ? [evlistener.listener || evlistener] : [evlistener]; | ||
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); | ||
} | ||
EventEmitter.prototype.listeners = function listeners(type) { | ||
return _listeners(this, type, true); | ||
}; | ||
EventEmitter.prototype.rawListeners = function rawListeners(type) { | ||
return _listeners(this, type, false); | ||
}; | ||
EventEmitter.listenerCount = function (emitter, type) { | ||
if (typeof emitter.listenerCount === "function") { | ||
return emitter.listenerCount(type); | ||
} else { | ||
return listenerCount.call(emitter, type); | ||
} | ||
}; | ||
EventEmitter.prototype.listenerCount = listenerCount; | ||
function listenerCount(type) { | ||
var events = this._events; | ||
if (events !== undefined) { | ||
var evlistener = events[type]; | ||
if (typeof evlistener === "function") { | ||
return 1; | ||
} else if (evlistener !== undefined) { | ||
return evlistener.length; | ||
} | ||
} | ||
return 0; | ||
} | ||
EventEmitter.prototype.eventNames = function eventNames() { | ||
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; | ||
}; | ||
function arrayClone(arr, n) { | ||
var copy = new Array(n); | ||
for (var i = 0; i < n; ++i) copy[i] = arr[i]; | ||
return copy; | ||
} | ||
function spliceOne(list, index) { | ||
for (; index + 1 < list.length; index++) list[index] = list[index + 1]; | ||
list.pop(); | ||
} | ||
function unwrapListeners(arr) { | ||
var ret = new Array(arr.length); | ||
for (var i = 0; i < ret.length; ++i) { | ||
ret[i] = arr[i].listener || arr[i]; | ||
} | ||
return ret; | ||
} | ||
function once(emitter, name) { | ||
return new Promise(function (resolve, reject) { | ||
function errorListener(err) { | ||
emitter.removeListener(name, resolver); | ||
reject(err); | ||
} | ||
function resolver() { | ||
if (typeof emitter.removeListener === "function") { | ||
emitter.removeListener("error", errorListener); | ||
} | ||
resolve([].slice.call(arguments)); | ||
} | ||
eventTargetAgnosticAddListener(emitter, name, resolver, { | ||
once: true | ||
}); | ||
if (name !== "error") { | ||
addErrorHandlerIfEventEmitter(emitter, errorListener, { | ||
once: true | ||
}); | ||
} | ||
}); | ||
} | ||
function addErrorHandlerIfEventEmitter(emitter, handler, flags) { | ||
if (typeof emitter.on === "function") { | ||
eventTargetAgnosticAddListener(emitter, "error", handler, flags); | ||
} | ||
} | ||
function eventTargetAgnosticAddListener(emitter, name, listener, flags) { | ||
if (typeof emitter.on === "function") { | ||
if (flags.once) { | ||
emitter.once(name, listener); | ||
} else { | ||
emitter.on(name, listener); | ||
} | ||
} else if (typeof emitter.addEventListener === "function") { | ||
// EventTarget does not have `error` event semantics like Node | ||
// EventEmitters, we do not listen for `error` events here. | ||
emitter.addEventListener(name, function wrapListener(arg) { | ||
// IE does not have builtin `{ once: true }` support so we | ||
// have to do it manually. | ||
if (flags.once) { | ||
emitter.removeEventListener(name, wrapListener); | ||
} | ||
listener(arg); | ||
}); | ||
} else { | ||
throw new TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof emitter); | ||
} | ||
} | ||
return exports$1; | ||
} | ||
const exports = dew(); | ||
exports['once']; | ||
// https://github.com/denoland/deno_std/blob/d005433c709054af87aca54f57a446b4f7966f11/node/events.ts#L501-L638 | ||
y.once = function (emitter, event) { | ||
exports.once = function (emitter, event) { | ||
return new Promise((resolve, reject) => { | ||
@@ -27,3 +411,3 @@ function eventListener(...args) { | ||
}; | ||
y.on = function (emitter, event) { | ||
exports.on = function (emitter, event) { | ||
const unconsumedEventValues = []; | ||
@@ -106,4 +490,4 @@ const unconsumedPromises = []; | ||
once, | ||
} = y; | ||
} = exports; | ||
export { EventEmitter, defaultMaxListeners, init, listenerCount, on, once }; | ||
export { EventEmitter, exports as default, defaultMaxListeners, init, listenerCount, on, once }; |
import { promises } from '../fs.js'; | ||
export { promises as default } from '../fs.js'; | ||
import '../chunk-44e51b61.js'; | ||
import '../chunk-4bd36a8f.js'; | ||
import '../chunk-ce0fbc82.js'; | ||
import '../chunk-b4205b57.js'; | ||
import '../chunk-5decc758.js'; | ||
import '../chunk-2eac56ff.js'; | ||
import '../chunk-4ccc3a29.js'; | ||
import '../assert.js'; | ||
import '../util.js'; | ||
import '../path.js'; | ||
import '../chunk-23dbec7b.js'; | ||
import '../events.js'; | ||
import '../stream.js'; | ||
import '../chunk-6c718bbe.js'; | ||
import '../chunk-DtuTasat.js'; | ||
import '../chunk-CjPlbOtt.js'; | ||
import '../chunk-D3uu3VYh.js'; | ||
import '../chunk-CbQqNoLO.js'; | ||
import '../chunk-DHWh-hmB.js'; | ||
import '../chunk-b0rmRow7.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
import '../chunk-DtDiafJB.js'; | ||
import '../chunk-tHuMsdT0.js'; | ||
import '../chunk-B6-G-Ftj.js'; | ||
import '../chunk-B738Er4n.js'; | ||
import '../buffer.js'; | ||
import '../url.js'; | ||
import '../chunk-924bb2e1.js'; | ||
import '../chunk-b04e620d.js'; | ||
import '../buffer.js'; | ||
import '../punycode.js'; | ||
import '../chunk-DtcTpLWz.js'; | ||
import '../chunk-BlJi4mNy.js'; | ||
@@ -53,2 +50,2 @@ const { | ||
export { access, appendFile, chmod, chown, copyFile, cp, lchmod, lchown, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, symlink, truncate, unlink, utimes, watch, writeFile }; | ||
export { access, appendFile, chmod, chown, copyFile, cp, promises as default, lchmod, lchown, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, symlink, truncate, unlink, utimes, watch, writeFile }; |
@@ -1,31 +0,839 @@ | ||
import exports$2 from './http.js'; | ||
import h from './url.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './chunk-c3d025d9.js'; | ||
import './chunk-924bb2e1.js'; | ||
import './chunk-b04e620d.js'; | ||
import './chunk-23dbec7b.js'; | ||
import { b as buffer, d as dew$f } from './chunk-B738Er4n.js'; | ||
import { d as dew$7 } from './chunk-C4rKjYLo.js'; | ||
import { p as process } from './chunk-b0rmRow7.js'; | ||
import { h } from './chunk-DHWh-hmB.js'; | ||
import './chunk-tHuMsdT0.js'; | ||
import './chunk-D3uu3VYh.js'; | ||
var exports$6 = {}, | ||
_dewExec$5 = false; | ||
var _global$3 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$5() { | ||
if (_dewExec$5) return exports$6; | ||
_dewExec$5 = true; | ||
exports$6.fetch = isFunction(_global$3.fetch) && isFunction(_global$3.ReadableStream); | ||
exports$6.writableStream = isFunction(_global$3.WritableStream); | ||
exports$6.abortController = isFunction(_global$3.AbortController); // The xhr request to example.com may violate some restrictive CSP configurations, | ||
// so if we're running in a browser that supports `fetch`, avoid calling getXHR() | ||
// and assume support for certain features below. | ||
var xhr; | ||
function getXHR() { | ||
// Cache the xhr value | ||
if (xhr !== undefined) return xhr; | ||
if (_global$3.XMLHttpRequest) { | ||
xhr = new _global$3.XMLHttpRequest(); // If XDomainRequest is available (ie only, where xhr might not work | ||
// cross domain), use the page location. Otherwise use example.com | ||
// Note: this doesn't actually make an http request. | ||
try { | ||
xhr.open("GET", _global$3.XDomainRequest ? "/" : "https://example.com"); | ||
} catch (e) { | ||
xhr = null; | ||
} | ||
} else { | ||
// Service workers don't have XHR | ||
xhr = null; | ||
} | ||
return xhr; | ||
} | ||
function checkTypeSupport(type) { | ||
var xhr = getXHR(); | ||
if (!xhr) return false; | ||
try { | ||
xhr.responseType = type; | ||
return xhr.responseType === type; | ||
} catch (e) {} | ||
return false; | ||
} // If fetch is supported, then arraybuffer will be supported too. Skip calling | ||
// checkTypeSupport(), since that calls getXHR(). | ||
exports$6.arraybuffer = exports$6.fetch || checkTypeSupport("arraybuffer"); // These next two tests unavoidably show warnings in Chrome. Since fetch will always | ||
// be used if it's available, just return false for these to avoid the warnings. | ||
exports$6.msstream = !exports$6.fetch && checkTypeSupport("ms-stream"); | ||
exports$6.mozchunkedarraybuffer = !exports$6.fetch && checkTypeSupport("moz-chunked-arraybuffer"); // If fetch is supported, then overrideMimeType will be supported too. Skip calling | ||
// getXHR(). | ||
exports$6.overrideMimeType = exports$6.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false); | ||
function isFunction(value) { | ||
return typeof value === "function"; | ||
} | ||
xhr = null; // Help gc | ||
return exports$6; | ||
} | ||
var exports$5 = {}, | ||
_dewExec$4 = false; | ||
var _global$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$4() { | ||
if (_dewExec$4) return exports$5; | ||
_dewExec$4 = true; | ||
var Buffer = buffer.Buffer; | ||
var process$1 = process; | ||
var capability = dew$5(); | ||
var inherits = dew$f(); | ||
var stream = dew$7(); | ||
var rStates = exports$5.readyStates = { | ||
UNSENT: 0, | ||
OPENED: 1, | ||
HEADERS_RECEIVED: 2, | ||
LOADING: 3, | ||
DONE: 4 | ||
}; | ||
var IncomingMessage = exports$5.IncomingMessage = function (xhr, response, mode, resetTimers) { | ||
var self = this || _global$2; | ||
stream.Readable.call(self); | ||
self._mode = mode; | ||
self.headers = {}; | ||
self.rawHeaders = []; | ||
self.trailers = {}; | ||
self.rawTrailers = []; // Fake the 'close' event, but only once 'end' fires | ||
self.on("end", function () { | ||
// The nextTick is necessary to prevent the 'request' module from causing an infinite loop | ||
process$1.nextTick(function () { | ||
self.emit("close"); | ||
}); | ||
}); | ||
if (mode === "fetch") { | ||
self._fetchResponse = response; | ||
self.url = response.url; | ||
self.statusCode = response.status; | ||
self.statusMessage = response.statusText; | ||
response.headers.forEach(function (header, key) { | ||
self.headers[key.toLowerCase()] = header; | ||
self.rawHeaders.push(key, header); | ||
}); | ||
if (capability.writableStream) { | ||
var writable = new WritableStream({ | ||
write: function (chunk) { | ||
resetTimers(false); | ||
return new Promise(function (resolve, reject) { | ||
if (self._destroyed) { | ||
reject(); | ||
} else if (self.push(Buffer.from(chunk))) { | ||
resolve(); | ||
} else { | ||
self._resumeFetch = resolve; | ||
} | ||
}); | ||
}, | ||
close: function () { | ||
resetTimers(true); | ||
if (!self._destroyed) self.push(null); | ||
}, | ||
abort: function (err) { | ||
resetTimers(true); | ||
if (!self._destroyed) self.emit("error", err); | ||
} | ||
}); | ||
try { | ||
response.body.pipeTo(writable).catch(function (err) { | ||
resetTimers(true); | ||
if (!self._destroyed) self.emit("error", err); | ||
}); | ||
return; | ||
} catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this | ||
} // fallback for when writableStream or pipeTo aren't available | ||
var reader = response.body.getReader(); | ||
function read() { | ||
reader.read().then(function (result) { | ||
if (self._destroyed) return; | ||
resetTimers(result.done); | ||
if (result.done) { | ||
self.push(null); | ||
return; | ||
} | ||
self.push(Buffer.from(result.value)); | ||
read(); | ||
}).catch(function (err) { | ||
resetTimers(true); | ||
if (!self._destroyed) self.emit("error", err); | ||
}); | ||
} | ||
read(); | ||
} else { | ||
self._xhr = xhr; | ||
self._pos = 0; | ||
self.url = xhr.responseURL; | ||
self.statusCode = xhr.status; | ||
self.statusMessage = xhr.statusText; | ||
var headers = xhr.getAllResponseHeaders().split(/\r?\n/); | ||
headers.forEach(function (header) { | ||
var matches = header.match(/^([^:]+):\s*(.*)/); | ||
if (matches) { | ||
var key = matches[1].toLowerCase(); | ||
if (key === "set-cookie") { | ||
if (self.headers[key] === undefined) { | ||
self.headers[key] = []; | ||
} | ||
self.headers[key].push(matches[2]); | ||
} else if (self.headers[key] !== undefined) { | ||
self.headers[key] += ", " + matches[2]; | ||
} else { | ||
self.headers[key] = matches[2]; | ||
} | ||
self.rawHeaders.push(matches[1], matches[2]); | ||
} | ||
}); | ||
self._charset = "x-user-defined"; | ||
if (!capability.overrideMimeType) { | ||
var mimeType = self.rawHeaders["mime-type"]; | ||
if (mimeType) { | ||
var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/); | ||
if (charsetMatch) { | ||
self._charset = charsetMatch[1].toLowerCase(); | ||
} | ||
} | ||
if (!self._charset) self._charset = "utf-8"; // best guess | ||
} | ||
} | ||
}; | ||
inherits(IncomingMessage, stream.Readable); | ||
IncomingMessage.prototype._read = function () { | ||
var self = this || _global$2; | ||
var resolve = self._resumeFetch; | ||
if (resolve) { | ||
self._resumeFetch = null; | ||
resolve(); | ||
} | ||
}; | ||
IncomingMessage.prototype._onXHRProgress = function (resetTimers) { | ||
var self = this || _global$2; | ||
var xhr = self._xhr; | ||
var response = null; | ||
switch (self._mode) { | ||
case "text": | ||
response = xhr.responseText; | ||
if (response.length > self._pos) { | ||
var newData = response.substr(self._pos); | ||
if (self._charset === "x-user-defined") { | ||
var buffer = Buffer.alloc(newData.length); | ||
for (var i = 0; i < newData.length; i++) buffer[i] = newData.charCodeAt(i) & 255; | ||
self.push(buffer); | ||
} else { | ||
self.push(newData, self._charset); | ||
} | ||
self._pos = response.length; | ||
} | ||
break; | ||
case "arraybuffer": | ||
if (xhr.readyState !== rStates.DONE || !xhr.response) break; | ||
response = xhr.response; | ||
self.push(Buffer.from(new Uint8Array(response))); | ||
break; | ||
case "moz-chunked-arraybuffer": | ||
// take whole | ||
response = xhr.response; | ||
if (xhr.readyState !== rStates.LOADING || !response) break; | ||
self.push(Buffer.from(new Uint8Array(response))); | ||
break; | ||
case "ms-stream": | ||
response = xhr.response; | ||
if (xhr.readyState !== rStates.LOADING) break; | ||
var reader = new _global$2.MSStreamReader(); | ||
reader.onprogress = function () { | ||
if (reader.result.byteLength > self._pos) { | ||
self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos)))); | ||
self._pos = reader.result.byteLength; | ||
} | ||
}; | ||
reader.onload = function () { | ||
resetTimers(true); | ||
self.push(null); | ||
}; // reader.onerror = ??? // TODO: this | ||
reader.readAsArrayBuffer(response); | ||
break; | ||
} // The ms-stream case handles end separately in reader.onload() | ||
if (self._xhr.readyState === rStates.DONE && self._mode !== "ms-stream") { | ||
resetTimers(true); | ||
self.push(null); | ||
} | ||
}; | ||
return exports$5; | ||
} | ||
var exports$4 = {}, | ||
_dewExec$3 = false; | ||
var _global$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$3() { | ||
if (_dewExec$3) return exports$4; | ||
_dewExec$3 = true; | ||
var Buffer = buffer.Buffer; | ||
var process$1 = process; | ||
var capability = dew$5(); | ||
var inherits = dew$f(); | ||
var response = dew$4(); | ||
var stream = dew$7(); | ||
var IncomingMessage = response.IncomingMessage; | ||
var rStates = response.readyStates; | ||
function decideMode(preferBinary, useFetch) { | ||
if (capability.fetch && useFetch) { | ||
return "fetch"; | ||
} else if (capability.mozchunkedarraybuffer) { | ||
return "moz-chunked-arraybuffer"; | ||
} else if (capability.msstream) { | ||
return "ms-stream"; | ||
} else if (capability.arraybuffer && preferBinary) { | ||
return "arraybuffer"; | ||
} else { | ||
return "text"; | ||
} | ||
} | ||
var ClientRequest = exports$4 = function (opts) { | ||
var self = this || _global$1; | ||
stream.Writable.call(self); | ||
self._opts = opts; | ||
self._body = []; | ||
self._headers = {}; | ||
if (opts.auth) self.setHeader("Authorization", "Basic " + Buffer.from(opts.auth).toString("base64")); | ||
Object.keys(opts.headers).forEach(function (name) { | ||
self.setHeader(name, opts.headers[name]); | ||
}); | ||
var preferBinary; | ||
var useFetch = true; | ||
if (opts.mode === "disable-fetch" || "requestTimeout" in opts && !capability.abortController) { | ||
// If the use of XHR should be preferred. Not typically needed. | ||
useFetch = false; | ||
preferBinary = true; | ||
} else if (opts.mode === "prefer-streaming") { | ||
// If streaming is a high priority but binary compatibility and | ||
// the accuracy of the 'content-type' header aren't | ||
preferBinary = false; | ||
} else if (opts.mode === "allow-wrong-content-type") { | ||
// If streaming is more important than preserving the 'content-type' header | ||
preferBinary = !capability.overrideMimeType; | ||
} else if (!opts.mode || opts.mode === "default" || opts.mode === "prefer-fast") { | ||
// Use binary if text streaming may corrupt data or the content-type header, or for speed | ||
preferBinary = true; | ||
} else { | ||
throw new Error("Invalid value for opts.mode"); | ||
} | ||
self._mode = decideMode(preferBinary, useFetch); | ||
self._fetchTimer = null; | ||
self._socketTimeout = null; | ||
self._socketTimer = null; | ||
self.on("finish", function () { | ||
self._onFinish(); | ||
}); | ||
}; | ||
inherits(ClientRequest, stream.Writable); | ||
ClientRequest.prototype.setHeader = function (name, value) { | ||
var self = this || _global$1; | ||
var lowerName = name.toLowerCase(); // This check is not necessary, but it prevents warnings from browsers about setting unsafe | ||
// headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but | ||
// http-browserify did it, so I will too. | ||
if (unsafeHeaders.indexOf(lowerName) !== -1) return; | ||
self._headers[lowerName] = { | ||
name: name, | ||
value: value | ||
}; | ||
}; | ||
ClientRequest.prototype.getHeader = function (name) { | ||
var header = (this || _global$1)._headers[name.toLowerCase()]; | ||
if (header) return header.value; | ||
return null; | ||
}; | ||
ClientRequest.prototype.removeHeader = function (name) { | ||
var self = this || _global$1; | ||
delete self._headers[name.toLowerCase()]; | ||
}; | ||
ClientRequest.prototype._onFinish = function () { | ||
var self = this || _global$1; | ||
if (self._destroyed) return; | ||
var opts = self._opts; | ||
if ("timeout" in opts && opts.timeout !== 0) { | ||
self.setTimeout(opts.timeout); | ||
} | ||
var headersObj = self._headers; | ||
var body = null; | ||
if (opts.method !== "GET" && opts.method !== "HEAD") { | ||
body = new Blob(self._body, { | ||
type: (headersObj["content-type"] || {}).value || "" | ||
}); | ||
} // create flattened list of headers | ||
var headersList = []; | ||
Object.keys(headersObj).forEach(function (keyName) { | ||
var name = headersObj[keyName].name; | ||
var value = headersObj[keyName].value; | ||
if (Array.isArray(value)) { | ||
value.forEach(function (v) { | ||
headersList.push([name, v]); | ||
}); | ||
} else { | ||
headersList.push([name, value]); | ||
} | ||
}); | ||
if (self._mode === "fetch") { | ||
var signal = null; | ||
if (capability.abortController) { | ||
var controller = new AbortController(); | ||
signal = controller.signal; | ||
self._fetchAbortController = controller; | ||
if ("requestTimeout" in opts && opts.requestTimeout !== 0) { | ||
self._fetchTimer = _global$1.setTimeout(function () { | ||
self.emit("requestTimeout"); | ||
if (self._fetchAbortController) self._fetchAbortController.abort(); | ||
}, opts.requestTimeout); | ||
} | ||
} | ||
_global$1.fetch(self._opts.url, { | ||
method: self._opts.method, | ||
headers: headersList, | ||
body: body || undefined, | ||
mode: "cors", | ||
credentials: opts.withCredentials ? "include" : "same-origin", | ||
signal: signal | ||
}).then(function (response) { | ||
self._fetchResponse = response; | ||
self._resetTimers(false); | ||
self._connect(); | ||
}, function (reason) { | ||
self._resetTimers(true); | ||
if (!self._destroyed) self.emit("error", reason); | ||
}); | ||
} else { | ||
var xhr = self._xhr = new _global$1.XMLHttpRequest(); | ||
try { | ||
xhr.open(self._opts.method, self._opts.url, true); | ||
} catch (err) { | ||
process$1.nextTick(function () { | ||
self.emit("error", err); | ||
}); | ||
return; | ||
} // Can't set responseType on really old browsers | ||
if ("responseType" in xhr) xhr.responseType = self._mode; | ||
if ("withCredentials" in xhr) xhr.withCredentials = !!opts.withCredentials; | ||
if (self._mode === "text" && "overrideMimeType" in xhr) xhr.overrideMimeType("text/plain; charset=x-user-defined"); | ||
if ("requestTimeout" in opts) { | ||
xhr.timeout = opts.requestTimeout; | ||
xhr.ontimeout = function () { | ||
self.emit("requestTimeout"); | ||
}; | ||
} | ||
headersList.forEach(function (header) { | ||
xhr.setRequestHeader(header[0], header[1]); | ||
}); | ||
self._response = null; | ||
xhr.onreadystatechange = function () { | ||
switch (xhr.readyState) { | ||
case rStates.LOADING: | ||
case rStates.DONE: | ||
self._onXHRProgress(); | ||
break; | ||
} | ||
}; // Necessary for streaming in Firefox, since xhr.response is ONLY defined | ||
// in onprogress, not in onreadystatechange with xhr.readyState = 3 | ||
if (self._mode === "moz-chunked-arraybuffer") { | ||
xhr.onprogress = function () { | ||
self._onXHRProgress(); | ||
}; | ||
} | ||
xhr.onerror = function () { | ||
if (self._destroyed) return; | ||
self._resetTimers(true); | ||
self.emit("error", new Error("XHR error")); | ||
}; | ||
try { | ||
xhr.send(body); | ||
} catch (err) { | ||
process$1.nextTick(function () { | ||
self.emit("error", err); | ||
}); | ||
return; | ||
} | ||
} | ||
}; | ||
/** | ||
* Checks if xhr.status is readable and non-zero, indicating no error. | ||
* Even though the spec says it should be available in readyState 3, | ||
* accessing it throws an exception in IE8 | ||
*/ | ||
function statusValid(xhr) { | ||
try { | ||
var status = xhr.status; | ||
return status !== null && status !== 0; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
ClientRequest.prototype._onXHRProgress = function () { | ||
var self = this || _global$1; | ||
self._resetTimers(false); | ||
if (!statusValid(self._xhr) || self._destroyed) return; | ||
if (!self._response) self._connect(); | ||
self._response._onXHRProgress(self._resetTimers.bind(self)); | ||
}; | ||
ClientRequest.prototype._connect = function () { | ||
var self = this || _global$1; | ||
if (self._destroyed) return; | ||
self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._resetTimers.bind(self)); | ||
self._response.on("error", function (err) { | ||
self.emit("error", err); | ||
}); | ||
self.emit("response", self._response); | ||
}; | ||
ClientRequest.prototype._write = function (chunk, encoding, cb) { | ||
var self = this || _global$1; | ||
self._body.push(chunk); | ||
cb(); | ||
}; | ||
ClientRequest.prototype._resetTimers = function (done) { | ||
var self = this || _global$1; | ||
_global$1.clearTimeout(self._socketTimer); | ||
self._socketTimer = null; | ||
if (done) { | ||
_global$1.clearTimeout(self._fetchTimer); | ||
self._fetchTimer = null; | ||
} else if (self._socketTimeout) { | ||
self._socketTimer = _global$1.setTimeout(function () { | ||
self.emit("timeout"); | ||
}, self._socketTimeout); | ||
} | ||
}; | ||
ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function (err) { | ||
var self = this || _global$1; | ||
self._destroyed = true; | ||
self._resetTimers(true); | ||
if (self._response) self._response._destroyed = true; | ||
if (self._xhr) self._xhr.abort();else if (self._fetchAbortController) self._fetchAbortController.abort(); | ||
if (err) self.emit("error", err); | ||
}; | ||
ClientRequest.prototype.end = function (data, encoding, cb) { | ||
var self = this || _global$1; | ||
if (typeof data === "function") { | ||
cb = data; | ||
data = undefined; | ||
} | ||
stream.Writable.prototype.end.call(self, data, encoding, cb); | ||
}; | ||
ClientRequest.prototype.setTimeout = function (timeout, cb) { | ||
var self = this || _global$1; | ||
if (cb) self.once("timeout", cb); | ||
self._socketTimeout = timeout; | ||
self._resetTimers(false); | ||
}; | ||
ClientRequest.prototype.flushHeaders = function () {}; | ||
ClientRequest.prototype.setNoDelay = function () {}; | ||
ClientRequest.prototype.setSocketKeepAlive = function () {}; // Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method | ||
var unsafeHeaders = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"]; | ||
return exports$4; | ||
} | ||
var exports$3 = {}, | ||
_dewExec$2 = false; | ||
function dew$2() { | ||
if (_dewExec$2) return exports$3; | ||
_dewExec$2 = true; | ||
exports$3 = extend; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
function extend() { | ||
var target = {}; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
} | ||
return exports$3; | ||
} | ||
var exports$2 = {}, | ||
_dewExec$1 = false; | ||
function dew$1() { | ||
if (_dewExec$1) return exports$2; | ||
_dewExec$1 = true; | ||
exports$2 = { | ||
"100": "Continue", | ||
"101": "Switching Protocols", | ||
"102": "Processing", | ||
"200": "OK", | ||
"201": "Created", | ||
"202": "Accepted", | ||
"203": "Non-Authoritative Information", | ||
"204": "No Content", | ||
"205": "Reset Content", | ||
"206": "Partial Content", | ||
"207": "Multi-Status", | ||
"208": "Already Reported", | ||
"226": "IM Used", | ||
"300": "Multiple Choices", | ||
"301": "Moved Permanently", | ||
"302": "Found", | ||
"303": "See Other", | ||
"304": "Not Modified", | ||
"305": "Use Proxy", | ||
"307": "Temporary Redirect", | ||
"308": "Permanent Redirect", | ||
"400": "Bad Request", | ||
"401": "Unauthorized", | ||
"402": "Payment Required", | ||
"403": "Forbidden", | ||
"404": "Not Found", | ||
"405": "Method Not Allowed", | ||
"406": "Not Acceptable", | ||
"407": "Proxy Authentication Required", | ||
"408": "Request Timeout", | ||
"409": "Conflict", | ||
"410": "Gone", | ||
"411": "Length Required", | ||
"412": "Precondition Failed", | ||
"413": "Payload Too Large", | ||
"414": "URI Too Long", | ||
"415": "Unsupported Media Type", | ||
"416": "Range Not Satisfiable", | ||
"417": "Expectation Failed", | ||
"418": "I'm a teapot", | ||
"421": "Misdirected Request", | ||
"422": "Unprocessable Entity", | ||
"423": "Locked", | ||
"424": "Failed Dependency", | ||
"425": "Unordered Collection", | ||
"426": "Upgrade Required", | ||
"428": "Precondition Required", | ||
"429": "Too Many Requests", | ||
"431": "Request Header Fields Too Large", | ||
"451": "Unavailable For Legal Reasons", | ||
"500": "Internal Server Error", | ||
"501": "Not Implemented", | ||
"502": "Bad Gateway", | ||
"503": "Service Unavailable", | ||
"504": "Gateway Timeout", | ||
"505": "HTTP Version Not Supported", | ||
"506": "Variant Also Negotiates", | ||
"507": "Insufficient Storage", | ||
"508": "Loop Detected", | ||
"509": "Bandwidth Limit Exceeded", | ||
"510": "Not Extended", | ||
"511": "Network Authentication Required" | ||
}; | ||
return exports$2; | ||
} | ||
var exports$1$1 = {}, | ||
_dewExec$6 = false; | ||
var _global$4 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$6() { | ||
if (_dewExec$6) return exports$1$1; | ||
_dewExec$6 = true; | ||
var ClientRequest = dew$3(); | ||
var response = dew$4(); | ||
var extend = dew$2(); | ||
var statusCodes = dew$1(); | ||
var url = h; | ||
var http = exports$1$1; | ||
http.request = function (opts, cb) { | ||
if (typeof opts === "string") opts = url.parse(opts);else opts = extend(opts); // Normally, the page is loaded from http or https, so not specifying a protocol | ||
// will result in a (valid) protocol-relative url. However, this won't work if | ||
// the protocol is something else, like 'file:' | ||
var defaultProtocol = _global$4.location.protocol.search(/^https?:$/) === -1 ? "http:" : ""; | ||
var protocol = opts.protocol || defaultProtocol; | ||
var host = opts.hostname || opts.host; | ||
var port = opts.port; | ||
var path = opts.path || "/"; // Necessary for IPv6 addresses | ||
if (host && host.indexOf(":") !== -1) host = "[" + host + "]"; // This may be a relative url. The browser should always be able to interpret it correctly. | ||
opts.url = (host ? protocol + "//" + host : "") + (port ? ":" + port : "") + path; | ||
opts.method = (opts.method || "GET").toUpperCase(); | ||
opts.headers = opts.headers || {}; // Also valid opts.auth, opts.mode | ||
var req = new ClientRequest(opts); | ||
if (cb) req.on("response", cb); | ||
return req; | ||
}; | ||
http.get = function get(opts, cb) { | ||
var req = http.request(opts, cb); | ||
req.end(); | ||
return req; | ||
}; | ||
http.ClientRequest = ClientRequest; | ||
http.IncomingMessage = response.IncomingMessage; | ||
http.Agent = function () {}; | ||
http.Agent.defaultMaxSockets = 4; | ||
http.globalAgent = new http.Agent(); | ||
http.STATUS_CODES = statusCodes; | ||
http.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"]; | ||
return exports$1$1; | ||
} | ||
const exports$7 = dew$6(); | ||
exports$7.Agent; | ||
exports$7.ClientRequest; | ||
exports$7.IncomingMessage; | ||
exports$7.METHODS; | ||
exports$7.STATUS_CODES; | ||
exports$7.get; | ||
exports$7.globalAgent; | ||
exports$7.request; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
var _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
var http = exports$2; | ||
var http = exports$7; | ||
var url = h; | ||
var https = exports$1; | ||
for (var key in http) { | ||
if (http.hasOwnProperty(key)) https[key] = http[key]; | ||
} | ||
https.request = function (params, cb) { | ||
@@ -35,3 +843,2 @@ params = validateParams(params); | ||
}; | ||
https.get = function (params, cb) { | ||
@@ -41,3 +848,2 @@ params = validateParams(params); | ||
}; | ||
function validateParams(params) { | ||
@@ -47,14 +853,10 @@ if (typeof params === "string") { | ||
} | ||
if (!params.protocol) { | ||
params.protocol = "https:"; | ||
} | ||
if (params.protocol !== "https:") { | ||
throw new Error("Protocol \"" + params.protocol + "\" not supported. Expected \"https:\""); | ||
} | ||
return params; | ||
} | ||
return exports$1; | ||
@@ -61,0 +863,0 @@ } |
import { uptime } from './process.js'; | ||
export { uptime } from './process.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
exports$1.endianness = function () { | ||
return "LE"; | ||
}; | ||
exports$1.hostname = function () { | ||
@@ -19,27 +16,20 @@ if (typeof location !== "undefined") { | ||
}; | ||
exports$1.loadavg = function () { | ||
return []; | ||
}; | ||
exports$1.uptime = function () { | ||
return 0; | ||
}; | ||
exports$1.freemem = function () { | ||
return Number.MAX_VALUE; | ||
}; | ||
exports$1.totalmem = function () { | ||
return Number.MAX_VALUE; | ||
}; | ||
exports$1.cpus = function () { | ||
return []; | ||
}; | ||
exports$1.type = function () { | ||
return "Browser"; | ||
}; | ||
exports$1.release = function () { | ||
@@ -49,28 +39,20 @@ if (typeof navigator !== "undefined") { | ||
} | ||
return ""; | ||
}; | ||
exports$1.networkInterfaces = exports$1.getNetworkInterfaces = function () { | ||
return {}; | ||
}; | ||
exports$1.arch = function () { | ||
return "javascript"; | ||
}; | ||
exports$1.platform = function () { | ||
return "browser"; | ||
}; | ||
exports$1.tmpdir = exports$1.tmpDir = function () { | ||
return "/tmp"; | ||
}; | ||
exports$1.EOL = "\n"; | ||
exports$1.homedir = function () { | ||
return "/"; | ||
}; | ||
return exports$1; | ||
@@ -114,2 +96,2 @@ } | ||
export { EOL, arch, constants, cpus, exports as default, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, version }; | ||
export { EOL, arch, constants, cpus, exports as default, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, uptime, version }; |
@@ -1,4 +0,3 @@ | ||
import { e as exports } from './chunk-23dbec7b.js'; | ||
export { e as default } from './chunk-23dbec7b.js'; | ||
import './chunk-2eac56ff.js'; | ||
import { e as exports } from './chunk-BlJi4mNy.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
@@ -21,2 +20,2 @@ var _makeLong = exports._makeLong; | ||
export { _makeLong, basename, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, posix, relative, resolve, sep, win32 }; | ||
export { _makeLong, basename, exports as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, posix, relative, resolve, sep, win32 }; |
import { posix as posix$1 } from '../path.js'; | ||
export { posix } from '../path.js'; | ||
import '../chunk-23dbec7b.js'; | ||
import '../chunk-2eac56ff.js'; | ||
import '../chunk-BlJi4mNy.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
@@ -41,2 +40,2 @@ const { | ||
export { _makeLong, basename, posix as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, relative, resolve, sep, win32 }; | ||
export { _makeLong, basename, posix as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, posix$1 as posix, relative, resolve, sep, win32 }; |
import { posix } from '../path.js'; | ||
export { posix } from '../path.js'; | ||
import '../chunk-23dbec7b.js'; | ||
import '../chunk-2eac56ff.js'; | ||
import '../chunk-BlJi4mNy.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
@@ -28,2 +27,2 @@ function unimplemented () { | ||
export { unimplemented as _makeLong, unimplemented as basename, win32 as default, unimplemented as delimiter, unimplemented as dirname, unimplemented as extname, unimplemented as format, unimplemented as isAbsolute, unimplemented as join, unimplemented as normalize, unimplemented as parse, unimplemented as relative, unimplemented as resolve, unimplemented as sep, win32 }; | ||
export { unimplemented as _makeLong, unimplemented as basename, win32 as default, unimplemented as delimiter, unimplemented as dirname, unimplemented as extname, unimplemented as format, unimplemented as isAbsolute, unimplemented as join, unimplemented as normalize, unimplemented as parse, posix, unimplemented as relative, unimplemented as resolve, unimplemented as sep, win32 }; |
@@ -67,3 +67,3 @@ var queue = []; | ||
PATH: '/usr/bin', | ||
LANG: navigator.language + '.UTF-8', | ||
LANG: typeof navigator !== 'undefined' ? navigator.language + '.UTF-8' : undefined, | ||
PWD: '/', | ||
@@ -98,2 +98,3 @@ HOME: '/home', | ||
var browser = true; | ||
var _rawDebug = noop; | ||
@@ -207,2 +208,3 @@ var moduleLoadList = []; | ||
platform, | ||
browser, | ||
release, | ||
@@ -275,2 +277,2 @@ _rawDebug, | ||
export { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions }; | ||
export { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, browser, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions }; |
@@ -70,3 +70,3 @@ function unimplemented(name) { | ||
PATH: '/usr/bin', | ||
LANG: navigator.language + '.UTF-8', | ||
LANG: typeof navigator !== 'undefined' ? navigator.language + '.UTF-8' : undefined, | ||
PWD: '/', | ||
@@ -101,2 +101,3 @@ HOME: '/home', | ||
var browser = true; | ||
var _rawDebug = noop; | ||
@@ -210,2 +211,3 @@ var moduleLoadList = []; | ||
platform, | ||
browser, | ||
release, | ||
@@ -278,2 +280,2 @@ _rawDebug, | ||
export { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions }; | ||
export { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, browser, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions }; |
@@ -1,18 +0,436 @@ | ||
import { p } from './chunk-924bb2e1.js'; | ||
export { p as default } from './chunk-924bb2e1.js'; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
/** Highest positive signed 32-bit float value */ | ||
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 | ||
p.decode; | ||
p.encode; | ||
p.toASCII; | ||
p.toUnicode; | ||
p.ucs2; | ||
p.version; | ||
/** Bootstring parameters */ | ||
const base = 36; | ||
const tMin = 1; | ||
const tMax = 26; | ||
const skew = 38; | ||
const damp = 700; | ||
const initialBias = 72; | ||
const initialN = 128; // 0x80 | ||
const delimiter = "-"; // '\x2D' | ||
var decode = p.decode; | ||
var encode = p.encode; | ||
var toASCII = p.toASCII; | ||
var toUnicode = p.toUnicode; | ||
var ucs2 = p.ucs2; | ||
var version = p.version; | ||
/** Regular expressions */ | ||
const regexPunycode = /^xn--/; | ||
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. | ||
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators | ||
export { decode, encode, toASCII, toUnicode, ucs2, version }; | ||
/** Error messages */ | ||
const errors = { | ||
"overflow": "Overflow: input needs wider integers to process", | ||
"not-basic": "Illegal input >= 0x80 (not a basic code point)", | ||
"invalid-input": "Invalid input" | ||
}; | ||
/** Convenience shortcuts */ | ||
const baseMinusTMin = base - tMin; | ||
const floor = Math.floor; | ||
const stringFromCharCode = String.fromCharCode; | ||
/*--------------------------------------------------------------------------*/ | ||
/** | ||
* A generic error utility function. | ||
* @private | ||
* @param {String} type The error type. | ||
* @returns {Error} Throws a `RangeError` with the applicable error message. | ||
*/ | ||
function error(type) { | ||
throw new RangeError(errors[type]); | ||
} | ||
/** | ||
* A generic `Array#map` utility function. | ||
* @private | ||
* @param {Array} array The array to iterate over. | ||
* @param {Function} callback The function that gets called for every array | ||
* item. | ||
* @returns {Array} A new array of values returned by the callback function. | ||
*/ | ||
function map(array, callback) { | ||
const result = []; | ||
let length = array.length; | ||
while (length--) { | ||
result[length] = callback(array[length]); | ||
} | ||
return result; | ||
} | ||
/** | ||
* A simple `Array#map`-like wrapper to work with domain name strings or email | ||
* addresses. | ||
* @private | ||
* @param {String} domain The domain name or email address. | ||
* @param {Function} callback The function that gets called for every | ||
* character. | ||
* @returns {String} A new string of characters returned by the callback | ||
* function. | ||
*/ | ||
function mapDomain(domain, callback) { | ||
const parts = domain.split("@"); | ||
let result = ""; | ||
if (parts.length > 1) { | ||
// In email addresses, only the domain name should be punycoded. Leave | ||
// the local part (i.e. everything up to `@`) intact. | ||
result = parts[0] + "@"; | ||
domain = parts[1]; | ||
} | ||
// Avoid `split(regex)` for IE8 compatibility. See #17. | ||
domain = domain.replace(regexSeparators, "."); | ||
const labels = domain.split("."); | ||
const encoded = map(labels, callback).join("."); | ||
return result + encoded; | ||
} | ||
/** | ||
* Creates an array containing the numeric code points of each Unicode | ||
* character in the string. While JavaScript uses UCS-2 internally, | ||
* this function will convert a pair of surrogate halves (each of which | ||
* UCS-2 exposes as separate characters) into a single code point, | ||
* matching UTF-16. | ||
* @see `punycode.ucs2.encode` | ||
* @see <https://mathiasbynens.be/notes/javascript-encoding> | ||
* @memberOf punycode.ucs2 | ||
* @name decode | ||
* @param {String} string The Unicode input string (UCS-2). | ||
* @returns {Array} The new array of code points. | ||
*/ | ||
function ucs2decode(string) { | ||
const output = []; | ||
let counter = 0; | ||
const length = string.length; | ||
while (counter < length) { | ||
const value = string.charCodeAt(counter++); | ||
if (value >= 55296 && value <= 56319 && counter < length) { | ||
// It's a high surrogate, and there is a next character. | ||
const extra = string.charCodeAt(counter++); | ||
if ((extra & 64512) == 56320) { | ||
// Low surrogate. | ||
output.push(((value & 1023) << 10) + (extra & 1023) + 65536); | ||
} else { | ||
// It's an unmatched surrogate; only append this code unit, in case the | ||
// next code unit is the high surrogate of a surrogate pair. | ||
output.push(value); | ||
counter--; | ||
} | ||
} else { | ||
output.push(value); | ||
} | ||
} | ||
return output; | ||
} | ||
/** | ||
* Creates a string based on an array of numeric code points. | ||
* @see `punycode.ucs2.decode` | ||
* @memberOf punycode.ucs2 | ||
* @name encode | ||
* @param {Array} codePoints The array of numeric code points. | ||
* @returns {String} The new Unicode string (UCS-2). | ||
*/ | ||
const ucs2encode = codePoints => String.fromCodePoint(...codePoints); | ||
/** | ||
* Converts a basic code point into a digit/integer. | ||
* @see `digitToBasic()` | ||
* @private | ||
* @param {Number} codePoint The basic numeric code point value. | ||
* @returns {Number} The numeric value of a basic code point (for use in | ||
* representing integers) in the range `0` to `base - 1`, or `base` if | ||
* the code point does not represent a value. | ||
*/ | ||
const basicToDigit = function (codePoint) { | ||
if (codePoint >= 48 && codePoint < 58) { | ||
return 26 + (codePoint - 48); | ||
} | ||
if (codePoint >= 65 && codePoint < 91) { | ||
return codePoint - 65; | ||
} | ||
if (codePoint >= 97 && codePoint < 123) { | ||
return codePoint - 97; | ||
} | ||
return base; | ||
}; | ||
/** | ||
* Converts a digit/integer into a basic code point. | ||
* @see `basicToDigit()` | ||
* @private | ||
* @param {Number} digit The numeric value of a basic code point. | ||
* @returns {Number} The basic code point whose value (when used for | ||
* representing integers) is `digit`, which needs to be in the range | ||
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is | ||
* used; else, the lowercase form is used. The behavior is undefined | ||
* if `flag` is non-zero and `digit` has no uppercase form. | ||
*/ | ||
const digitToBasic = function (digit, flag) { | ||
// 0..25 map to ASCII a..z or A..Z | ||
// 26..35 map to ASCII 0..9 | ||
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); | ||
}; | ||
/** | ||
* Bias adaptation function as per section 3.4 of RFC 3492. | ||
* https://tools.ietf.org/html/rfc3492#section-3.4 | ||
* @private | ||
*/ | ||
const adapt = function (delta, numPoints, firstTime) { | ||
let k = 0; | ||
delta = firstTime ? floor(delta / damp) : delta >> 1; | ||
delta += floor(delta / numPoints); | ||
for /* no initialization */ | ||
(; delta > baseMinusTMin * tMax >> 1; k += base) { | ||
delta = floor(delta / baseMinusTMin); | ||
} | ||
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); | ||
}; | ||
/** | ||
* Converts a Punycode string of ASCII-only symbols to a string of Unicode | ||
* symbols. | ||
* @memberOf punycode | ||
* @param {String} input The Punycode string of ASCII-only symbols. | ||
* @returns {String} The resulting string of Unicode symbols. | ||
*/ | ||
const decode = function (input) { | ||
// Don't use UCS-2. | ||
const output = []; | ||
const inputLength = input.length; | ||
let i = 0; | ||
let n = initialN; | ||
let bias = initialBias; | ||
// Handle the basic code points: let `basic` be the number of input code | ||
// points before the last delimiter, or `0` if there is none, then copy | ||
// the first basic code points to the output. | ||
let basic = input.lastIndexOf(delimiter); | ||
if (basic < 0) { | ||
basic = 0; | ||
} | ||
for (let j = 0; j < basic; ++j) { | ||
// if it's not a basic code point | ||
if (input.charCodeAt(j) >= 128) { | ||
error("not-basic"); | ||
} | ||
output.push(input.charCodeAt(j)); | ||
} | ||
// Main decoding loop: start just after the last delimiter if any basic code | ||
// points were copied; start at the beginning otherwise. | ||
for /* no final expression */ | ||
(let index = basic > 0 ? basic + 1 : 0; index < inputLength;) { | ||
// `index` is the index of the next character to be consumed. | ||
// Decode a generalized variable-length integer into `delta`, | ||
// which gets added to `i`. The overflow checking is easier | ||
// if we increase `i` as we go, then subtract off its starting | ||
// value at the end to obtain `delta`. | ||
const oldi = i; | ||
for /* no condition */ | ||
(let w = 1, k = base;; k += base) { | ||
if (index >= inputLength) { | ||
error("invalid-input"); | ||
} | ||
const digit = basicToDigit(input.charCodeAt(index++)); | ||
if (digit >= base) { | ||
error("invalid-input"); | ||
} | ||
if (digit > floor((maxInt - i) / w)) { | ||
error("overflow"); | ||
} | ||
i += digit * w; | ||
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; | ||
if (digit < t) { | ||
break; | ||
} | ||
const baseMinusT = base - t; | ||
if (w > floor(maxInt / baseMinusT)) { | ||
error("overflow"); | ||
} | ||
w *= baseMinusT; | ||
} | ||
const out = output.length + 1; | ||
bias = adapt(i - oldi, out, oldi == 0); | ||
// `i` was supposed to wrap around from `out` to `0`, | ||
// incrementing `n` each time, so we'll fix that now: | ||
if (floor(i / out) > maxInt - n) { | ||
error("overflow"); | ||
} | ||
n += floor(i / out); | ||
i %= out; | ||
// Insert `n` at position `i` of the output. | ||
output.splice(i++, 0, n); | ||
} | ||
return String.fromCodePoint(...output); | ||
}; | ||
/** | ||
* Converts a string of Unicode symbols (e.g. a domain name label) to a | ||
* Punycode string of ASCII-only symbols. | ||
* @memberOf punycode | ||
* @param {String} input The string of Unicode symbols. | ||
* @returns {String} The resulting Punycode string of ASCII-only symbols. | ||
*/ | ||
const encode = function (input) { | ||
const output = []; | ||
// Convert the input in UCS-2 to an array of Unicode code points. | ||
input = ucs2decode(input); | ||
// Cache the length. | ||
const inputLength = input.length; | ||
// Initialize the state. | ||
let n = initialN; | ||
let delta = 0; | ||
let bias = initialBias; | ||
// Handle the basic code points. | ||
for (const currentValue of input) { | ||
if (currentValue < 128) { | ||
output.push(stringFromCharCode(currentValue)); | ||
} | ||
} | ||
const basicLength = output.length; | ||
let handledCPCount = basicLength; | ||
// `handledCPCount` is the number of code points that have been handled; | ||
// `basicLength` is the number of basic code points. | ||
// Finish the basic string with a delimiter unless it's empty. | ||
if (basicLength) { | ||
output.push(delimiter); | ||
} | ||
// Main encoding loop: | ||
while (handledCPCount < inputLength) { | ||
// All non-basic code points < n have been handled already. Find the next | ||
// larger one: | ||
let m = maxInt; | ||
for (const currentValue of input) { | ||
if (currentValue >= n && currentValue < m) { | ||
m = currentValue; | ||
} | ||
} | ||
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, | ||
// but guard against overflow. | ||
const handledCPCountPlusOne = handledCPCount + 1; | ||
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { | ||
error("overflow"); | ||
} | ||
delta += (m - n) * handledCPCountPlusOne; | ||
n = m; | ||
for (const currentValue of input) { | ||
if (currentValue < n && ++delta > maxInt) { | ||
error("overflow"); | ||
} | ||
if (currentValue === n) { | ||
// Represent delta as a generalized variable-length integer. | ||
let q = delta; | ||
for /* no condition */ | ||
(let k = base;; k += base) { | ||
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; | ||
if (q < t) { | ||
break; | ||
} | ||
const qMinusT = q - t; | ||
const baseMinusT = base - t; | ||
output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); | ||
q = floor(qMinusT / baseMinusT); | ||
} | ||
output.push(stringFromCharCode(digitToBasic(q, 0))); | ||
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); | ||
delta = 0; | ||
++handledCPCount; | ||
} | ||
} | ||
++delta; | ||
++n; | ||
} | ||
return output.join(""); | ||
}; | ||
/** | ||
* Converts a Punycode string representing a domain name or an email address | ||
* to Unicode. Only the Punycoded parts of the input will be converted, i.e. | ||
* it doesn't matter if you call it on a string that has already been | ||
* converted to Unicode. | ||
* @memberOf punycode | ||
* @param {String} input The Punycoded domain name or email address to | ||
* convert to Unicode. | ||
* @returns {String} The Unicode representation of the given Punycode | ||
* string. | ||
*/ | ||
const toUnicode = function (input) { | ||
return mapDomain(input, function (string) { | ||
return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; | ||
}); | ||
}; | ||
/** | ||
* Converts a Unicode string representing a domain name or an email address to | ||
* Punycode. Only the non-ASCII parts of the domain name will be converted, | ||
* i.e. it doesn't matter if you call it with a domain that's already in | ||
* ASCII. | ||
* @memberOf punycode | ||
* @param {String} input The domain name or email address to convert, as a | ||
* Unicode string. | ||
* @returns {String} The Punycode representation of the given domain name or | ||
* email address. | ||
*/ | ||
const toASCII = function (input) { | ||
return mapDomain(input, function (string) { | ||
return regexNonASCII.test(string) ? "xn--" + encode(string) : string; | ||
}); | ||
}; | ||
/*--------------------------------------------------------------------------*/ | ||
/** Define the public API */ | ||
const punycode = { | ||
/** | ||
* A string representing the current Punycode.js version number. | ||
* @memberOf punycode | ||
* @type String | ||
*/ | ||
"version": "2.3.1", | ||
/** | ||
* An object of methods to convert from JavaScript's internal character | ||
* representation (UCS-2) to Unicode code points, and back. | ||
* @see <https://mathiasbynens.be/notes/javascript-encoding> | ||
* @memberOf punycode | ||
* @type Object | ||
*/ | ||
"ucs2": { | ||
"decode": ucs2decode, | ||
"encode": ucs2encode | ||
}, | ||
"decode": decode, | ||
"encode": encode, | ||
"toASCII": toASCII, | ||
"toUnicode": toUnicode | ||
}; | ||
exports$1 = punycode; | ||
return exports$1; | ||
} | ||
const exports = dew(); | ||
var decode = exports.decode; | ||
var encode = exports.encode; | ||
var toASCII = exports.toASCII; | ||
var toUnicode = exports.toUnicode; | ||
var ucs2 = exports.ucs2; | ||
var version = exports.version; | ||
export { decode, exports as default, encode, toASCII, toUnicode, ucs2, version }; |
@@ -1,14 +0,118 @@ | ||
import { o } from './chunk-b04e620d.js'; | ||
export { o as default } from './chunk-b04e620d.js'; | ||
var exports$3 = {}, | ||
_dewExec$2 = false; | ||
function dew$2() { | ||
if (_dewExec$2) return exports$3; | ||
_dewExec$2 = true; | ||
// If obj.hasOwnProperty has been overridden, then calling | ||
// obj.hasOwnProperty(prop) will break. | ||
// See: https://github.com/joyent/node/issues/1707 | ||
function hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} | ||
exports$3 = function (qs, sep, eq, options) { | ||
sep = sep || "&"; | ||
eq = eq || "="; | ||
var obj = {}; | ||
if (typeof qs !== "string" || qs.length === 0) { | ||
return obj; | ||
} | ||
var regexp = /\+/g; | ||
qs = qs.split(sep); | ||
var maxKeys = 1000; | ||
if (options && typeof options.maxKeys === "number") { | ||
maxKeys = options.maxKeys; | ||
} | ||
var len = qs.length; | ||
// maxKeys <= 0 means that we should not limit keys count | ||
if (maxKeys > 0 && len > maxKeys) { | ||
len = maxKeys; | ||
} | ||
for (var i = 0; i < len; ++i) { | ||
var x = qs[i].replace(regexp, "%20"), | ||
idx = x.indexOf(eq), | ||
kstr, | ||
vstr, | ||
k, | ||
v; | ||
if (idx >= 0) { | ||
kstr = x.substr(0, idx); | ||
vstr = x.substr(idx + 1); | ||
} else { | ||
kstr = x; | ||
vstr = ""; | ||
} | ||
k = decodeURIComponent(kstr); | ||
v = decodeURIComponent(vstr); | ||
if (!hasOwnProperty(obj, k)) { | ||
obj[k] = v; | ||
} else if (Array.isArray(obj[k])) { | ||
obj[k].push(v); | ||
} else { | ||
obj[k] = [obj[k], v]; | ||
} | ||
} | ||
return obj; | ||
}; | ||
return exports$3; | ||
} | ||
o.decode; | ||
o.encode; | ||
o.parse; | ||
o.stringify; | ||
var exports$2 = {}, | ||
_dewExec$1 = false; | ||
function dew$1() { | ||
if (_dewExec$1) return exports$2; | ||
_dewExec$1 = true; | ||
var stringifyPrimitive = function (v) { | ||
switch (typeof v) { | ||
case "string": | ||
return v; | ||
case "boolean": | ||
return v ? "true" : "false"; | ||
case "number": | ||
return isFinite(v) ? v : ""; | ||
default: | ||
return ""; | ||
} | ||
}; | ||
exports$2 = function (obj, sep, eq, name) { | ||
sep = sep || "&"; | ||
eq = eq || "="; | ||
if (obj === null) { | ||
obj = undefined; | ||
} | ||
if (typeof obj === "object") { | ||
return Object.keys(obj).map(function (k) { | ||
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; | ||
if (Array.isArray(obj[k])) { | ||
return obj[k].map(function (v) { | ||
return ks + encodeURIComponent(stringifyPrimitive(v)); | ||
}).join(sep); | ||
} else { | ||
return ks + encodeURIComponent(stringifyPrimitive(obj[k])); | ||
} | ||
}).filter(Boolean).join(sep); | ||
} | ||
if (!name) return ""; | ||
return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); | ||
}; | ||
return exports$2; | ||
} | ||
var decode = o.decode; | ||
var encode = o.encode; | ||
var parse = o.parse; | ||
var stringify = o.stringify; | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
exports$1.decode = exports$1.parse = dew$2(); | ||
exports$1.encode = exports$1.stringify = dew$1(); | ||
return exports$1; | ||
} | ||
export { decode, encode, parse, stringify }; | ||
const exports = dew(); | ||
exports['decode']; exports['parse']; exports['encode']; exports['stringify']; | ||
var decode = exports.decode; | ||
var encode = exports.encode; | ||
var parse = exports.parse; | ||
var stringify = exports.stringify; | ||
export { decode, exports as default, encode, parse, stringify }; |
import { promises } from '../stream.js'; | ||
export { promises as default } from '../stream.js'; | ||
import '../chunk-6c718bbe.js'; | ||
import '../chunk-DtuTasat.js'; | ||
import '../events.js'; | ||
import '../chunk-4bd36a8f.js'; | ||
import '../chunk-44e51b61.js'; | ||
import '../chunk-ce0fbc82.js'; | ||
import '../chunk-b4205b57.js'; | ||
import '../chunk-5decc758.js'; | ||
import '../chunk-2eac56ff.js'; | ||
import '../chunk-4ccc3a29.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
import '../chunk-CcCWfKp1.js'; | ||
import '../util.js'; | ||
import '../chunk-DtcTpLWz.js'; | ||
import '../chunk-CkFCi-G1.js'; | ||
const { finished, pipeline } = promises; | ||
export { finished, pipeline }; | ||
export { promises as default, finished, pipeline }; |
@@ -1,6 +0,2 @@ | ||
import { a as e$1 } from './chunk-4ccc3a29.js'; | ||
export { a as default } from './chunk-4ccc3a29.js'; | ||
var StringDecoder = e$1.StringDecoder; | ||
export { StringDecoder }; | ||
export { S as StringDecoder, e as default } from './chunk-CcCWfKp1.js'; | ||
import './chunk-DtuTasat.js'; |
@@ -1,4 +0,9 @@ | ||
export { T as TextDecoder, a as TextEncoder, _ as _extend, c as callbackify, d as debuglog, b as deprecate, f as format, i as inherits, e as inspect, g as isArray, h as isBoolean, j as isBuffer, k as isDate, l as isError, m as isFunction, n as isNull, o as isNullOrUndefined, q as isNumber, r as isObject, s as isPrimitive, t as isRegExp, u as isString, v as isSymbol, w as isUndefined, x as log, p as promisify, y as types } from './chunk-ce0fbc82.js'; | ||
import { X } from './chunk-b4205b57.js'; | ||
export { X as default } from './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import exports from './util.js'; | ||
export { TextDecoder, TextEncoder, _extend, callbackify, debuglog, deprecate, format, inherits, inspect, isArray, isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined, log, promisify, types } from './util.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-CkFCi-G1.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
export { exports as default }; |
@@ -1,8 +0,6 @@ | ||
import { p as process } from './chunk-2eac56ff.js'; | ||
import { p as process } from './chunk-DEMDiNwt.js'; | ||
var exports$2 = {}, | ||
_dewExec$1 = false; | ||
_dewExec$1 = false; | ||
var _global$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$1() { | ||
@@ -12,3 +10,2 @@ if (_dewExec$1) return exports$2; | ||
var process$1 = process; | ||
(function (global, undefined$1) { | ||
@@ -19,5 +16,3 @@ | ||
} | ||
var nextHandle = 1; // Spec says greater than zero | ||
var tasksByHandle = {}; | ||
@@ -27,3 +22,2 @@ var currentlyRunningATask = false; | ||
var registerImmediate; | ||
function setImmediate(callback) { | ||
@@ -33,12 +27,9 @@ // Callback can either be a function or a string | ||
callback = new Function("" + callback); | ||
} // Copy function arguments | ||
} | ||
// Copy function arguments | ||
var args = new Array(arguments.length - 1); | ||
for (var i = 0; i < args.length; i++) { | ||
args[i] = arguments[i + 1]; | ||
} // Store and register the task | ||
} | ||
// Store and register the task | ||
var task = { | ||
@@ -52,11 +43,8 @@ callback: callback, | ||
} | ||
function clearImmediate(handle) { | ||
delete tasksByHandle[handle]; | ||
} | ||
function run(task) { | ||
var callback = task.callback; | ||
var args = task.args; | ||
switch (args.length) { | ||
@@ -66,15 +54,11 @@ case 0: | ||
break; | ||
case 1: | ||
callback(args[0]); | ||
break; | ||
case 2: | ||
callback(args[0], args[1]); | ||
break; | ||
case 3: | ||
callback(args[0], args[1], args[2]); | ||
break; | ||
default: | ||
@@ -85,3 +69,2 @@ callback.apply(undefined$1, args); | ||
} | ||
function runIfPresent(handle) { | ||
@@ -96,6 +79,4 @@ // From the spec: "Wait until any invocations of this algorithm started before this one have completed." | ||
var task = tasksByHandle[handle]; | ||
if (task) { | ||
currentlyRunningATask = true; | ||
try { | ||
@@ -110,3 +91,2 @@ run(task); | ||
} | ||
function installNextTickImplementation() { | ||
@@ -119,3 +99,2 @@ registerImmediate = function (handle) { | ||
} | ||
function canUsePostMessage() { | ||
@@ -127,7 +106,5 @@ // The test against `importScripts` prevents this implementation from being installed inside a web worker, | ||
var oldOnMessage = global.onmessage; | ||
global.onmessage = function () { | ||
postMessageIsAsynchronous = false; | ||
}; | ||
global.postMessage("", "*"); | ||
@@ -138,3 +115,2 @@ global.onmessage = oldOnMessage; | ||
} | ||
function installPostMessageImplementation() { | ||
@@ -144,4 +120,4 @@ // Installs an event handler on `global` for the `message` event: see | ||
// * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages | ||
var messagePrefix = "setImmediate$" + Math.random() + "$"; | ||
var onGlobalMessage = function (event) { | ||
@@ -152,3 +128,2 @@ if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { | ||
}; | ||
if (global.addEventListener) { | ||
@@ -159,3 +134,2 @@ global.addEventListener("message", onGlobalMessage, false); | ||
} | ||
registerImmediate = function (handle) { | ||
@@ -165,6 +139,4 @@ global.postMessage(messagePrefix + handle, "*"); | ||
} | ||
function installMessageChannelImplementation() { | ||
var channel = new MessageChannel(); | ||
channel.port1.onmessage = function (event) { | ||
@@ -174,3 +146,2 @@ var handle = event.data; | ||
}; | ||
registerImmediate = function (handle) { | ||
@@ -180,6 +151,4 @@ channel.port2.postMessage(handle); | ||
} | ||
function installReadyStateChangeImplementation() { | ||
var html = doc.documentElement; | ||
registerImmediate = function (handle) { | ||
@@ -189,3 +158,2 @@ // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted | ||
var script = doc.createElement("script"); | ||
script.onreadystatechange = function () { | ||
@@ -197,7 +165,5 @@ runIfPresent(handle); | ||
}; | ||
html.appendChild(script); | ||
}; | ||
} | ||
function installSetTimeoutImplementation() { | ||
@@ -207,8 +173,9 @@ registerImmediate = function (handle) { | ||
}; | ||
} // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. | ||
} | ||
// If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. | ||
var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); | ||
attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments. | ||
attachTo = attachTo && attachTo.setTimeout ? attachTo : global; | ||
// Don't get fooled by e.g. browserify environments. | ||
if ({}.toString.call(global.process) === "[object process]") { | ||
@@ -230,7 +197,5 @@ // For Node.js before 0.9 | ||
} | ||
attachTo.setImmediate = setImmediate; | ||
attachTo.clearImmediate = clearImmediate; | ||
})(typeof self === "undefined" ? typeof _global$1 === "undefined" ? exports$2 : _global$1 : self); | ||
return exports$2; | ||
@@ -240,6 +205,4 @@ } | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
var _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew() { | ||
@@ -249,12 +212,12 @@ if (_dewExec) return exports$1; | ||
var scope = typeof _global !== "undefined" && _global || typeof self !== "undefined" && self || window; | ||
var apply = Function.prototype.apply; // DOM APIs, for completeness | ||
var apply = Function.prototype.apply; | ||
// DOM APIs, for completeness | ||
exports$1.setTimeout = function () { | ||
return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); | ||
}; | ||
exports$1.setInterval = function () { | ||
return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); | ||
}; | ||
exports$1.clearTimeout = exports$1.clearInterval = function (timeout) { | ||
@@ -265,3 +228,2 @@ if (timeout) { | ||
}; | ||
function Timeout(id, clearFn) { | ||
@@ -271,10 +233,8 @@ (this || _global)._id = id; | ||
} | ||
Timeout.prototype.unref = Timeout.prototype.ref = function () {}; | ||
Timeout.prototype.close = function () { | ||
(this || _global)._clearFn.call(scope, (this || _global)._id); | ||
}; // Does not start the time, just sets up the members needed. | ||
}; | ||
// Does not start the time, just sets up the members needed. | ||
exports$1.enroll = function (item, msecs) { | ||
@@ -284,3 +244,2 @@ clearTimeout(item._idleTimeoutId); | ||
}; | ||
exports$1.unenroll = function (item) { | ||
@@ -290,7 +249,5 @@ clearTimeout(item._idleTimeoutId); | ||
}; | ||
exports$1._unrefActive = exports$1.active = function (item) { | ||
clearTimeout(item._idleTimeoutId); | ||
var msecs = item._idleTimeout; | ||
if (msecs >= 0) { | ||
@@ -301,10 +258,9 @@ item._idleTimeoutId = setTimeout(function onTimeout() { | ||
} | ||
}; // setimmediate attaches itself to the global object | ||
}; | ||
dew$1(); // On some exotic environments, it's not clear which object `setimmediate` was | ||
// setimmediate attaches itself to the global object | ||
dew$1(); | ||
// On some exotic environments, it's not clear which object `setimmediate` was | ||
// able to install onto. Search each possibility in the same order as the | ||
// `setimmediate` library. | ||
exports$1.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof _global !== "undefined" && _global.setImmediate || exports$1 && exports$1.setImmediate; | ||
@@ -311,0 +267,0 @@ exports$1.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof _global !== "undefined" && _global.clearImmediate || exports$1 && exports$1.clearImmediate; |
import { promisify } from '../util.js'; | ||
import exports from '../timers.js'; | ||
import '../chunk-ce0fbc82.js'; | ||
import '../chunk-b4205b57.js'; | ||
import '../chunk-5decc758.js'; | ||
import '../chunk-2eac56ff.js'; | ||
import '../chunk-DtcTpLWz.js'; | ||
import '../chunk-CkFCi-G1.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
@@ -8,0 +7,0 @@ const setTimeout = promisify(exports.setTimeout), |
@@ -15,7 +15,7 @@ function isatty () { | ||
__proto__: null, | ||
isatty: isatty, | ||
ReadStream: ReadStream, | ||
WriteStream: WriteStream | ||
WriteStream: WriteStream, | ||
isatty: isatty | ||
}); | ||
export { ReadStream, WriteStream, m as default, isatty }; |
@@ -1,35 +0,1345 @@ | ||
import './chunk-ce0fbc82.js'; | ||
import { X } from './chunk-b4205b57.js'; | ||
export { X as default } from './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import { d as dew$c, a as dew$d, e as dew$e, f as dew$f } from './chunk-DtcTpLWz.js'; | ||
import { d as dew$g } from './chunk-CkFCi-G1.js'; | ||
import { p as process } from './chunk-DEMDiNwt.js'; | ||
var _extend = X._extend; | ||
var callbackify = X.callbackify; | ||
var debuglog = X.debuglog; | ||
var deprecate = X.deprecate; | ||
var format = X.format; | ||
var inherits = X.inherits; | ||
var inspect = X.inspect; | ||
var isArray = X.isArray; | ||
var isBoolean = X.isBoolean; | ||
var isBuffer = X.isBuffer; | ||
var isDate = X.isDate; | ||
var isError = X.isError; | ||
var isFunction = X.isFunction; | ||
var isNull = X.isNull; | ||
var isNullOrUndefined = X.isNullOrUndefined; | ||
var isNumber = X.isNumber; | ||
var isObject = X.isObject; | ||
var isPrimitive = X.isPrimitive; | ||
var isRegExp = X.isRegExp; | ||
var isString = X.isString; | ||
var isSymbol = X.isSymbol; | ||
var isUndefined = X.isUndefined; | ||
var log = X.log; | ||
var promisify = X.promisify; | ||
var types = X.types; | ||
var exports$c = {}, | ||
_dewExec$b = false; | ||
function dew$b() { | ||
if (_dewExec$b) return exports$c; | ||
_dewExec$b = true; | ||
var hasSymbols = dew$c(); | ||
const TextEncoder = X.TextEncoder = globalThis.TextEncoder; | ||
const TextDecoder = X.TextDecoder = globalThis.TextDecoder; | ||
/** @type {import('.')} */ | ||
exports$c = function hasToStringTagShams() { | ||
return hasSymbols() && !!Symbol.toStringTag; | ||
}; | ||
return exports$c; | ||
} | ||
export { TextDecoder, TextEncoder, _extend, callbackify, debuglog, deprecate, format, inherits, inspect, isArray, isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined, log, promisify, types }; | ||
var exports$b = {}, | ||
_dewExec$a = false; | ||
function dew$a() { | ||
if (_dewExec$a) return exports$b; | ||
_dewExec$a = true; | ||
var hasToStringTag = dew$b()(); | ||
var callBound = dew$d(); | ||
var $toString = callBound("Object.prototype.toString"); | ||
var isStandardArguments = function isArguments(value) { | ||
if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) { | ||
return false; | ||
} | ||
return $toString(value) === "[object Arguments]"; | ||
}; | ||
var isLegacyArguments = function isArguments(value) { | ||
if (isStandardArguments(value)) { | ||
return true; | ||
} | ||
return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]"; | ||
}; | ||
var supportsStandardArguments = function () { | ||
return isStandardArguments(arguments); | ||
}(); | ||
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests | ||
exports$b = supportsStandardArguments ? isStandardArguments : isLegacyArguments; | ||
return exports$b; | ||
} | ||
var exports$a = {}, | ||
_dewExec$9 = false; | ||
function dew$9() { | ||
if (_dewExec$9) return exports$a; | ||
_dewExec$9 = true; | ||
var toStr = Object.prototype.toString; | ||
var fnToStr = Function.prototype.toString; | ||
var isFnRegex = /^\s*(?:function)?\*/; | ||
var hasToStringTag = dew$b()(); | ||
var getProto = Object.getPrototypeOf; | ||
var getGeneratorFunc = function () { | ||
// eslint-disable-line consistent-return | ||
if (!hasToStringTag) { | ||
return false; | ||
} | ||
try { | ||
return Function("return function*() {}")(); | ||
} catch (e) {} | ||
}; | ||
var GeneratorFunction; | ||
exports$a = function isGeneratorFunction(fn) { | ||
if (typeof fn !== "function") { | ||
return false; | ||
} | ||
if (isFnRegex.test(fnToStr.call(fn))) { | ||
return true; | ||
} | ||
if (!hasToStringTag) { | ||
var str = toStr.call(fn); | ||
return str === "[object GeneratorFunction]"; | ||
} | ||
if (!getProto) { | ||
return false; | ||
} | ||
if (typeof GeneratorFunction === "undefined") { | ||
var generatorFunc = getGeneratorFunc(); | ||
GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; | ||
} | ||
return getProto(fn) === GeneratorFunction; | ||
}; | ||
return exports$a; | ||
} | ||
var exports$9 = {}, | ||
_dewExec$8 = false; | ||
function dew$8() { | ||
if (_dewExec$8) return exports$9; | ||
_dewExec$8 = true; | ||
var fnToStr = Function.prototype.toString; | ||
var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; | ||
var badArrayLike; | ||
var isCallableMarker; | ||
if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { | ||
try { | ||
badArrayLike = Object.defineProperty({}, "length", { | ||
get: function () { | ||
throw isCallableMarker; | ||
} | ||
}); | ||
isCallableMarker = {}; | ||
// eslint-disable-next-line no-throw-literal | ||
reflectApply(function () { | ||
throw 42; | ||
}, null, badArrayLike); | ||
} catch (_) { | ||
if (_ !== isCallableMarker) { | ||
reflectApply = null; | ||
} | ||
} | ||
} else { | ||
reflectApply = null; | ||
} | ||
var constructorRegex = /^\s*class\b/; | ||
var isES6ClassFn = function isES6ClassFunction(value) { | ||
try { | ||
var fnStr = fnToStr.call(value); | ||
return constructorRegex.test(fnStr); | ||
} catch (e) { | ||
return false; // not a function | ||
} | ||
}; | ||
var tryFunctionObject = function tryFunctionToStr(value) { | ||
try { | ||
if (isES6ClassFn(value)) { | ||
return false; | ||
} | ||
fnToStr.call(value); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
var toStr = Object.prototype.toString; | ||
var objectClass = "[object Object]"; | ||
var fnClass = "[object Function]"; | ||
var genClass = "[object GeneratorFunction]"; | ||
var ddaClass = "[object HTMLAllCollection]"; // IE 11 | ||
var ddaClass2 = "[object HTML document.all class]"; | ||
var ddaClass3 = "[object HTMLCollection]"; // IE 9-10 | ||
var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; // better: use `has-tostringtag` | ||
var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing | ||
var isDDA = function isDocumentDotAll() { | ||
return false; | ||
}; | ||
if (typeof document === "object") { | ||
// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly | ||
var all = document.all; | ||
if (toStr.call(all) === toStr.call(document.all)) { | ||
isDDA = function isDocumentDotAll(value) { | ||
/* globals document: false */ | ||
// in IE 6-8, typeof document.all is "object" and it's truthy | ||
if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { | ||
try { | ||
var str = toStr.call(value); | ||
return (str === ddaClass || str === ddaClass2 || str === ddaClass3 // opera 12.16 | ||
|| str === objectClass // IE 6-8 | ||
) && value("") == null; // eslint-disable-line eqeqeq | ||
} catch (e) {/**/} | ||
} | ||
return false; | ||
}; | ||
} | ||
} | ||
exports$9 = reflectApply ? function isCallable(value) { | ||
if (isDDA(value)) { | ||
return true; | ||
} | ||
if (!value) { | ||
return false; | ||
} | ||
if (typeof value !== "function" && typeof value !== "object") { | ||
return false; | ||
} | ||
try { | ||
reflectApply(value, null, badArrayLike); | ||
} catch (e) { | ||
if (e !== isCallableMarker) { | ||
return false; | ||
} | ||
} | ||
return !isES6ClassFn(value) && tryFunctionObject(value); | ||
} : function isCallable(value) { | ||
if (isDDA(value)) { | ||
return true; | ||
} | ||
if (!value) { | ||
return false; | ||
} | ||
if (typeof value !== "function" && typeof value !== "object") { | ||
return false; | ||
} | ||
if (hasToStringTag) { | ||
return tryFunctionObject(value); | ||
} | ||
if (isES6ClassFn(value)) { | ||
return false; | ||
} | ||
var strClass = toStr.call(value); | ||
if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { | ||
return false; | ||
} | ||
return tryFunctionObject(value); | ||
}; | ||
return exports$9; | ||
} | ||
var exports$8 = {}, | ||
_dewExec$7 = false; | ||
function dew$7() { | ||
if (_dewExec$7) return exports$8; | ||
_dewExec$7 = true; | ||
var isCallable = dew$8(); | ||
var toStr = Object.prototype.toString; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var forEachArray = function forEachArray(array, iterator, receiver) { | ||
for (var i = 0, len = array.length; i < len; i++) { | ||
if (hasOwnProperty.call(array, i)) { | ||
if (receiver == null) { | ||
iterator(array[i], i, array); | ||
} else { | ||
iterator.call(receiver, array[i], i, array); | ||
} | ||
} | ||
} | ||
}; | ||
var forEachString = function forEachString(string, iterator, receiver) { | ||
for (var i = 0, len = string.length; i < len; i++) { | ||
// no such thing as a sparse string. | ||
if (receiver == null) { | ||
iterator(string.charAt(i), i, string); | ||
} else { | ||
iterator.call(receiver, string.charAt(i), i, string); | ||
} | ||
} | ||
}; | ||
var forEachObject = function forEachObject(object, iterator, receiver) { | ||
for (var k in object) { | ||
if (hasOwnProperty.call(object, k)) { | ||
if (receiver == null) { | ||
iterator(object[k], k, object); | ||
} else { | ||
iterator.call(receiver, object[k], k, object); | ||
} | ||
} | ||
} | ||
}; | ||
var forEach = function forEach(list, iterator, thisArg) { | ||
if (!isCallable(iterator)) { | ||
throw new TypeError("iterator must be a function"); | ||
} | ||
var receiver; | ||
if (arguments.length >= 3) { | ||
receiver = thisArg; | ||
} | ||
if (toStr.call(list) === "[object Array]") { | ||
forEachArray(list, iterator, receiver); | ||
} else if (typeof list === "string") { | ||
forEachString(list, iterator, receiver); | ||
} else { | ||
forEachObject(list, iterator, receiver); | ||
} | ||
}; | ||
exports$8 = forEach; | ||
return exports$8; | ||
} | ||
var exports$7 = {}, | ||
_dewExec$6 = false; | ||
function dew$6() { | ||
if (_dewExec$6) return exports$7; | ||
_dewExec$6 = true; | ||
/** @type {import('.')} */ | ||
exports$7 = ["Float32Array", "Float64Array", "Int8Array", "Int16Array", "Int32Array", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "BigInt64Array", "BigUint64Array"]; | ||
return exports$7; | ||
} | ||
var exports$6 = {}, | ||
_dewExec$5 = false; | ||
var _global$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$5() { | ||
if (_dewExec$5) return exports$6; | ||
_dewExec$5 = true; | ||
var possibleNames = dew$6(); | ||
var g = typeof globalThis === "undefined" ? _global$2 : globalThis; | ||
/** @type {import('.')} */ | ||
exports$6 = function availableTypedArrays() { | ||
var /** @type {ReturnType<typeof availableTypedArrays>} */out = []; | ||
for (var i = 0; i < possibleNames.length; i++) { | ||
if (typeof g[possibleNames[i]] === "function") { | ||
// @ts-expect-error | ||
out[out.length] = possibleNames[i]; | ||
} | ||
} | ||
return out; | ||
}; | ||
return exports$6; | ||
} | ||
var exports$5 = {}, | ||
_dewExec$4 = false; | ||
var _global$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew$4() { | ||
if (_dewExec$4) return exports$5; | ||
_dewExec$4 = true; | ||
var forEach = dew$7(); | ||
var availableTypedArrays = dew$5(); | ||
var callBind = dew$e(); | ||
var callBound = dew$d(); | ||
var gOPD = dew$f(); | ||
/** @type {(O: object) => string} */ | ||
var $toString = callBound("Object.prototype.toString"); | ||
var hasToStringTag = dew$b()(); | ||
var g = typeof globalThis === "undefined" ? _global$1 : globalThis; | ||
var typedArrays = availableTypedArrays(); | ||
var $slice = callBound("String.prototype.slice"); | ||
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); | ||
/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */ | ||
var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) { | ||
for (var i = 0; i < array.length; i += 1) { | ||
if (array[i] === value) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
}; | ||
/** @typedef {(receiver: import('.').TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call} Getter */ | ||
/** @type {{ [k in `\$${import('.').TypedArrayName}`]?: Getter } & { __proto__: null }} */ | ||
var cache = { | ||
__proto__: null | ||
}; | ||
if (hasToStringTag && gOPD && getPrototypeOf) { | ||
forEach(typedArrays, function (typedArray) { | ||
var arr = new g[typedArray](); | ||
if (Symbol.toStringTag in arr) { | ||
var proto = getPrototypeOf(arr); | ||
// @ts-expect-error TS won't narrow inside a closure | ||
var descriptor = gOPD(proto, Symbol.toStringTag); | ||
if (!descriptor) { | ||
var superProto = getPrototypeOf(proto); | ||
// @ts-expect-error TS won't narrow inside a closure | ||
descriptor = gOPD(superProto, Symbol.toStringTag); | ||
} | ||
// @ts-expect-error TODO: fix | ||
cache["$" + typedArray] = callBind(descriptor.get); | ||
} | ||
}); | ||
} else { | ||
forEach(typedArrays, function (typedArray) { | ||
var arr = new g[typedArray](); | ||
var fn = arr.slice || arr.set; | ||
if (fn) { | ||
// @ts-expect-error TODO: fix | ||
cache["$" + typedArray] = callBind(fn); | ||
} | ||
}); | ||
} | ||
/** @type {(value: object) => false | import('.').TypedArrayName} */ | ||
var tryTypedArrays = function tryAllTypedArrays(value) { | ||
/** @type {ReturnType<typeof tryAllTypedArrays>} */var found = false; | ||
forEach( | ||
// eslint-disable-next-line no-extra-parens | ||
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ | ||
cache, /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ | ||
function (getter, typedArray) { | ||
if (!found) { | ||
try { | ||
// @ts-expect-error TODO: fix | ||
if ("$" + getter(value) === typedArray) { | ||
found = $slice(typedArray, 1); | ||
} | ||
} catch (e) {/**/} | ||
} | ||
}); | ||
return found; | ||
}; | ||
/** @type {(value: object) => false | import('.').TypedArrayName} */ | ||
var trySlices = function tryAllSlices(value) { | ||
/** @type {ReturnType<typeof tryAllSlices>} */var found = false; | ||
forEach( | ||
// eslint-disable-next-line no-extra-parens | ||
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ | ||
cache, /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */function (getter, name) { | ||
if (!found) { | ||
try { | ||
// @ts-expect-error TODO: fix | ||
getter(value); | ||
found = $slice(name, 1); | ||
} catch (e) {/**/} | ||
} | ||
}); | ||
return found; | ||
}; | ||
/** @type {import('.')} */ | ||
exports$5 = function whichTypedArray(value) { | ||
if (!value || typeof value !== "object") { | ||
return false; | ||
} | ||
if (!hasToStringTag) { | ||
/** @type {string} */ | ||
var tag = $slice($toString(value), 8, -1); | ||
if ($indexOf(typedArrays, tag) > -1) { | ||
return tag; | ||
} | ||
if (tag !== "Object") { | ||
return false; | ||
} | ||
// node < 0.6 hits here on real Typed Arrays | ||
return trySlices(value); | ||
} | ||
if (!gOPD) { | ||
return null; | ||
} // unknown engine | ||
return tryTypedArrays(value); | ||
}; | ||
return exports$5; | ||
} | ||
var exports$4 = {}, | ||
_dewExec$3 = false; | ||
function dew$3() { | ||
if (_dewExec$3) return exports$4; | ||
_dewExec$3 = true; | ||
var whichTypedArray = dew$4(); | ||
/** @type {import('.')} */ | ||
exports$4 = function isTypedArray(value) { | ||
return !!whichTypedArray(value); | ||
}; | ||
return exports$4; | ||
} | ||
var exports$3 = {}, | ||
_dewExec$2 = false; | ||
function dew$2() { | ||
if (_dewExec$2) return exports$3; | ||
_dewExec$2 = true; | ||
var isArgumentsObject = dew$a(); | ||
var isGeneratorFunction = dew$9(); | ||
var whichTypedArray = dew$4(); | ||
var isTypedArray = dew$3(); | ||
function uncurryThis(f) { | ||
return f.call.bind(f); | ||
} | ||
var BigIntSupported = typeof BigInt !== "undefined"; | ||
var SymbolSupported = typeof Symbol !== "undefined"; | ||
var ObjectToString = uncurryThis(Object.prototype.toString); | ||
var numberValue = uncurryThis(Number.prototype.valueOf); | ||
var stringValue = uncurryThis(String.prototype.valueOf); | ||
var booleanValue = uncurryThis(Boolean.prototype.valueOf); | ||
if (BigIntSupported) { | ||
var bigIntValue = uncurryThis(BigInt.prototype.valueOf); | ||
} | ||
if (SymbolSupported) { | ||
var symbolValue = uncurryThis(Symbol.prototype.valueOf); | ||
} | ||
function checkBoxedPrimitive(value, prototypeValueOf) { | ||
if (typeof value !== "object") { | ||
return false; | ||
} | ||
try { | ||
prototypeValueOf(value); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
exports$3.isArgumentsObject = isArgumentsObject; | ||
exports$3.isGeneratorFunction = isGeneratorFunction; | ||
exports$3.isTypedArray = isTypedArray; | ||
// Taken from here and modified for better browser support | ||
// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js | ||
function isPromise(input) { | ||
return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function"; | ||
} | ||
exports$3.isPromise = isPromise; | ||
function isArrayBufferView(value) { | ||
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { | ||
return ArrayBuffer.isView(value); | ||
} | ||
return isTypedArray(value) || isDataView(value); | ||
} | ||
exports$3.isArrayBufferView = isArrayBufferView; | ||
function isUint8Array(value) { | ||
return whichTypedArray(value) === "Uint8Array"; | ||
} | ||
exports$3.isUint8Array = isUint8Array; | ||
function isUint8ClampedArray(value) { | ||
return whichTypedArray(value) === "Uint8ClampedArray"; | ||
} | ||
exports$3.isUint8ClampedArray = isUint8ClampedArray; | ||
function isUint16Array(value) { | ||
return whichTypedArray(value) === "Uint16Array"; | ||
} | ||
exports$3.isUint16Array = isUint16Array; | ||
function isUint32Array(value) { | ||
return whichTypedArray(value) === "Uint32Array"; | ||
} | ||
exports$3.isUint32Array = isUint32Array; | ||
function isInt8Array(value) { | ||
return whichTypedArray(value) === "Int8Array"; | ||
} | ||
exports$3.isInt8Array = isInt8Array; | ||
function isInt16Array(value) { | ||
return whichTypedArray(value) === "Int16Array"; | ||
} | ||
exports$3.isInt16Array = isInt16Array; | ||
function isInt32Array(value) { | ||
return whichTypedArray(value) === "Int32Array"; | ||
} | ||
exports$3.isInt32Array = isInt32Array; | ||
function isFloat32Array(value) { | ||
return whichTypedArray(value) === "Float32Array"; | ||
} | ||
exports$3.isFloat32Array = isFloat32Array; | ||
function isFloat64Array(value) { | ||
return whichTypedArray(value) === "Float64Array"; | ||
} | ||
exports$3.isFloat64Array = isFloat64Array; | ||
function isBigInt64Array(value) { | ||
return whichTypedArray(value) === "BigInt64Array"; | ||
} | ||
exports$3.isBigInt64Array = isBigInt64Array; | ||
function isBigUint64Array(value) { | ||
return whichTypedArray(value) === "BigUint64Array"; | ||
} | ||
exports$3.isBigUint64Array = isBigUint64Array; | ||
function isMapToString(value) { | ||
return ObjectToString(value) === "[object Map]"; | ||
} | ||
isMapToString.working = typeof Map !== "undefined" && isMapToString(new Map()); | ||
function isMap(value) { | ||
if (typeof Map === "undefined") { | ||
return false; | ||
} | ||
return isMapToString.working ? isMapToString(value) : value instanceof Map; | ||
} | ||
exports$3.isMap = isMap; | ||
function isSetToString(value) { | ||
return ObjectToString(value) === "[object Set]"; | ||
} | ||
isSetToString.working = typeof Set !== "undefined" && isSetToString(new Set()); | ||
function isSet(value) { | ||
if (typeof Set === "undefined") { | ||
return false; | ||
} | ||
return isSetToString.working ? isSetToString(value) : value instanceof Set; | ||
} | ||
exports$3.isSet = isSet; | ||
function isWeakMapToString(value) { | ||
return ObjectToString(value) === "[object WeakMap]"; | ||
} | ||
isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(new WeakMap()); | ||
function isWeakMap(value) { | ||
if (typeof WeakMap === "undefined") { | ||
return false; | ||
} | ||
return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap; | ||
} | ||
exports$3.isWeakMap = isWeakMap; | ||
function isWeakSetToString(value) { | ||
return ObjectToString(value) === "[object WeakSet]"; | ||
} | ||
isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(new WeakSet()); | ||
function isWeakSet(value) { | ||
return isWeakSetToString(value); | ||
} | ||
exports$3.isWeakSet = isWeakSet; | ||
function isArrayBufferToString(value) { | ||
return ObjectToString(value) === "[object ArrayBuffer]"; | ||
} | ||
isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer()); | ||
function isArrayBuffer(value) { | ||
if (typeof ArrayBuffer === "undefined") { | ||
return false; | ||
} | ||
return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer; | ||
} | ||
exports$3.isArrayBuffer = isArrayBuffer; | ||
function isDataViewToString(value) { | ||
return ObjectToString(value) === "[object DataView]"; | ||
} | ||
isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)); | ||
function isDataView(value) { | ||
if (typeof DataView === "undefined") { | ||
return false; | ||
} | ||
return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView; | ||
} | ||
exports$3.isDataView = isDataView; | ||
// Store a copy of SharedArrayBuffer in case it's deleted elsewhere | ||
var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : undefined; | ||
function isSharedArrayBufferToString(value) { | ||
return ObjectToString(value) === "[object SharedArrayBuffer]"; | ||
} | ||
function isSharedArrayBuffer(value) { | ||
if (typeof SharedArrayBufferCopy === "undefined") { | ||
return false; | ||
} | ||
if (typeof isSharedArrayBufferToString.working === "undefined") { | ||
isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); | ||
} | ||
return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy; | ||
} | ||
exports$3.isSharedArrayBuffer = isSharedArrayBuffer; | ||
function isAsyncFunction(value) { | ||
return ObjectToString(value) === "[object AsyncFunction]"; | ||
} | ||
exports$3.isAsyncFunction = isAsyncFunction; | ||
function isMapIterator(value) { | ||
return ObjectToString(value) === "[object Map Iterator]"; | ||
} | ||
exports$3.isMapIterator = isMapIterator; | ||
function isSetIterator(value) { | ||
return ObjectToString(value) === "[object Set Iterator]"; | ||
} | ||
exports$3.isSetIterator = isSetIterator; | ||
function isGeneratorObject(value) { | ||
return ObjectToString(value) === "[object Generator]"; | ||
} | ||
exports$3.isGeneratorObject = isGeneratorObject; | ||
function isWebAssemblyCompiledModule(value) { | ||
return ObjectToString(value) === "[object WebAssembly.Module]"; | ||
} | ||
exports$3.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; | ||
function isNumberObject(value) { | ||
return checkBoxedPrimitive(value, numberValue); | ||
} | ||
exports$3.isNumberObject = isNumberObject; | ||
function isStringObject(value) { | ||
return checkBoxedPrimitive(value, stringValue); | ||
} | ||
exports$3.isStringObject = isStringObject; | ||
function isBooleanObject(value) { | ||
return checkBoxedPrimitive(value, booleanValue); | ||
} | ||
exports$3.isBooleanObject = isBooleanObject; | ||
function isBigIntObject(value) { | ||
return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); | ||
} | ||
exports$3.isBigIntObject = isBigIntObject; | ||
function isSymbolObject(value) { | ||
return SymbolSupported && checkBoxedPrimitive(value, symbolValue); | ||
} | ||
exports$3.isSymbolObject = isSymbolObject; | ||
function isBoxedPrimitive(value) { | ||
return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value); | ||
} | ||
exports$3.isBoxedPrimitive = isBoxedPrimitive; | ||
function isAnyArrayBuffer(value) { | ||
return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value)); | ||
} | ||
exports$3.isAnyArrayBuffer = isAnyArrayBuffer; | ||
["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function (method) { | ||
Object.defineProperty(exports$3, method, { | ||
enumerable: false, | ||
value: function () { | ||
throw new Error(method + " is not supported in userland"); | ||
} | ||
}); | ||
}); | ||
return exports$3; | ||
} | ||
var exports$2 = {}, | ||
_dewExec$1 = false; | ||
function dew$1() { | ||
if (_dewExec$1) return exports$2; | ||
_dewExec$1 = true; | ||
exports$2 = function isBuffer(arg) { | ||
return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function"; | ||
}; | ||
return exports$2; | ||
} | ||
var exports$1 = {}, | ||
_dewExec = false; | ||
var _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
var process$1 = process; | ||
// Copyright Joyent, Inc. and other Node contributors. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a | ||
// copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to permit | ||
// persons to whom the Software is furnished to do so, subject to the | ||
// following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included | ||
// in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
// USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) { | ||
var keys = Object.keys(obj); | ||
var descriptors = {}; | ||
for (var i = 0; i < keys.length; i++) { | ||
descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); | ||
} | ||
return descriptors; | ||
}; | ||
var formatRegExp = /%[sdj%]/g; | ||
exports$1.format = function (f) { | ||
if (!isString(f)) { | ||
var objects = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
objects.push(inspect(arguments[i])); | ||
} | ||
return objects.join(" "); | ||
} | ||
var i = 1; | ||
var args = arguments; | ||
var len = args.length; | ||
var str = String(f).replace(formatRegExp, function (x) { | ||
if (x === "%%") return "%"; | ||
if (i >= len) return x; | ||
switch (x) { | ||
case "%s": | ||
return String(args[i++]); | ||
case "%d": | ||
return Number(args[i++]); | ||
case "%j": | ||
try { | ||
return JSON.stringify(args[i++]); | ||
} catch (_) { | ||
return "[Circular]"; | ||
} | ||
default: | ||
return x; | ||
} | ||
}); | ||
for (var x = args[i]; i < len; x = args[++i]) { | ||
if (isNull(x) || !isObject(x)) { | ||
str += " " + x; | ||
} else { | ||
str += " " + inspect(x); | ||
} | ||
} | ||
return str; | ||
}; | ||
// Mark that a method should not be used. | ||
// Returns a modified function which warns once by default. | ||
// If --no-deprecation is set, then it is a no-op. | ||
exports$1.deprecate = function (fn, msg) { | ||
if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) { | ||
return fn; | ||
} | ||
// Allow for deprecating things in the process of starting up. | ||
if (typeof process$1 === "undefined") { | ||
return function () { | ||
return exports$1.deprecate(fn, msg).apply(this || _global, arguments); | ||
}; | ||
} | ||
var warned = false; | ||
function deprecated() { | ||
if (!warned) { | ||
if (process$1.throwDeprecation) { | ||
throw new Error(msg); | ||
} else if (process$1.traceDeprecation) { | ||
console.trace(msg); | ||
} else { | ||
console.error(msg); | ||
} | ||
warned = true; | ||
} | ||
return fn.apply(this || _global, arguments); | ||
} | ||
return deprecated; | ||
}; | ||
var debugs = {}; | ||
var debugEnvRegex = /^$/; | ||
if (process$1.env.NODE_DEBUG) { | ||
var debugEnv = process$1.env.NODE_DEBUG; | ||
debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(); | ||
debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"); | ||
} | ||
exports$1.debuglog = function (set) { | ||
set = set.toUpperCase(); | ||
if (!debugs[set]) { | ||
if (debugEnvRegex.test(set)) { | ||
var pid = process$1.pid; | ||
debugs[set] = function () { | ||
var msg = exports$1.format.apply(exports$1, arguments); | ||
console.error("%s %d: %s", set, pid, msg); | ||
}; | ||
} else { | ||
debugs[set] = function () {}; | ||
} | ||
} | ||
return debugs[set]; | ||
}; | ||
/** | ||
* Echos the value of a value. Trys to print the value out | ||
* in the best way possible given the different types. | ||
* | ||
* @param {Object} obj The object to print out. | ||
* @param {Object} opts Optional options object that alters the output. | ||
*/ | ||
/* legacy: obj, showHidden, depth, colors*/ | ||
function inspect(obj, opts) { | ||
// default options | ||
var ctx = { | ||
seen: [], | ||
stylize: stylizeNoColor | ||
}; | ||
// legacy... | ||
if (arguments.length >= 3) ctx.depth = arguments[2]; | ||
if (arguments.length >= 4) ctx.colors = arguments[3]; | ||
if (isBoolean(opts)) { | ||
// legacy... | ||
ctx.showHidden = opts; | ||
} else if (opts) { | ||
// got an "options" object | ||
exports$1._extend(ctx, opts); | ||
} | ||
// set default options | ||
if (isUndefined(ctx.showHidden)) ctx.showHidden = false; | ||
if (isUndefined(ctx.depth)) ctx.depth = 2; | ||
if (isUndefined(ctx.colors)) ctx.colors = false; | ||
if (isUndefined(ctx.customInspect)) ctx.customInspect = true; | ||
if (ctx.colors) ctx.stylize = stylizeWithColor; | ||
return formatValue(ctx, obj, ctx.depth); | ||
} | ||
exports$1.inspect = inspect; | ||
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics | ||
inspect.colors = { | ||
"bold": [1, 22], | ||
"italic": [3, 23], | ||
"underline": [4, 24], | ||
"inverse": [7, 27], | ||
"white": [37, 39], | ||
"grey": [90, 39], | ||
"black": [30, 39], | ||
"blue": [34, 39], | ||
"cyan": [36, 39], | ||
"green": [32, 39], | ||
"magenta": [35, 39], | ||
"red": [31, 39], | ||
"yellow": [33, 39] | ||
}; | ||
// Don't use 'blue' not visible on cmd.exe | ||
inspect.styles = { | ||
"special": "cyan", | ||
"number": "yellow", | ||
"boolean": "yellow", | ||
"undefined": "grey", | ||
"null": "bold", | ||
"string": "green", | ||
"date": "magenta", | ||
// "name": intentionally not styling | ||
"regexp": "red" | ||
}; | ||
function stylizeWithColor(str, styleType) { | ||
var style = inspect.styles[styleType]; | ||
if (style) { | ||
return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m"; | ||
} else { | ||
return str; | ||
} | ||
} | ||
function stylizeNoColor(str, styleType) { | ||
return str; | ||
} | ||
function arrayToHash(array) { | ||
var hash = {}; | ||
array.forEach(function (val, idx) { | ||
hash[val] = true; | ||
}); | ||
return hash; | ||
} | ||
function formatValue(ctx, value, recurseTimes) { | ||
// Provide a hook for user-specified inspect functions. | ||
// Check that value is an object with an inspect function on it | ||
if (ctx.customInspect && value && isFunction(value.inspect) && | ||
// Filter out the util module, it's inspect function is special | ||
value.inspect !== exports$1.inspect && | ||
// Also filter out any prototype objects using the circular check. | ||
!(value.constructor && value.constructor.prototype === value)) { | ||
var ret = value.inspect(recurseTimes, ctx); | ||
if (!isString(ret)) { | ||
ret = formatValue(ctx, ret, recurseTimes); | ||
} | ||
return ret; | ||
} | ||
// Primitive types cannot have properties | ||
var primitive = formatPrimitive(ctx, value); | ||
if (primitive) { | ||
return primitive; | ||
} | ||
// Look up the keys of the object. | ||
var keys = Object.keys(value); | ||
var visibleKeys = arrayToHash(keys); | ||
if (ctx.showHidden) { | ||
keys = Object.getOwnPropertyNames(value); | ||
} | ||
// IE doesn't make error fields non-enumerable | ||
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx | ||
if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) { | ||
return formatError(value); | ||
} | ||
// Some type of object without properties can be shortcutted. | ||
if (keys.length === 0) { | ||
if (isFunction(value)) { | ||
var name = value.name ? ": " + value.name : ""; | ||
return ctx.stylize("[Function" + name + "]", "special"); | ||
} | ||
if (isRegExp(value)) { | ||
return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); | ||
} | ||
if (isDate(value)) { | ||
return ctx.stylize(Date.prototype.toString.call(value), "date"); | ||
} | ||
if (isError(value)) { | ||
return formatError(value); | ||
} | ||
} | ||
var base = "", | ||
array = false, | ||
braces = ["{", "}"]; | ||
// Make Array say that they are Array | ||
if (isArray(value)) { | ||
array = true; | ||
braces = ["[", "]"]; | ||
} | ||
// Make functions say that they are functions | ||
if (isFunction(value)) { | ||
var n = value.name ? ": " + value.name : ""; | ||
base = " [Function" + n + "]"; | ||
} | ||
// Make RegExps say that they are RegExps | ||
if (isRegExp(value)) { | ||
base = " " + RegExp.prototype.toString.call(value); | ||
} | ||
// Make dates with properties first say the date | ||
if (isDate(value)) { | ||
base = " " + Date.prototype.toUTCString.call(value); | ||
} | ||
// Make error with message first say the error | ||
if (isError(value)) { | ||
base = " " + formatError(value); | ||
} | ||
if (keys.length === 0 && (!array || value.length == 0)) { | ||
return braces[0] + base + braces[1]; | ||
} | ||
if (recurseTimes < 0) { | ||
if (isRegExp(value)) { | ||
return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); | ||
} else { | ||
return ctx.stylize("[Object]", "special"); | ||
} | ||
} | ||
ctx.seen.push(value); | ||
var output; | ||
if (array) { | ||
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); | ||
} else { | ||
output = keys.map(function (key) { | ||
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); | ||
}); | ||
} | ||
ctx.seen.pop(); | ||
return reduceToSingleString(output, base, braces); | ||
} | ||
function formatPrimitive(ctx, value) { | ||
if (isUndefined(value)) return ctx.stylize("undefined", "undefined"); | ||
if (isString(value)) { | ||
var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'"; | ||
return ctx.stylize(simple, "string"); | ||
} | ||
if (isNumber(value)) return ctx.stylize("" + value, "number"); | ||
if (isBoolean(value)) return ctx.stylize("" + value, "boolean"); | ||
// For some reason typeof null is "object", so special case here. | ||
if (isNull(value)) return ctx.stylize("null", "null"); | ||
} | ||
function formatError(value) { | ||
return "[" + Error.prototype.toString.call(value) + "]"; | ||
} | ||
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { | ||
var output = []; | ||
for (var i = 0, l = value.length; i < l; ++i) { | ||
if (hasOwnProperty(value, String(i))) { | ||
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); | ||
} else { | ||
output.push(""); | ||
} | ||
} | ||
keys.forEach(function (key) { | ||
if (!key.match(/^\d+$/)) { | ||
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); | ||
} | ||
}); | ||
return output; | ||
} | ||
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { | ||
var name, str, desc; | ||
desc = Object.getOwnPropertyDescriptor(value, key) || { | ||
value: value[key] | ||
}; | ||
if (desc.get) { | ||
if (desc.set) { | ||
str = ctx.stylize("[Getter/Setter]", "special"); | ||
} else { | ||
str = ctx.stylize("[Getter]", "special"); | ||
} | ||
} else { | ||
if (desc.set) { | ||
str = ctx.stylize("[Setter]", "special"); | ||
} | ||
} | ||
if (!hasOwnProperty(visibleKeys, key)) { | ||
name = "[" + key + "]"; | ||
} | ||
if (!str) { | ||
if (ctx.seen.indexOf(desc.value) < 0) { | ||
if (isNull(recurseTimes)) { | ||
str = formatValue(ctx, desc.value, null); | ||
} else { | ||
str = formatValue(ctx, desc.value, recurseTimes - 1); | ||
} | ||
if (str.indexOf("\n") > -1) { | ||
if (array) { | ||
str = str.split("\n").map(function (line) { | ||
return " " + line; | ||
}).join("\n").slice(2); | ||
} else { | ||
str = "\n" + str.split("\n").map(function (line) { | ||
return " " + line; | ||
}).join("\n"); | ||
} | ||
} | ||
} else { | ||
str = ctx.stylize("[Circular]", "special"); | ||
} | ||
} | ||
if (isUndefined(name)) { | ||
if (array && key.match(/^\d+$/)) { | ||
return str; | ||
} | ||
name = JSON.stringify("" + key); | ||
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { | ||
name = name.slice(1, -1); | ||
name = ctx.stylize(name, "name"); | ||
} else { | ||
name = name.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'"); | ||
name = ctx.stylize(name, "string"); | ||
} | ||
} | ||
return name + ": " + str; | ||
} | ||
function reduceToSingleString(output, base, braces) { | ||
var length = output.reduce(function (prev, cur) { | ||
if (cur.indexOf("\n") >= 0) ; | ||
return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1; | ||
}, 0); | ||
if (length > 60) { | ||
return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1]; | ||
} | ||
return braces[0] + base + " " + output.join(", ") + " " + braces[1]; | ||
} | ||
// NOTE: These type checking functions intentionally don't use `instanceof` | ||
// because it is fragile and can be easily faked with `Object.create()`. | ||
exports$1.types = dew$2(); | ||
function isArray(ar) { | ||
return Array.isArray(ar); | ||
} | ||
exports$1.isArray = isArray; | ||
function isBoolean(arg) { | ||
return typeof arg === "boolean"; | ||
} | ||
exports$1.isBoolean = isBoolean; | ||
function isNull(arg) { | ||
return arg === null; | ||
} | ||
exports$1.isNull = isNull; | ||
function isNullOrUndefined(arg) { | ||
return arg == null; | ||
} | ||
exports$1.isNullOrUndefined = isNullOrUndefined; | ||
function isNumber(arg) { | ||
return typeof arg === "number"; | ||
} | ||
exports$1.isNumber = isNumber; | ||
function isString(arg) { | ||
return typeof arg === "string"; | ||
} | ||
exports$1.isString = isString; | ||
function isSymbol(arg) { | ||
return typeof arg === "symbol"; | ||
} | ||
exports$1.isSymbol = isSymbol; | ||
function isUndefined(arg) { | ||
return arg === void 0; | ||
} | ||
exports$1.isUndefined = isUndefined; | ||
function isRegExp(re) { | ||
return isObject(re) && objectToString(re) === "[object RegExp]"; | ||
} | ||
exports$1.isRegExp = isRegExp; | ||
exports$1.types.isRegExp = isRegExp; | ||
function isObject(arg) { | ||
return typeof arg === "object" && arg !== null; | ||
} | ||
exports$1.isObject = isObject; | ||
function isDate(d) { | ||
return isObject(d) && objectToString(d) === "[object Date]"; | ||
} | ||
exports$1.isDate = isDate; | ||
exports$1.types.isDate = isDate; | ||
function isError(e) { | ||
return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error); | ||
} | ||
exports$1.isError = isError; | ||
exports$1.types.isNativeError = isError; | ||
function isFunction(arg) { | ||
return typeof arg === "function"; | ||
} | ||
exports$1.isFunction = isFunction; | ||
function isPrimitive(arg) { | ||
return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || | ||
// ES6 symbol | ||
typeof arg === "undefined"; | ||
} | ||
exports$1.isPrimitive = isPrimitive; | ||
exports$1.isBuffer = dew$1(); | ||
function objectToString(o) { | ||
return Object.prototype.toString.call(o); | ||
} | ||
function pad(n) { | ||
return n < 10 ? "0" + n.toString(10) : n.toString(10); | ||
} | ||
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; | ||
// 26 Feb 16:19:34 | ||
function timestamp() { | ||
var d = new Date(); | ||
var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":"); | ||
return [d.getDate(), months[d.getMonth()], time].join(" "); | ||
} | ||
// log is just a thin wrapper to console.log that prepends a timestamp | ||
exports$1.log = function () { | ||
console.log("%s - %s", timestamp(), exports$1.format.apply(exports$1, arguments)); | ||
}; | ||
/** | ||
* Inherit the prototype methods from one constructor into another. | ||
* | ||
* The Function.prototype.inherits from lang.js rewritten as a standalone | ||
* function (not on Function.prototype). NOTE: If this file is to be loaded | ||
* during bootstrapping this function needs to be rewritten using some native | ||
* functions as prototype setup using normal JavaScript does not work as | ||
* expected during bootstrapping (see mirror.js in r114903). | ||
* | ||
* @param {function} ctor Constructor function which needs to inherit the | ||
* prototype. | ||
* @param {function} superCtor Constructor function to inherit prototype from. | ||
*/ | ||
exports$1.inherits = dew$g(); | ||
exports$1._extend = function (origin, add) { | ||
// Don't do anything if add isn't an object | ||
if (!add || !isObject(add)) return origin; | ||
var keys = Object.keys(add); | ||
var i = keys.length; | ||
while (i--) { | ||
origin[keys[i]] = add[keys[i]]; | ||
} | ||
return origin; | ||
}; | ||
function hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} | ||
var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : undefined; | ||
exports$1.promisify = function promisify(original) { | ||
if (typeof original !== "function") throw new TypeError("The \"original\" argument must be of type Function"); | ||
if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { | ||
fn = original[kCustomPromisifiedSymbol]; | ||
if (typeof fn !== "function") { | ||
throw new TypeError("The \"util.promisify.custom\" argument must be of type Function"); | ||
} | ||
Object.defineProperty(fn, kCustomPromisifiedSymbol, { | ||
value: fn, | ||
enumerable: false, | ||
writable: false, | ||
configurable: true | ||
}); | ||
return fn; | ||
} | ||
function fn() { | ||
var promiseResolve, promiseReject; | ||
var promise = new Promise(function (resolve, reject) { | ||
promiseResolve = resolve; | ||
promiseReject = reject; | ||
}); | ||
var args = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
args.push(arguments[i]); | ||
} | ||
args.push(function (err, value) { | ||
if (err) { | ||
promiseReject(err); | ||
} else { | ||
promiseResolve(value); | ||
} | ||
}); | ||
try { | ||
original.apply(this || _global, args); | ||
} catch (err) { | ||
promiseReject(err); | ||
} | ||
return promise; | ||
} | ||
Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); | ||
if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { | ||
value: fn, | ||
enumerable: false, | ||
writable: false, | ||
configurable: true | ||
}); | ||
return Object.defineProperties(fn, getOwnPropertyDescriptors(original)); | ||
}; | ||
exports$1.promisify.custom = kCustomPromisifiedSymbol; | ||
function callbackifyOnRejected(reason, cb) { | ||
// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). | ||
// Because `null` is a special error value in callbacks which means "no error | ||
// occurred", we error-wrap so the callback consumer can distinguish between | ||
// "the promise rejected with null" or "the promise fulfilled with undefined". | ||
if (!reason) { | ||
var newReason = new Error("Promise was rejected with a falsy value"); | ||
newReason.reason = reason; | ||
reason = newReason; | ||
} | ||
return cb(reason); | ||
} | ||
function callbackify(original) { | ||
if (typeof original !== "function") { | ||
throw new TypeError("The \"original\" argument must be of type Function"); | ||
} | ||
// We DO NOT return the promise as it gives the user a false sense that | ||
// the promise is actually somehow related to the callback's execution | ||
// and that the callback throwing will reject the promise. | ||
function callbackified() { | ||
var args = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
args.push(arguments[i]); | ||
} | ||
var maybeCb = args.pop(); | ||
if (typeof maybeCb !== "function") { | ||
throw new TypeError("The last argument must be of type Function"); | ||
} | ||
var self = this || _global; | ||
var cb = function () { | ||
return maybeCb.apply(self, arguments); | ||
}; | ||
// In true node style we process the callback on `nextTick` with all the | ||
// implications (stack, `uncaughtException`, `async_hooks`) | ||
original.apply(this || _global, args).then(function (ret) { | ||
process$1.nextTick(cb.bind(null, null, ret)); | ||
}, function (rej) { | ||
process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb)); | ||
}); | ||
} | ||
Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); | ||
Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); | ||
return callbackified; | ||
} | ||
exports$1.callbackify = callbackify; | ||
return exports$1; | ||
} | ||
const exports = dew(); | ||
exports['format']; exports['deprecate']; exports['debuglog']; exports['inspect']; exports['types']; exports['isArray']; exports['isBoolean']; exports['isNull']; exports['isNullOrUndefined']; exports['isNumber']; exports['isString']; exports['isSymbol']; exports['isUndefined']; exports['isRegExp']; exports['isObject']; exports['isDate']; exports['isError']; exports['isFunction']; exports['isPrimitive']; exports['isBuffer']; exports['log']; exports['inherits']; exports['_extend']; exports['promisify']; exports['callbackify']; | ||
var _extend = exports._extend; | ||
var callbackify = exports.callbackify; | ||
var debuglog = exports.debuglog; | ||
var deprecate = exports.deprecate; | ||
var format = exports.format; | ||
var inherits = exports.inherits; | ||
var inspect = exports.inspect; | ||
var isArray = exports.isArray; | ||
var isBoolean = exports.isBoolean; | ||
var isBuffer = exports.isBuffer; | ||
var isDate = exports.isDate; | ||
var isError = exports.isError; | ||
var isFunction = exports.isFunction; | ||
var isNull = exports.isNull; | ||
var isNullOrUndefined = exports.isNullOrUndefined; | ||
var isNumber = exports.isNumber; | ||
var isObject = exports.isObject; | ||
var isPrimitive = exports.isPrimitive; | ||
var isRegExp = exports.isRegExp; | ||
var isString = exports.isString; | ||
var isSymbol = exports.isSymbol; | ||
var isUndefined = exports.isUndefined; | ||
var log = exports.log; | ||
var promisify = exports.promisify; | ||
var types = exports.types; | ||
const TextEncoder = exports.TextEncoder = globalThis.TextEncoder; | ||
const TextDecoder = exports.TextDecoder = globalThis.TextDecoder; | ||
export { TextDecoder, TextEncoder, _extend, callbackify, debuglog, exports as default, deprecate, format, inherits, inspect, isArray, isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined, log, promisify, types }; |
import { types } from '../util.js'; | ||
export { types as default } from '../util.js'; | ||
import '../chunk-ce0fbc82.js'; | ||
import '../chunk-b4205b57.js'; | ||
import '../chunk-5decc758.js'; | ||
import '../chunk-DtcTpLWz.js'; | ||
import '../chunk-CkFCi-G1.js'; | ||
import '../chunk-DEMDiNwt.js'; | ||
@@ -52,2 +51,2 @@ const { | ||
export { isAnyArrayBuffer, isArgumentsObject, isArrayBuffer, isArrayBufferView, isAsyncFunction, isBigInt64Array, isBigIntObject, isBigUint64Array, isBooleanObject, isBoxedPrimitive, isCryptoKey, isDataView, isDate, isExternal, isFloat32Array, isFloat64Array, isGeneratorFunction, isGeneratorObject, isInt16Array, isInt32Array, isInt8Array, isKeyObject, isMap, isMapIterator, isModuleNamespaceObject, isNativeError, isNumberObject, isPromise, isProxy, isRegExp, isSet, isSetIterator, isSharedArrayBuffer, isStringObject, isSymbolObject, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isWeakMap, isWeakSet }; | ||
export { types as default, isAnyArrayBuffer, isArgumentsObject, isArrayBuffer, isArrayBufferView, isAsyncFunction, isBigInt64Array, isBigIntObject, isBigUint64Array, isBooleanObject, isBoxedPrimitive, isCryptoKey, isDataView, isDate, isExternal, isFloat32Array, isFloat64Array, isGeneratorFunction, isGeneratorObject, isInt16Array, isInt32Array, isInt8Array, isKeyObject, isMap, isMapIterator, isModuleNamespaceObject, isNativeError, isNumberObject, isPromise, isProxy, isRegExp, isSet, isSetIterator, isSharedArrayBuffer, isStringObject, isSymbolObject, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isWeakMap, isWeakSet }; |
var exports$1 = {}, | ||
_dewExec = false; | ||
_dewExec = false; | ||
var _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global; | ||
function dew() { | ||
if (_dewExec) return exports$1; | ||
_dewExec = true; | ||
var indexOf = function (xs, item) { | ||
@@ -16,13 +13,9 @@ if (xs.indexOf) return xs.indexOf(item);else for (var i = 0; i < xs.length; i++) { | ||
}; | ||
var Object_keys = function (obj) { | ||
if (Object.keys) return Object.keys(obj);else { | ||
var res = []; | ||
for (var key in obj) res.push(key); | ||
return res; | ||
} | ||
}; | ||
var forEach = function (xs, fn) { | ||
@@ -33,3 +26,2 @@ if (xs.forEach) return xs.forEach(fn);else for (var i = 0; i < xs.length; i++) { | ||
}; | ||
var defineProp = function () { | ||
@@ -52,9 +44,5 @@ try { | ||
}(); | ||
var globals = ["Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape"]; | ||
function Context() {} | ||
Context.prototype = {}; | ||
var Script = exports$1.Script = function NodeScript(code) { | ||
@@ -64,3 +52,2 @@ if (!((this || _global) instanceof Script)) return new Script(code); | ||
}; | ||
Script.prototype.runInContext = function (context) { | ||
@@ -70,3 +57,2 @@ if (!(context instanceof Context)) { | ||
} | ||
var iframe = document.createElement("iframe"); | ||
@@ -78,4 +64,3 @@ if (!iframe.style) iframe.style = {}; | ||
var wEval = win.eval, | ||
wExecScript = win.execScript; | ||
wExecScript = win.execScript; | ||
if (!wEval && wExecScript) { | ||
@@ -86,3 +71,2 @@ // win.eval() magically appears when this is called in IE: | ||
} | ||
forEach(Object_keys(context), function (key) { | ||
@@ -114,11 +98,8 @@ win[key] = context[key]; | ||
}; | ||
Script.prototype.runInThisContext = function () { | ||
return eval((this || _global).code); // maybe... | ||
}; | ||
Script.prototype.runInNewContext = function (context) { | ||
var ctx = Script.createContext(context); | ||
var res = this.runInContext(ctx); | ||
if (context) { | ||
@@ -129,6 +110,4 @@ forEach(Object_keys(ctx), function (key) { | ||
} | ||
return res; | ||
}; | ||
forEach(Object_keys(Script.prototype), function (name) { | ||
@@ -140,14 +119,10 @@ exports$1[name] = Script[name] = function (code) { | ||
}); | ||
exports$1.isContext = function (context) { | ||
return context instanceof Context; | ||
}; | ||
exports$1.createScript = function (code) { | ||
return exports$1.Script(code); | ||
}; | ||
exports$1.createContext = Script.createContext = function (context) { | ||
var copy = new Context(); | ||
if (typeof context === "object") { | ||
@@ -158,6 +133,4 @@ forEach(Object_keys(context), function (key) { | ||
} | ||
return copy; | ||
}; | ||
return exports$1; | ||
@@ -164,0 +137,0 @@ } |
import fs from './fs.js'; | ||
import './chunk-44e51b61.js'; | ||
import './chunk-4bd36a8f.js'; | ||
import './chunk-ce0fbc82.js'; | ||
import './chunk-b4205b57.js'; | ||
import './chunk-5decc758.js'; | ||
import './chunk-2eac56ff.js'; | ||
import './chunk-4ccc3a29.js'; | ||
import './assert.js'; | ||
import './util.js'; | ||
import './path.js'; | ||
import './chunk-23dbec7b.js'; | ||
import './events.js'; | ||
import './stream.js'; | ||
import './chunk-6c718bbe.js'; | ||
import './chunk-DtuTasat.js'; | ||
import './chunk-CjPlbOtt.js'; | ||
import './chunk-D3uu3VYh.js'; | ||
import './chunk-CbQqNoLO.js'; | ||
import './chunk-DHWh-hmB.js'; | ||
import './chunk-b0rmRow7.js'; | ||
import './chunk-DEMDiNwt.js'; | ||
import './chunk-DtDiafJB.js'; | ||
import './chunk-tHuMsdT0.js'; | ||
import './chunk-B6-G-Ftj.js'; | ||
import './chunk-B738Er4n.js'; | ||
import './buffer.js'; | ||
import './url.js'; | ||
import './chunk-924bb2e1.js'; | ||
import './chunk-b04e620d.js'; | ||
import './buffer.js'; | ||
import './punycode.js'; | ||
import './chunk-DtcTpLWz.js'; | ||
import './chunk-BlJi4mNy.js'; | ||
@@ -21,0 +19,0 @@ /* |
import { once, EventEmitter } from './events.js'; | ||
import './chunk-4bd36a8f.js'; | ||
@@ -4,0 +3,0 @@ function unimplemented(name) { |
@@ -1,3 +0,5 @@ | ||
import Duplex from 'https://deno.land/std@0.173.0/node/_stream/duplex.ts'; | ||
export default Duplex; | ||
import { Duplex } from 'node:stream'; | ||
export const from = Duplex.from; | ||
export const fromWeb = Duplex.fromWeb; | ||
export const toWeb = Duplex.toWeb; | ||
export { Duplex as default } |
@@ -1,1 +0,1 @@ | ||
export { default } from 'https://deno.land/std@0.173.0/node/_stream/passthrough.ts'; | ||
export { PassThrough as default } from 'node:stream'; |
@@ -1,5 +0,5 @@ | ||
import Readable from 'https://deno.land/std@0.173.0/node/_stream/readable.ts'; | ||
export default Readable; | ||
import { Readable } from 'node:stream'; | ||
export { Readable as default } | ||
export const from = Readable.from; | ||
export const ReadableState = Readable.ReadableState; | ||
export const _fromList = Readable._fromList; |
@@ -1,1 +0,1 @@ | ||
export { default } from 'https://deno.land/std@0.173.0/node/_stream/passthrough.ts'; | ||
export { Transform as default } from 'node:stream'; |
@@ -1,3 +0,5 @@ | ||
import Writable from 'https://deno.land/std@0.173.0/node/_stream/readable.ts'; | ||
export default Writable; | ||
import { Writable } from 'node:stream'; | ||
export { Writable as default } | ||
export const WritableState = Writable.WritableState; | ||
export const fromWeb = Writable.fromWeb; | ||
export const toWeb = Writable.toWeb; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/assert.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/assert.ts'; | ||
export * from 'node:assert'; | ||
export { default } from 'node:assert'; |
@@ -1,26 +0,2 @@ | ||
import { strict } from '../assert.ts'; | ||
export { | ||
fail, | ||
AssertionError, | ||
ok, | ||
equal, | ||
notEqual, | ||
deepEqual, | ||
notDeepEqual, | ||
deepStrictEqual, | ||
notDeepStrictEqual, | ||
strictEqual, | ||
notStrictEqual, | ||
throws, | ||
rejects, | ||
doesNotThrow, | ||
doesNotReject, | ||
// ifError, | ||
match, | ||
doesNotMatch, | ||
// CallTracker | ||
} from '../assert.ts'; | ||
export { strict } | ||
export default strict; | ||
export * from 'node:assert/strict'; | ||
export { default } from 'node:assert/strict'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/async_hooks.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/async_hooks.ts'; | ||
export * from 'node:async_hooks'; | ||
export { default } from 'node:async_hooks'; |
@@ -1,5 +0,5 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/buffer.ts'; | ||
import { default as buffer } from 'https://deno.land/std@0.173.0/node/buffer.ts'; | ||
export * from 'node:buffer'; | ||
import { default as buffer } from 'node:buffer'; | ||
export const kMaxLength = 4294967296; | ||
buffer.kMaxLength = kMaxLength; | ||
export default buffer; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/child_process.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/child_process.ts'; | ||
export * from 'node:child_process'; | ||
export { default } from 'node:child_process'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/console.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/console.ts'; | ||
export * from 'node:console'; | ||
export { default } from 'node:console'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/constants.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/constants.ts'; | ||
export * from 'node:constants'; | ||
export { default } from 'node:constants'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/crypto.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/crypto.ts'; | ||
export * from 'node:crypto'; | ||
export { default } from 'node:crypto'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/dns.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/dns.ts'; | ||
export * from 'node:dns'; | ||
export { default } from 'node:dns'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/events.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/events.ts'; | ||
export * from 'node:events'; | ||
export { default } from 'node:events'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/fs.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/fs.ts'; | ||
export * from 'node:fs'; | ||
export { default } from 'node:fs'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/fs/promises.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/fs/promises.ts'; | ||
export * from 'node:fs/promises'; | ||
export { default } from 'node:fs/promises'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/http.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/http.ts'; | ||
export * from 'node:http'; | ||
export { default } from 'node:http'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/https.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/https.ts'; | ||
export * from 'node:https'; | ||
export { default } from 'node:https'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/inspector.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/inspector.ts'; | ||
export * from 'node:inspector'; | ||
export { default } from 'node:inspector'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/module.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/module.ts'; | ||
export * from 'node:module'; | ||
export { default } from 'node:module'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/net.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/net.ts'; | ||
export * from 'node:net'; | ||
export { default } from 'node:net'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/os.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/os.ts'; | ||
export * from 'node:os'; | ||
export { default } from 'node:os'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/path.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/path.ts'; | ||
export * from 'node:path'; | ||
export { default } from 'node:path'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/path/posix.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/path/posix.ts'; | ||
export * from 'node:path/posix'; | ||
export { default } from 'node:path/posix'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/path/win32.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/path/win32.ts'; | ||
export * from 'node:path/win32'; | ||
export { default } from 'node:path/win32'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/perf_hooks.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/perf_hooks.ts'; | ||
export * from 'node:perf_hooks'; | ||
export { default } from 'node:perf_hooks'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/process.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/process.ts'; | ||
export * from 'node:process'; | ||
export { default } from 'node:process'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/punycode.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/punycode.ts'; | ||
export * from 'node:punycode'; | ||
export { default } from 'node:punycode'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/querystring.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/querystring.ts'; | ||
export * from 'node:querystring'; | ||
export { default } from 'node:querystring'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/readline.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/readline.ts'; | ||
export * from 'node:readline'; | ||
export { default } from 'node:readline'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/stream.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/stream.ts'; | ||
export * from 'node:stream'; | ||
export { default } from 'node:stream'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/stream/consumers.mjs'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/stream/consumers.mjs'; | ||
export * from 'node:stream/consumers.mjs'; | ||
export { default } from 'node:stream/consumers.mjs'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/stream/promises.mjs'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/stream/promises.mjs'; | ||
export * from 'node:stream/promises.mjs'; | ||
export { default } from 'node:stream/promises.mjs'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/stream/web.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/stream/web.ts'; | ||
export * from 'node:stream/web'; | ||
export { default } from 'node:stream/web'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/string_decoder.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/string_decoder.ts'; | ||
export * from 'node:string_decoder'; | ||
export { default } from 'node:string_decoder'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/timers.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/timers.ts'; | ||
export * from 'node:timers'; | ||
export { default } from 'node:timers'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/timers/promises.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/timers/promises.ts'; | ||
export * from 'node:timers/promises'; | ||
export { default } from 'node:timers/promises'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/tls.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/tls.ts'; | ||
export * from 'node:tls'; | ||
export { default } from 'node:tls'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/tty.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/tty.ts'; | ||
export * from 'node:tty'; | ||
export { default } from 'node:tty'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/url.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/url.ts'; | ||
export * from 'node:url'; | ||
export { default } from 'node:url'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/util.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/util.ts'; | ||
export * from 'node:util'; | ||
export { default } from 'node:util'; |
@@ -1,47 +0,2 @@ | ||
import { types } from 'https://deno.land/std@0.173.0/node/util.ts'; | ||
export { types as default } from 'https://deno.land/std@0.173.0/node/util.ts'; | ||
export const { | ||
// isExternal, | ||
isDate, | ||
isArgumentsObject, | ||
isBigIntObject, | ||
isBooleanObject, | ||
isNumberObject, | ||
isStringObject, | ||
isSymbolObject, | ||
isNativeError, | ||
isRegExp, | ||
isAsyncFunction, | ||
isGeneratorFunction, | ||
isGeneratorObject, | ||
isPromise, | ||
isMap, | ||
isSet, | ||
isMapIterator, | ||
isSetIterator, | ||
isWeakMap, | ||
isWeakSet, | ||
isArrayBuffer, | ||
isDataView, | ||
isSharedArrayBuffer, | ||
// isProxy, | ||
isModuleNamespaceObject, | ||
isAnyArrayBuffer, | ||
isBoxedPrimitive, | ||
isArrayBufferView, | ||
isTypedArray, | ||
isUint8Array, | ||
isUint8ClampedArray, | ||
isUint16Array, | ||
isUint32Array, | ||
isInt8Array, | ||
isInt16Array, | ||
isInt32Array, | ||
isFloat32Array, | ||
isFloat64Array, | ||
isBigInt64Array, | ||
isBigUint64Array, | ||
// isKeyObject, | ||
// isCryptoKey | ||
} = types; | ||
export * from 'node:util/types'; | ||
export { default } from 'node:util/types'; |
@@ -1,2 +0,2 @@ | ||
export * from 'https://deno.land/std@0.173.0/node/v8.ts'; | ||
export { default } from 'https://deno.land/std@0.173.0/node/v8.ts'; | ||
export * from 'node:v8'; | ||
export { default } from 'node:v8'; |
@@ -1,16 +0,2 @@ | ||
import Context, { ContextOptions } from 'https://deno.land/std@0.173.0/wasi/snapshot_preview1.ts'; | ||
export interface WASIOptions extends Omit<ContextOptions, 'exitOnReturn'> { | ||
returnOnExit?: boolean; | ||
} | ||
export class WASI extends Context { | ||
readonly wasiImport: Context['exports']; | ||
constructor(options?: WASIOptions) { | ||
super(options && { ...options, exitOnReturn: options.returnOnExit }); | ||
this.wasiImport = this.exports; | ||
} | ||
} | ||
export default { WASI }; | ||
export * from 'node:wasi'; | ||
export { default } from 'node:wasi'; |
@@ -1,2 +0,2 @@ | ||
export { default } from 'https://deno.land/std@0.173.0/node/worker_threads.ts'; | ||
export * from 'https://deno.land/std@0.173.0/node/worker_threads.ts'; | ||
export { default } from 'node:worker_threads'; | ||
export * from 'node:worker_threads'; |
@@ -1,2 +0,2 @@ | ||
export { default } from 'https://deno.land/std@0.173.0/node/zlib.ts'; | ||
export * from 'https://deno.land/std@0.173.0/node/zlib.ts'; | ||
export { default } from 'node:zlib'; | ||
export * from 'node:zlib'; |
{ | ||
"name": "@jspm/core", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"scripts": { | ||
@@ -11,3 +11,3 @@ "build": "npm install -g chomp ; chomp" | ||
"@wasmer/wasi": "^0.12.0", | ||
"assert": "^2.0.0", | ||
"assert": "^2.1.0", | ||
"browserify-zlib": "^0.2.0", | ||
@@ -19,4 +19,4 @@ "buffer": "^6.0.3", | ||
"crypto-browserify": "^3.12.0", | ||
"diagnostics_channel": "^1.0.0", | ||
"domain-browser": "^4.22.0", | ||
"diagnostics_channel": "^1.1.0", | ||
"domain-browser": "^5.7.0", | ||
"events": "^3.3.0", | ||
@@ -30,6 +30,6 @@ "glob": "^7.1.7", | ||
"path-browserify": "^1.0.1", | ||
"punycode": "^2.1.1", | ||
"punycode": "^2.3.1", | ||
"querystring": "^0.2.1", | ||
"rollup": "^2.56.3", | ||
"stream-browserify": "^3.0.0", | ||
"readable-stream": "^4.5.2", | ||
"rollup": "^4.22.5", | ||
"stream-http": "^3.2.0", | ||
@@ -39,4 +39,4 @@ "string_decoder": "^1.3.0", | ||
"tty-browserify": "^0.0.1", | ||
"url": "^0.11.0", | ||
"util": "^0.12.4", | ||
"url": "^0.11.4", | ||
"util": "^0.12.5", | ||
"vm-browserify": "^1.1.2" | ||
@@ -53,7 +53,2 @@ }, | ||
"./nodelibs/chunk-*": null, | ||
"./nodelibs/dns/promises": { | ||
"deno": "./nodelibs/browser/dns/promises.js", | ||
"node": "./nodelibs/node/dns/promises.js", | ||
"default": "./nodelibs/browser/dns/promises.js" | ||
}, | ||
"./nodelibs/inspector": { | ||
@@ -78,12 +73,2 @@ "deno": "./nodelibs/deno/inspector.ts", | ||
"default": "./nodelibs/browser/process.js" | ||
}, | ||
"./nodelibs/zlib": { | ||
"deno": "./nodelibs/browser/zlib.js", | ||
"node": "./nodelibs/node/zlib.js", | ||
"default": "./nodelibs/browser/zlib.js" | ||
}, | ||
"./nodelibs/diagnostics_channel": { | ||
"deno": "./nodelibs/browser/diagnostics_channel.js", | ||
"node": "./nodelibs/node/diagnostics_channel.js", | ||
"default": "./nodelibs/browser/diagnostics_channel.js" | ||
} | ||
@@ -94,3 +79,4 @@ }, | ||
"url": "git+https://github.com/jspm/jspm-core.git" | ||
} | ||
}, | ||
"license": "Apache-2.0" | ||
} |
@@ -1,3 +0,3 @@ | ||
import stream from 'stream-browserify'; | ||
import stream from './stream.js'; | ||
export default stream.Duplex; | ||
export var from = stream.Duplex.from; |
@@ -1,2 +0,2 @@ | ||
import stream from 'stream-browserify'; | ||
import stream from './stream.js'; | ||
export default stream.PassThrough; |
@@ -1,2 +0,2 @@ | ||
import stream from 'stream-browserify'; | ||
import stream from './stream.js'; | ||
export default stream.Transform; |
@@ -1,3 +0,3 @@ | ||
import stream from 'stream-browserify'; | ||
import stream from './stream.js'; | ||
export default stream.Writable; | ||
export var WritableState = stream.Writable.WritableState; |
import crypto from 'crypto-browserify'; | ||
crypto.webcrypto = globalThis.crypto; | ||
crypto.getRandomValues = function (abv) { | ||
var l = abv.length; | ||
while (l--) { | ||
var bytes = crypto.randomBytes(7); | ||
var randomFloat = (bytes[0] % 32) / 32; | ||
for (var i = 0; i < bytes.length; i++) { | ||
var byte = bytes[i]; | ||
randomFloat = (randomFloat + byte) / 256; | ||
} | ||
abv[l] = Math.floor(randomFloat * 256); | ||
} | ||
return abv; | ||
} | ||
crypto.randomUUID = function () { | ||
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, function (c) { | ||
return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16); | ||
}); | ||
} | ||
export default crypto; | ||
@@ -44,1 +62,3 @@ export var Cipher = crypto.Cipher; | ||
export var webcrypto = crypto.webcrypto; | ||
export var getRandomValues = crypto.getRandomValues; | ||
export var randomUUID = crypto.randomUUID; |
@@ -68,3 +68,3 @@ var queue = []; | ||
PATH: '/usr/bin', | ||
LANG: navigator.language + '.UTF-8', | ||
LANG: typeof navigator !== 'undefined' ? navigator.language + '.UTF-8' : undefined, | ||
PWD: '/', | ||
@@ -99,2 +99,3 @@ HOME: '/home', | ||
export var browser = true; | ||
export var _rawDebug = noop; | ||
@@ -212,2 +213,3 @@ export var moduleLoadList = []; | ||
platform, | ||
browser, | ||
release, | ||
@@ -214,0 +216,0 @@ _rawDebug, |
@@ -71,3 +71,3 @@ function unimplemented(name) { | ||
PATH: '/usr/bin', | ||
LANG: navigator.language + '.UTF-8', | ||
LANG: typeof navigator !== 'undefined' ? navigator.language + '.UTF-8' : undefined, | ||
PWD: '/', | ||
@@ -102,2 +102,3 @@ HOME: '/home', | ||
export var browser = true; | ||
export var _rawDebug = noop; | ||
@@ -215,2 +216,3 @@ export var moduleLoadList = []; | ||
platform, | ||
browser, | ||
release, | ||
@@ -217,0 +219,0 @@ _rawDebug, |
@@ -1,2 +0,2 @@ | ||
import stream from 'stream-browserify'; | ||
import stream from 'readable-stream'; | ||
import { promisify } from './util.js'; | ||
@@ -26,2 +26,2 @@ export default stream; | ||
pipeline: promisify(stream.pipeline) | ||
}; | ||
} |
@@ -1,3 +0,3 @@ | ||
import util from 'util'; | ||
export * from 'util'; | ||
import util from './util.js'; | ||
export * from './util.js'; | ||
export default util; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6464078
274
138623
13