function createBufferInfoFromArrays(gl, arrays, opt_mapping) {
      const bufferInfo = {
        attribs: createAttribsFromArrays(gl, arrays, opt_mapping),
      };
      let indices = arrays.indices;
      if (indices) {
        indices = makeTypedArray(indices, 'indices');
        bufferInfo.indices = createBufferFromTypedArray(gl, indices, gl.ELEMENT_ARRAY_BUFFER);
        bufferInfo.numElements = indices.length;
      } else {
        bufferInfo.numElements = getNumElementsFromNonIndexedArrays(arrays);
      }
  
      return bufferInfo;
    }
Creates buffers from typed arrays

Given something like this

    let arrays = {
       positions: [1, 2, 3],
       normals: [0, 0, 1],
    }

returns something like

    buffers = {
      positions: WebGLBuffer,
      normals: WebGLBuffer,
    }

If the buffer is named 'indices' it will be made an ELEMENT_ARRAY_BUFFER.

@param {WebGLRenderingContext} gl A WebGLRenderingContext.
@param {Object<string, array|typedarray>} arrays
@return {Object<string, WebGLBuffer>} returns an object with one WebGLBuffer per array
@memberOf module:webgl-utils