Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ndarray/base/assert/is-buffer-length-compatible-shape/docs/types/index.d"

Index

Functions

Export assignment isBufferLengthCompatibleShape

  • isBufferLengthCompatibleShape(len: number, shape: ArrayLike<number>): boolean
  • Returns a boolean indicating if a buffer length is compatible with a provided shape array.

    Parameters

    • len: number

      buffer length

    • shape: ArrayLike<number>

      array shape

    Returns boolean

    boolean indicating if a buffer length is compatible with a provided shape array

    Example

    var shape = [ 2, 2 ];
    
    var bool = isBufferLengthCompatibleShape( 4, shape );
    // returns true

    Example

    var shape = [ 2, 2 ];
    
    var bool = isBufferLengthCompatibleShape( 3, shape );
    // returns false