Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@creditkarma/async-scope

Package Overview
Dependencies
Maintainers
5
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creditkarma/async-scope - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

3

dist/main/AsyncScope.d.ts

@@ -1,2 +0,2 @@

import { IAsyncOptions, IAsyncScope } from './types';
import { IAsyncOptions, IAsyncScope, ISizeProfile } from './types';
export declare class AsyncScope implements IAsyncScope {

@@ -16,2 +16,3 @@ static debug(msg: string, ...args: Array<any>): void;

lineage(): Array<number>;
size(): ISizeProfile;
private removeOldest();

@@ -18,0 +19,0 @@ private addNode(asyncId, parentId);

@@ -73,2 +73,8 @@ "use strict";

}
size() {
return {
size: this.asyncMap.size,
maxSize: this.maxSize,
};
}
removeOldest() {

@@ -75,0 +81,0 @@ const oldestId = this.asyncMap.oldestId;

@@ -30,1 +30,5 @@ import { IAsyncHooks } from '@creditkarma/async-hooks';

}
export interface ISizeProfile {
size: number;
maxSize: number;
}
{
"name": "@creditkarma/async-scope",
"version": "0.0.10",
"version": "0.0.11",
"description": "A thread local approximation built on async hooks, written in TypeScript",

@@ -5,0 +5,0 @@ "main": "dist/main/index.js",

@@ -106,2 +106,22 @@ # Async Scope

#### `size`
Returns an object describing the size of the current store.
```typescript
interface ISizeProfile {
size: number
maxSize: number
}
```
The object contains two properties. First `size` is the current number of scopes being tracked by the store. Second `maxSize` is the maximum number the store will hold before it starts ejecting old scopes.
```typescript
import { AsyncScope } from '@creditkarma/async-scope'
const asyncScope: AsyncScope = new AsyncScope()
console.log(asyncScope.size())
```
## Contributing

@@ -108,0 +128,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc