Skip to content

Commit 65ca712

Browse files
committed
fix: test are now passing
1 parent 24b9516 commit 65ca712

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@json-schema-tools/traverse",
33
"version": "0.0.0-development",
4-
"description": "",
4+
"description": "This package exports a method that will traverse a JSON-Schema, calling a mutation function for each sub schema found. It is useful for building tools to work with JSON Schemas.",
55
"main": "build/index.js",
66
"publishConfig": {
77
"access": "public"
@@ -11,7 +11,7 @@
1111
"build:docs": "typedoc",
1212
"test": "jest --coverage"
1313
},
14-
"author": "",
14+
"author": "Zachary Belford<belfordz66@gmail.com>",
1515
"license": "Apache-2.0",
1616
"devDependencies": {
1717
"@json-schema-tools/meta-schema": "^1.3.0",

src/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import traverse from "./";
2-
import { Properties, JSONSchemaObject } from "@json-schema-tools/meta-schema";
1+
import traverse, { MutationFunction } from "./";
2+
import { Properties, JSONSchemaObject, JSONSchema } from "@json-schema-tools/meta-schema";
33

44
describe("traverse", () => {
55
it("it calls mutate only once when there are no subschemas", () => {
@@ -35,7 +35,7 @@ describe("traverse", () => {
3535
}
3636
}));
3737

38-
const result = traverse(testSchema, mutator) as JSONSchemaObject;
38+
const result = traverse(testSchema, mutator as MutationFunction) as JSONSchemaObject;
3939

4040
expect(result.properties).toBeDefined();
4141

@@ -55,7 +55,7 @@ describe("traverse", () => {
5555

5656
const opts = { mergeNotMutate: true };
5757

58-
const result = traverse(testSchema, mergeProducer, opts) as JSONSchemaObject;
58+
const result = traverse(testSchema, mergeProducer as MutationFunction, opts) as JSONSchemaObject;
5959

6060
expect(result.properties).toBeDefined();
6161

@@ -420,8 +420,8 @@ describe("traverse", () => {
420420
},
421421
},
422422
};
423-
const result = traverse(schema, (s: JSONSchemaObject) => {
424-
if (s.$ref) { return schema; }
423+
const result = traverse(schema, (s: JSONSchema) => {
424+
if ((s as JSONSchemaObject).$ref) { return schema; }
425425
return s;
426426
}, { mutable: true }) as JSONSchemaObject;
427427

0 commit comments

Comments
 (0)