@busy-hour/blaze
Advanced tools
Comparing version 3.3.3 to 3.3.4
@@ -5,2 +5,9 @@ # Changelog | ||
## [3.3.4](https://github.com/Busy-Hour-Studio/blaze/compare/v3.3.3...v3.3.4) (2024-07-28) | ||
### Bug Fixes | ||
* empty context data ([abd4b44](https://github.com/Busy-Hour-Studio/blaze/commit/abd4b444648d490a91e0f238b873e0abe02d5cd5)) | ||
## [3.3.3](https://github.com/Busy-Hour-Studio/blaze/compare/v3.3.2...v3.3.3) (2024-07-12) | ||
@@ -7,0 +14,0 @@ |
@@ -153,9 +153,17 @@ "use strict"; | ||
const cachedCtx = honoCtx?.get?.("blaze"); | ||
const cachedData = cachedCtx?.meta?.get?.("isCached"); | ||
const isCached = cachedCtx?.meta?.get?.("isCached"); | ||
const data = { | ||
body: cachedData ? await cachedCtx?.request?.body?.() : null, | ||
params: cachedData ? cachedCtx?.request?.params : null, | ||
headers: cachedData ? cachedCtx?.request?.headers : null, | ||
query: cachedData ? cachedCtx?.request?.query : null | ||
body: isCached ? await cachedCtx?.request?.body?.() : null, | ||
params: isCached ? cachedCtx?.request?.params : null, | ||
headers: isCached ? cachedCtx?.request?.headers : null, | ||
query: isCached ? cachedCtx?.request?.query : null | ||
}; | ||
if (options.body && !data.body) | ||
data.body = options.body; | ||
if (options.params && !data.params) | ||
data.params = options.params; | ||
if (options.headers && !data.headers) | ||
data.headers = options.headers; | ||
if (options.query && !data.query) | ||
data.query = options.query; | ||
const validations = { | ||
@@ -162,0 +170,0 @@ body: true, |
@@ -126,9 +126,17 @@ // src/internal/BlazeContext.ts | ||
const cachedCtx = honoCtx?.get?.("blaze"); | ||
const cachedData = cachedCtx?.meta?.get?.("isCached"); | ||
const isCached = cachedCtx?.meta?.get?.("isCached"); | ||
const data = { | ||
body: cachedData ? await cachedCtx?.request?.body?.() : null, | ||
params: cachedData ? cachedCtx?.request?.params : null, | ||
headers: cachedData ? cachedCtx?.request?.headers : null, | ||
query: cachedData ? cachedCtx?.request?.query : null | ||
body: isCached ? await cachedCtx?.request?.body?.() : null, | ||
params: isCached ? cachedCtx?.request?.params : null, | ||
headers: isCached ? cachedCtx?.request?.headers : null, | ||
query: isCached ? cachedCtx?.request?.query : null | ||
}; | ||
if (options.body && !data.body) | ||
data.body = options.body; | ||
if (options.params && !data.params) | ||
data.params = options.params; | ||
if (options.headers && !data.headers) | ||
data.headers = options.headers; | ||
if (options.query && !data.query) | ||
data.query = options.query; | ||
const validations = { | ||
@@ -135,0 +143,0 @@ body: true, |
@@ -7,3 +7,3 @@ { | ||
"type": "module", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "devDependencies": { |
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
231420
5998