index.js
function rebuildAttribute (attrib, data, itemSize) {
  if (attrib.itemSize !== itemSize) return true
  if (!attrib.array) return true
  var attribLength = attrib.array.length
  if (Array.isArray(data) && Array.isArray(data[0])) {
    // [ [ x, y, z ] ]
    return attribLength !== data.length * itemSize
  } else {
    // [ x, y, z ]
    return attribLength !== data.length
  }
  return false
}
function rebuildAttribute (attrib, data, itemSize) {
  if (attrib.itemSize !== itemSize) return true
  if (!attrib.array) return true
  var attribLength = attrib.array.length
  if (Array.isArray(data) && Array.isArray(data[0])) {
    // [ [ x, y, z ] ]
    return attribLength !== data.length * itemSize
  } else {
    // [ x, y, z ]
    return attribLength !== data.length
  }
  return false
}
function rebuildAttribute ( attrib , data , itemSize ) { if ( attrib . itemSize !== itemSize ) return true if ( ! attrib . array ) return true var attribLength = attrib . array . length if ( Array . isArray ( data ) && Array . isArray ( data [ 0 ] ) ) { // [ [ x, y, z ] ] return attribLength !== data . length * itemSize } else { // [ x, y, z ] return attribLength !== data . length } return false }
Test whether the attribute needs to be re-created, returns false if we can re-use it as-is.
Test whether the attribute needs to be re - created returns false if we can re - use it as - is .