deep-state-observer
Advanced tools
Comparing version 5.4.0 to 5.5.0
@@ -26,2 +26,3 @@ export interface PathInfo { | ||
useSplitCache?: boolean; | ||
useIndicesCache?: boolean; | ||
maxSimultaneousJobs?: number; | ||
@@ -199,3 +200,5 @@ maxQueueRuns?: number; | ||
private match; | ||
private indices; | ||
private getIndicesOf; | ||
private indicesCount; | ||
private getIndicesCount; | ||
@@ -202,0 +205,0 @@ private cutPath; |
@@ -33,2 +33,3 @@ import WildcardObject from "./wildcard-object-scan"; | ||
useSplitCache?: boolean; | ||
useIndicesCache?: boolean; | ||
maxSimultaneousJobs?: number; | ||
@@ -234,2 +235,3 @@ maxQueueRuns?: number; | ||
useSplitCache: false, | ||
useIndicesCache: false, | ||
maxSimultaneousJobs: 1000, | ||
@@ -401,3 +403,5 @@ maxQueueRuns: 1000, | ||
private indices: Map<string, number[]> = new Map(); | ||
private getIndicesOf(searchStr: string, str: string): number[] { | ||
if (this.options.useIndicesCache && this.indices.has(str)) return this.indices.get(str); | ||
const searchStrLen = searchStr.length; | ||
@@ -414,6 +418,9 @@ if (searchStrLen == 0) { | ||
} | ||
if (this.options.useIndicesCache) this.indices.set(str, indices); | ||
return indices; | ||
} | ||
private indicesCount: Map<string, number> = new Map(); | ||
private getIndicesCount(searchStr: string, str: string): number { | ||
if (this.options.useIndicesCache && this.indicesCount.has(str)) return this.indicesCount.get(str); | ||
const searchStrLen = searchStr.length; | ||
@@ -430,2 +437,3 @@ if (searchStrLen == 0) { | ||
} | ||
if (this.options.useIndicesCache) this.indicesCount.set(str, indices); | ||
return indices; | ||
@@ -432,0 +440,0 @@ } |
{ | ||
"name": "deep-state-observer", | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"description": "Deep state observer is an state management library that will fire listeners only when specified object node (which also can be a wildcard) was changed.", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
545676
14058