Skip to content

Commit

Permalink
fix: Resolve bind error when copy function is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
izure1 committed Sep 22, 2024
1 parent 739d173 commit fafab49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cache-entanglement",
"version": "1.1.4",
"version": "1.1.5",
"description": "Manage caches that are dependent on each other efficiently.",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand Down
4 changes: 3 additions & 1 deletion src/CacheData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ type CacheDataCloneStrategy = 'array-shallow-copy'|'object-shallow-copy'|'deep-c
type CacheDataCopy<T> = (raw: T) => T

export class CacheData<T> {
protected static readonly StructuredClone = globalThis.structuredClone.bind(globalThis) ?? ungapStructuredClone.bind(globalThis)
protected static readonly StructuredClone = globalThis.structuredClone ?
globalThis.structuredClone.bind(globalThis) :
ungapStructuredClone.bind(globalThis)

private readonly _value: T

Expand Down

0 comments on commit fafab49

Please sign in to comment.