Skip to content

Commit

Permalink
chore: Format helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Apr 15, 2024
1 parent 1af8483 commit b9758f3
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions packages/helpers/esm/_using_ctx.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export function _using_ctx() {
var _disposeSuppressedError =
typeof SuppressedError === "function"
? // eslint-disable-next-line no-undef
SuppressedError
: (function (error, suppressed) {
var _disposeSuppressedError = typeof SuppressedError === "function"
// eslint-disable-next-line no-undef
? SuppressedError
: (function(error, suppressed) {
var err = new Error();
err.name = "SuppressedError";
err.suppressed = suppressed;
Expand All @@ -15,14 +14,11 @@ export function _using_ctx() {
function using(isAwait, value) {
if (value != null) {
if (Object(value) !== value) {
throw new TypeError(
"using declarations can only be used with objects, functions, null, or undefined.",
);
throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
}
// core-js-pure uses Symbol.for for polyfilling well-known symbols
if (isAwait) {
var dispose =
value[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
var dispose = value[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
}
if (dispose == null) {
dispose = value[Symbol.dispose || Symbol.for("Symbol.dispose")];
Expand All @@ -45,15 +41,14 @@ export function _using_ctx() {
// await using
a: using.bind(null, true),
// dispose
d: function () {
d: function() {
var error = this.e;

function next() {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
while ((resource = stack.pop())) {
try {
var resource,
disposalResult = resource.d && resource.d.call(resource.v);
var resource, disposalResult = resource.d && resource.d.call(resource.v);
if (resource.a) {
return Promise.resolve(disposalResult).then(next, err);
}
Expand All @@ -71,8 +66,9 @@ export function _using_ctx() {
}

return next();
},
}
};
}

export { _usingCtx as _ }
export { _usingCtx as _ };
export { _using_ctx as _ };

0 comments on commit b9758f3

Please sign in to comment.