function flattenAtDepth(arr, depth) {
  for (let i = 0; i < arr.length; i++) {
    if (depth) {
      flattenAtDepth(arr[i], depth - 1)
    } else {
      arr[i] = arr[i][0]
    }
  }
}
@import {DecodedArray, SchemaTree} from '../src/types.d.ts'
@param {DecodedArray} arr
@param {number} depth