cachebranch
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -303,3 +303,6 @@ "use strict"; | ||
*/ | ||
clone(strategy) { | ||
clone(strategy = "deep-copy") { | ||
if (strategy && typeof strategy !== "string") { | ||
return strategy(this.raw); | ||
} | ||
switch (strategy) { | ||
@@ -310,2 +313,3 @@ case "array-shallow-copy": | ||
return Object.assign({}, this.raw); | ||
case "deep-copy": | ||
default: | ||
@@ -312,0 +316,0 @@ return _CacheData.StructuredClone(this.raw); |
@@ -276,3 +276,6 @@ // src/base/CacheBranch.ts | ||
*/ | ||
clone(strategy) { | ||
clone(strategy = "deep-copy") { | ||
if (strategy && typeof strategy !== "string") { | ||
return strategy(this.raw); | ||
} | ||
switch (strategy) { | ||
@@ -283,2 +286,3 @@ case "array-shallow-copy": | ||
return Object.assign({}, this.raw); | ||
case "deep-copy": | ||
default: | ||
@@ -285,0 +289,0 @@ return _CacheData.StructuredClone(this.raw); |
import type { NullableCacheDataGenerator, CacheDataCopy } from '../types'; | ||
export type CacheDataCloneStrategy = 'array-shallow-copy' | 'object-shallow-copy'; | ||
export type CacheDataCloneStrategy = 'array-shallow-copy' | 'object-shallow-copy' | 'deep-copy'; | ||
export declare abstract class CacheData<T> { | ||
@@ -4,0 +4,0 @@ static IsDirty<T>(data: CacheData<T>): boolean; |
{ | ||
"name": "cachebranch", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Not only caches data in a key-value format but also supports efficient data management with a hierarchical structure.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.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
45219
1093