Skip to content

Commit

Permalink
ref(scope): Delete unused public getStack()
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Jul 3, 2024
1 parent 0c1e877 commit d3264ae
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/core/src/asyncContext/stackStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class AsyncContextStack {
assignedIsolationScope = isolationScope;
}

// scope stack for domains or the process
this._stack = [{ scope: assignedScope }];
this._isolationScope = assignedIsolationScope;
}
Expand Down Expand Up @@ -90,13 +91,6 @@ export class AsyncContextStack {
return this._isolationScope;
}

/**
* Returns the scope stack for domains or the process.
*/
public getStack(): Layer[] {
return this._stack;
}

/**
* Returns the topmost scope layer in the order domain > local > process.
*/
Expand All @@ -110,7 +104,7 @@ export class AsyncContextStack {
private _pushScope(): ScopeInterface {
// We want to clone the content of prev scope
const scope = this.getScope().clone();
this.getStack().push({
this._stack.push({
client: this.getClient(),
scope,
});
Expand All @@ -121,8 +115,8 @@ export class AsyncContextStack {
* Pop a scope from the stack.
*/
private _popScope(): boolean {
if (this.getStack().length <= 1) return false;
return !!this.getStack().pop();
if (this._stack.length <= 1) return false;
return !!this._stack.pop();
}
}

Expand Down

0 comments on commit d3264ae

Please sign in to comment.