node-switchbot
    Preparing search index...

    Class ParameterChecker

    Hierarchy

    • EventEmitter
      • ParameterChecker
    Index

    Constructors

    • Parameters

      • Optionaloptions: EventEmitterOptions

      Returns ParameterChecker

    Accessors

    Methods

    • Checks if the specified object contains valid values based on the provided rules.

      Parameters

      • obj: Record<string, unknown>

        Object including parameters you want to check.

      • rules: Record<string, Rule>

        Object including rules for the parameters.

      • Optionalrequired: boolean = false

        Flag whether the obj is required or not.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is an array.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is a boolean.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is a float.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is an integer.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is an object.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.
    • Checks if the value is specified (not undefined).

      Parameters

      • value: unknown

        The value to check.

      Returns boolean

      • True if the value is specified, false otherwise.
    • Checks if the value is a string.

      Parameters

      • value: unknown

        The value to check.

      • rule: Rule

        The rule object containing validation criteria.

      • Optionalname: string = 'value'

        The parameter name.

      Returns Promise<boolean>

      • Resolves to true if the value is valid, false otherwise.