Documentation
    Preparing search index...

    Function hasOptionalProperty

    • Check if an object has an optional property and if it has it, if the type is right

      TODO this function needs tests and some clarification in its description. I do not understand the description. I suppose it means to say "Check if an object either does not have a property or that the property's type matches the one supplied"?

      Parameters

      • obj: object
      • property: string
      • sat: (t: unknown) => boolean

      Returns boolean