@opencrvs/toolkit 2.0.0-rc.ff04b30 → 2.0.0-rc.ff8df64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2394,14 +2394,20 @@ var encodeScope = (scope) => {
2394
2394
  encode: false
2395
2395
  });
2396
2396
  };
2397
- var decodeScope = (query) => {
2398
- const scope = qs.parse(query, {
2397
+ var decodedScopeCache = /* @__PURE__ */ new Map();
2398
+ var decodeScope = (encodedScope) => {
2399
+ if (decodedScopeCache.has(encodedScope)) {
2400
+ return decodedScopeCache.get(encodedScope);
2401
+ }
2402
+ const scope = qs.parse(encodedScope, {
2399
2403
  ignoreQueryPrefix: true,
2400
2404
  comma: true,
2401
2405
  allowDots: true
2402
2406
  });
2403
2407
  const unflattenedScope = unflattenScope(scope);
2404
- return Scope2.safeParse(unflattenedScope)?.data;
2408
+ const result = Scope2.safeParse(unflattenedScope)?.data;
2409
+ decodedScopeCache.set(encodedScope, result);
2410
+ return result;
2405
2411
  };
2406
2412
  var DEFAULT_SCOPE_OPTIONS = {
2407
2413
  placeOfEvent: JurisdictionFilter.enum.all,