function createChunk({ name, data }) {
  switch (name) {
    case 'IHDR':
      return new IHDRChunk({ data });
    case 'IDAT':
      return new IDATChunk({ data });
    case 'IEND':
      return new IENDChunk({ data });
    case 'tEXt':
      return new tEXtChunk({ data });
    case 'sRGB':
      return new sRGBChunk({ data });
    case 'bKGD':
      return new bKGDChunk({ data });
    case 'pHYs':
      return new pHYsChunk({ data });
    case 'tIME':
      return new tIMEChunk({ data });
    default:
      return new PNGChunk({ name, data });
  }
}
Function to create a PNG chunk from its name and data.

@param {string} name The PNG chunk's name.
@param {ArrayBuffer} data The PNG chunk's data.
@return {PNGChunk} An instance representing the PNG chunk.