From 51816f0b8eb6e8039e0542e8dbda0aafde737fa0 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 21 Oct 2023 19:49:12 +0100 Subject: [PATCH] perf(lib/ref-resolver): optimize split param --- lib/ref-resolver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ref-resolver.js b/lib/ref-resolver.js index 9b1c63b4..28a6f324 100644 --- a/lib/ref-resolver.js +++ b/lib/ref-resolver.js @@ -75,7 +75,7 @@ class RefResolver { const ref = schema.$ref if (ref !== undefined && typeof ref === 'string') { if (ref.charAt(0) !== '#') { - const dependencySchemaId = ref.split('#')[0] + const dependencySchemaId = ref.split('#', 1)[0] this.schemas[rootSchemaId].dependencies.push(dependencySchemaId) } }