{"size": 767, "ext": "js", "max_stars_repo_path": "proxyMap.js", "max_stars_repo_name": "Sergey01/jsSnippets", "max_stars_repo_stars_event_min_datetime": "2021-10-16T20:43:42.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-16T20:43:42.000Z", "max_issues_repo_path": "proxyMap.js", "max_issues_repo_name": "Sergey01/jsSnippets", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "proxyMap.js", "max_forks_repo_name": "Sergey01/jsSnippets", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.9583333333, "max_line_length": 83, "alphanum_fraction": 0.7588005215}
// Monkey patch for the native Javascript Proxy constructor function. This stores
// every created proxy as a key in a Map with the original object stored as the
// value. This should not be used in proxy intensive production sites as this does
// not use a WeakMap so this will impede garbage collection as the Map will retain
// references to objects (proxies and their targets) that would have otherwise been
// removed from memory.
//
// The native Proxy function can be called via "nativeProxy".

const proxyMap = new Map();

const nativeProxy = Proxy;

Proxy = function(target, handler) {
  
  const originalObject = target;

  const proxiedObject = new nativeProxy(target, handler);

  proxyMap.set(proxiedObject, originalObject);
  
  return proxiedObject;
}
