Skip to content

Commit 3cca3f5

Browse files
committed
move JSONSchema to types.ts
1 parent d16ef24 commit 3cca3f5

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import { convertInternalToExpanded } from './schema-converters/internalToExpande
2121
import { convertInternalToMongodb } from './schema-converters/internalToMongoDB';
2222
import { convertInternalToStandard } from './schema-converters/internalToStandard';
2323
import * as schemaStats from './stats';
24-
import { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema } from './types';
25-
import type { JSONSchema } from './to-typescript';
24+
import { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema } from './types';
2625
import { toTypescriptTypeDefinition } from './to-typescript';
2726

2827
/**

src/to-typescript.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import type { JSONSchema4 } from 'json-schema';
2-
import type { MongoDBJSONSchema } from './types';
3-
4-
export type JSONSchema = Partial<JSONSchema4> & MongoDBJSONSchema;
1+
import type { JSONSchema } from './types';
52

63
function getBSONType(property: JSONSchema): string | string[] | undefined {
74
return property.bsonType || property.type;

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export type ExpandedJSONSchema = StandardJSONSchema & {
2323
anyOf?: ExpandedJSONSchema[];
2424
}
2525

26+
export type JSONSchema = Partial<JSONSchema4> & MongoDBJSONSchema;
27+
2628
export type AnyIterable<T = any> = Iterable<T> | AsyncIterable<T>;
2729

2830
type AnySchema = InternalSchema | StandardJSONSchema | MongoDBJSONSchema | ExpandedJSONSchema;

0 commit comments

Comments
 (0)