Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function isPureObject(model: SchemaObject): boolean {
if (!model) {
throw new Error(`model cannot be null or undefined and must be of type "object"`)
}
if (
model.type &&
typeof model.type.valueOf() === "string" &&
model.type === "object" &&
model.properties &&
it.isEmpty(sm.entries(model.properties))
) {
return true
} else if (!model.type && model.properties && it.isEmpty(sm.entries(model.properties))) {
return true
} else if (
model.type &&
typeof model.type.valueOf() === "string" &&
model.type === "object" &&
!model.properties &&
!model.additionalProperties
) {
return true
} else {
return false
}
}