Skip to content

Commit 4dfc3e7

Browse files
committed
Improve performance of generating a cache key
1 parent 738498e commit 4dfc3e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/is-assignable/is-assignable-to-simple-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function isAssignableToSimpleType(typeA: SimpleType, typeB: SimpleType, c
4848
strictNullChecks: config?.strictNullChecks ?? config?.strict ?? true
4949
};
5050

51-
const cacheKey = JSON.stringify(config);
51+
const cacheKey = `${config.strict}:${config.strictFunctionTypes}:${config.strictNullChecks}`;
5252
const cache = DEFAULT_RESULT_CACHE.get(cacheKey) || new WeakMap();
5353
DEFAULT_RESULT_CACHE.set(cacheKey, cache);
5454

0 commit comments

Comments
 (0)