How to use the @ts-common/iterator.isEmpty function in @ts-common/iterator

To help you get started, we’ve selected a few @ts-common/iterator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / oav / lib / util / utils.ts View on Github external
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
  }
}