Skip to content

Commit 43e0d11

Browse files
committed
refactor: simplify method signatures in SchemaComponentsMap
1 parent a51f6b1 commit 43e0d11

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/schema-components-map.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class SchemaComponentsMap {
1313
this._data = [];
1414
}
1515

16-
createRef = (paths: string[]): string => {
16+
createRef = (paths: string[]) => {
1717
if (!Array.isArray(paths)) {
1818
throw new Error(`Expected an array, but received: ${typeof paths}`);
1919
}
@@ -23,7 +23,7 @@ export class SchemaComponentsMap {
2323
return ["#", ...paths].join("/");
2424
};
2525

26-
parseRef = (ref: string): string[] => {
26+
parseRef = (ref: string) => {
2727
if (!ref.startsWith("#/")) {
2828
throw new Error(`Invalid ref format: ${ref}. It should start with "#/"`);
2929
}
@@ -32,7 +32,7 @@ export class SchemaComponentsMap {
3232

3333
createComponent(
3434
$ref: string,
35-
rawTypeData: SchemaComponent["rawTypeData"]
35+
rawTypeData: SchemaComponent["rawTypeData"],
3636
): SchemaComponent {
3737
const parsed = this.parseRef($ref);
3838
const typeName = parsed[parsed.length - 1]!;
@@ -69,8 +69,8 @@ export class SchemaComponentsMap {
6969
filter(...componentNames: (string[] | string)[]) {
7070
return this._data.filter((it) =>
7171
componentNames.some((componentName) =>
72-
it.$ref.startsWith(`#/components/${componentName}`)
73-
)
72+
it.$ref.startsWith(`#/components/${componentName}`),
73+
),
7474
);
7575
}
7676

0 commit comments

Comments
 (0)