Skip to content

Commit 3e4b0f2

Browse files
committed
chore: resolving some prettier issues
1 parent 7407ce8 commit 3e4b0f2

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

lib/dereference.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ function dereference$Ref<S extends object = JSONSchema, O extends ParserOptions<
309309
* @param startTime - The time when the dereferencing started.
310310
* @param options
311311
*/
312-
function checkDereferenceTimeout<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(startTime: number, options: O): void {
312+
function checkDereferenceTimeout<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
313+
startTime: number,
314+
options: O,
315+
): void {
313316
if (options && options.timeoutMs) {
314317
if (Date.now() - startTime > options.timeoutMs) {
315318
throw new TimeoutError(options.timeoutMs);

test/specs/circular-extensive/circular-extensive.spec.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ describe("Schema with an extensive amount of circular $refs", () => {
1818

1919
// Ensure that a non-circular $ref was dereferenced.
2020
expect(schema.components?.schemas?.ArrayOfMappedData).toStrictEqual({
21-
type: 'array',
21+
type: "array",
2222
items: {
23-
type: 'object',
23+
type: "object",
2424
properties: {
25-
mappingTypeName: { type: 'string' },
26-
sourceSystemValue: { type: 'string' },
27-
mappedValueID: { type: 'string' },
28-
mappedValue: { type: 'string' }
25+
mappingTypeName: { type: "string" },
26+
sourceSystemValue: { type: "string" },
27+
mappedValueID: { type: "string" },
28+
mappedValue: { type: "string" },
2929
},
30-
additionalProperties: false
31-
}
30+
additionalProperties: false,
31+
},
3232
});
3333

3434
// Ensure that a circular $ref **was** dereferenced.
3535
expect(circularRefs).toHaveLength(23);
3636
expect(schema.components?.schemas?.Customer?.properties?.customerNode).toStrictEqual({
37-
"type": "array",
38-
"items": {
39-
type: 'object',
37+
type: "array",
38+
items: {
39+
type: "object",
4040
properties: {
4141
customerNodeGuid: expect.any(Object),
4242
customerGuid: expect.any(Object),
4343
nodeId: expect.any(Object),
44-
customerGu: expect.any(Object)
44+
customerGu: expect.any(Object),
4545
},
46-
additionalProperties: false
46+
additionalProperties: false,
4747
},
4848
});
4949
});
@@ -55,31 +55,31 @@ describe("Schema with an extensive amount of circular $refs", () => {
5555
const schema = await parser.dereference(path.rel("test/specs/circular-extensive/schema.json"), {
5656
dereference: {
5757
onCircular: (ref: string) => circularRefs.add(ref),
58-
circular: 'ignore',
58+
circular: "ignore",
5959
},
6060
});
6161

6262
// Ensure that a non-circular $ref was dereferenced.
6363
expect(schema.components?.schemas?.ArrayOfMappedData).toStrictEqual({
64-
type: 'array',
64+
type: "array",
6565
items: {
66-
type: 'object',
66+
type: "object",
6767
properties: {
68-
mappingTypeName: { type: 'string' },
69-
sourceSystemValue: { type: 'string' },
70-
mappedValueID: { type: 'string' },
71-
mappedValue: { type: 'string' }
68+
mappingTypeName: { type: "string" },
69+
sourceSystemValue: { type: "string" },
70+
mappedValueID: { type: "string" },
71+
mappedValue: { type: "string" },
7272
},
73-
additionalProperties: false
74-
}
73+
additionalProperties: false,
74+
},
7575
});
7676

7777
// Ensure that a circular $ref was **not** dereferenced.
7878
expect(circularRefs).toHaveLength(23);
7979
expect(schema.components?.schemas?.Customer?.properties?.customerNode).toStrictEqual({
80-
"type": "array",
81-
"items": {
82-
"$ref": "#/components/schemas/CustomerNode",
80+
type: "array",
81+
items: {
82+
$ref: "#/components/schemas/CustomerNode",
8383
},
8484
});
8585
});
@@ -96,7 +96,9 @@ describe("Schema with an extensive amount of circular $refs", () => {
9696
} catch (err) {
9797
expect(err).to.be.an.instanceOf(ReferenceError);
9898
expect(err.message).to.contain("Circular $ref pointer found at ");
99-
expect(err.message).to.contain("specs/circular-extensive/schema.json#/components/schemas/AssignmentExternalReference/properties/assignment/oneOf/0");
99+
expect(err.message).to.contain(
100+
"specs/circular-extensive/schema.json#/components/schemas/AssignmentExternalReference/properties/assignment/oneOf/0",
101+
);
100102

101103
// $Refs.circular should be true
102104
expect(parser.$refs.circular).to.equal(true);

0 commit comments

Comments
 (0)