Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get(key: unknown): T | undefined {
if (isObject(key) || typeof key === 'function') {
return this.weakMap.get(key as object);
} else {
return this.primitiveMap.get(key);
}
}
}
set(key: unknown, value: T) {
if (isObject(key) || typeof key === 'function') {
this.weakMap.set(key as object, value);
} else {
this.primitiveMap.set(key, value);
}
}