Skip to content

Commit

Permalink
fix: adjust type to remove need for @types/lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jan 11, 2021
1 parent 5f6ac99 commit b7ac52b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/types/JSONSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,13 @@ export interface CustomTypeJSONSchema extends NormalizedJSONSchema {
tsType: string
}

export const getRootSchema = memoize(
(schema: LinkedJSONSchema): LinkedJSONSchema => {
const parent = schema[Parent]
if (!parent) {
return schema
}
return getRootSchema(parent)
export const getRootSchema: (schema: LinkedJSONSchema) => LinkedJSONSchema = memoize(schema => {
const parent = schema[Parent]
if (!parent) {
return schema
}
)
return getRootSchema(parent)
})

export function isPrimitive(schema: LinkedJSONSchema | JSONSchemaType): schema is JSONSchemaType {
return !isPlainObject(schema)
Expand Down

0 comments on commit b7ac52b

Please sign in to comment.