src/utils/array.js
function _squeeze (array, dims, dim) {
  let i, ii

  if (dim < dims) {
    const next = dim + 1
    for (i = 0, ii = array.length; i < ii; i++) {
      array[i] = _squeeze(array[i], dims, next)
    }
  } else {
    while (Array.isArray(array)) {
      array = array[0]
    }
  }

  return array
}
function _squeeze (array, dims, dim) {
  let i, ii

  if (dim < dims) {
    const next = dim + 1
    for (i = 0, ii = array.length; i < ii; i++) {
      array[i] = _squeeze(array[i], dims, next)
    }
  } else {
    while (Array.isArray(array)) {
      array = array[0]
    }
  }

  return array
}
function _squeeze ( array , dims , dim ) { let i , ii if ( dim < dims ) { const next = dim + 1 for ( i = 0 , ii = array . length ; i < ii ; i ++ ) { array [ i ] = _squeeze ( array [ i ] , dims , next ) } } else { while ( Array . isArray ( array ) ) { array = array [ 0 ] } } return array }
Recursively squeeze a multi dimensional array
@param {Array} array
@param {number} dims Required number of dimensions
@param {number} dim  Current dimension
@returns {Array | *} Returns the squeezed array
@private
Recursively squeeze a multi dimensional array