Comparing version 2.14.0 to 2.14.1
2.14.1 / 2022-12-07 | ||
================== | ||
**fixes** | ||
* [[`cb92bc9`](http://github.com/koajs/koa/commit/cb92bc98939bd71fd3c01e2dc681caf6545baa38)] - fix: should export createAsyncCtxStorageMiddleware function on application (#1724) (fengmk2 <<fengmk2@gmail.com>>) | ||
2.14.0 / 2022-12-06 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -72,3 +72,3 @@ | ||
this.ctxStorage = new AsyncLocalStorage(); | ||
this.use(createAsyncCtxStorage(this)); | ||
this.use(this.createAsyncCtxStorageMiddleware()); | ||
} | ||
@@ -238,12 +238,13 @@ } | ||
} | ||
createAsyncCtxStorageMiddleware() { | ||
const app = this; | ||
return async function asyncCtxStorage(ctx, next) { | ||
await app.ctxStorage.run(ctx, async() => { | ||
return await next(); | ||
}); | ||
}; | ||
} | ||
}; | ||
function createAsyncCtxStorage(app) { | ||
return async function asyncCtxStorage(ctx, next) { | ||
await app.ctxStorage.run(ctx, async() => { | ||
return await next(); | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -250,0 +251,0 @@ * Response helper. |
{ | ||
"name": "koa", | ||
"version": "2.14.0", | ||
"version": "2.14.1", | ||
"description": "Koa web app framework", | ||
@@ -5,0 +5,0 @@ "main": "lib/application.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95114
1613