Function notHasSize

  • check if array has a specific length

    Parameters

    • array: any[]
    • length: number
    • Optionalmessage: string

    Returns void

    hasSize([1, 2, 3], 3);
    
  • check if object has a specific amount of keys

    Parameters

    • object: Record<string, unknown>
    • length: number
    • Optionalmessage: string

    Returns void

    hasSize({a: 1, b: 2}, 2);
    
  • check if Map has a specific amount of keys

    Parameters

    • map: Map<unknown, unknown>
    • length: number
    • Optionalmessage: string

    Returns void

    hasSize(new Map([['a', 1], ['b', 2]]), 2);
    
  • check if Set has a specific amount of members

    Parameters

    • set: Set<unknown>
    • length: number
    • Optionalmessage: string

    Returns void

    hasSize(new Set([1, 2, 3]), 3);
    
  • check if string has a specific length

    Parameters

    • string: string
    • length: number
    • Optionalmessage: string

    Returns void

    hasSize('abc', 3);