function createBufferInfoFromArrays(gl, arrays, srcBufferInfo) {
  var newAttribs = createAttribsFromArrays(gl, arrays);
  var bufferInfo = Object.assign({}, srcBufferInfo ? srcBufferInfo : {});
  bufferInfo.attribs = Object.assign({}, srcBufferInfo ? srcBufferInfo.attribs : {}, newAttribs);
  var indices = arrays.indices;

  if (indices) {
    var newIndices = makeTypedArray(indices, "indices");
    bufferInfo.indices = createBufferFromTypedArray(gl, newIndices, ELEMENT_ARRAY_BUFFER);
    bufferInfo.numElements = newIndices.length;
    bufferInfo.elementType = typedArrays.getGLTypeForTypedArray(newIndices);
  } else if (!bufferInfo.numElements) {
    bufferInfo.numElements = getNumElementsFromAttributes(gl, bufferInfo.attribs);
  }

  return bufferInfo;
}
Creates a BufferInfo from an object of arrays.

This can be passed to {@link module:twgl.setBuffersAndAttributes} and to
{@link module:twgl:drawBufferInfo}.

Given an object like

    var arrays = {
      position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], },
      texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1],                 },
      normal:   { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1],     },
      indices:  { numComponents: 3, data: [0, 1, 2, 1, 2, 3],                       },
    };

 Creates an BufferInfo like this

    bufferInfo = {
      numElements: 4,        // or whatever the number of elements is
      indices: WebGLBuffer,  // this property will not exist if there are no indices
      attribs: {
        position: { buffer: WebGLBuffer, numComponents: 3, },
        normal:   { buffer: WebGLBuffer, numComponents: 3, },
        texcoord: { buffer: WebGLBuffer, numComponents: 2, },
      },
    };

 The properties of arrays can be JavaScript arrays in which case the number of components
 will be guessed.

    var arrays = {
       position: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0],
       texcoord: [0, 0, 0, 1, 1, 0, 1, 1],
       normal:   [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1],
       indices:  [0, 1, 2, 1, 2, 3],
    };

 They can also be TypedArrays

    var arrays = {
       position: new Float32Array([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]),
       texcoord: new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]),
       normal:   new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]),
       indices:  new Uint16Array([0, 1, 2, 1, 2, 3]),
    };

 Or AugmentedTypedArrays

    var positions = createAugmentedTypedArray(3, 4);
    var texcoords = createAugmentedTypedArray(2, 4);
    var normals   = createAugmentedTypedArray(3, 4);
    var indices   = createAugmentedTypedArray(3, 2, Uint16Array);

    positions.push([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]);
    texcoords.push([0, 0, 0, 1, 1, 0, 1, 1]);
    normals.push([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]);
    indices.push([0, 1, 2, 1, 2, 3]);

    var arrays = {
       position: positions,
       texcoord: texcoords,
       normal:   normals,
       indices:  indices,
    };

For the last example it is equivalent to

    var bufferInfo = {
      attribs: {
        position: { numComponents: 3, buffer: gl.createBuffer(), },
        texcoord: { numComponents: 2, buffer: gl.createBuffer(), },
        normal: { numComponents: 3, buffer: gl.createBuffer(), },
      },
      indices: gl.createBuffer(),
      numElements: 6,
    };

    gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.position.buffer);
    gl.bufferData(gl.ARRAY_BUFFER, arrays.position, gl.STATIC_DRAW);
    gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.texcoord.buffer);
    gl.bufferData(gl.ARRAY_BUFFER, arrays.texcoord, gl.STATIC_DRAW);
    gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.normal.buffer);
    gl.bufferData(gl.ARRAY_BUFFER, arrays.normal, gl.STATIC_DRAW);
    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferInfo.indices);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, arrays.indices, gl.STATIC_DRAW);

@param {WebGLRenderingContext} gl A WebGLRenderingContext
@param {module:twgl.Arrays} arrays Your data
@param {module:twgl.BufferInfo} [srcBufferInfo] An existing
       buffer info to start from. WebGLBuffers etc specified
       in the srcBufferInfo will be used in a new BufferInfo
       with any arrays specified overriding the ones in
       srcBufferInfo.
@return {module:twgl.BufferInfo} A BufferInfo
@memberOf module:twgl/attributes