Skip to content

Commit

Permalink
fix: prevent error in service worker environment (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidg committed Jun 20, 2024
1 parent eaad58e commit 6145ea6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/txwrapper-core/src/core/metadata/createMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ export const createMetadata = memoizee(createMetadataUnmemoized, {
length: 4,
max:
!isBrowser &&
typeof process?.env?.TXWRAPPER_METADATA_CACHE_MAX !== 'undefined'
typeof process !== 'undefined' &&
typeof process.env?.TXWRAPPER_METADATA_CACHE_MAX !== 'undefined'
? parseInt(process.env.TXWRAPPER_METADATA_CACHE_MAX)
: undefined,
maxAge:
!isBrowser &&
typeof process?.env?.TXWRAPPER_METADATA_CACHE_MAX_AGE !== 'undefined'
typeof process !== 'undefined' &&
typeof process.env?.TXWRAPPER_METADATA_CACHE_MAX_AGE !== 'undefined'
? parseInt(process.env.TXWRAPPER_METADATA_CACHE_MAX_AGE)
: undefined,
});

0 comments on commit 6145ea6

Please sign in to comment.