encodeResource = ({ type, name, configEntries }) => {
  return new Encoder()
    .writeInt8(type)
    .writeString(name)
    .writeArray(configEntries.map(encodeConfigEntries))
}
@param {Array} resources An array of resources to change
@param {boolean} [validateOnly=false]