Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
if (primitive.indices && duplicateAccessors.has(primitive.indices)) {
primitive.indices = duplicateAccessors.get(primitive.indices);
}
});
});
// Clean up.
const removedAccessors = Array.from(duplicateAccessors).map(([dup, _]) => dup);
removedAccessors.sort((a, b) => a > b ? -1 : 1); // sort descending
removedAccessors.forEach((index) => GLTFUtil.removeAccessor(container, index));
for (let i = container.json.bufferViews.length - 1; i >= 0; i--) {
const bufferView = container.json.bufferViews[i];
if (bufferView.byteLength === 0) {
GLTFUtil.removeBufferView(container, i);
}
}
return container;
}
removedBufferViews.forEach((index) => GLTFUtil.removeBufferView(container, index));