in src/Transport.ts [366:376]
get warnings () {
if (this.headers?.warning == null) {
return null
}
const { warning } = this.headers
// if multiple HTTP headers have the same name, Undici represents them as an array
const warnings: string[] = Array.isArray(warning) ? warning : [warning]
return warnings
.flatMap(w => w.split(/(?!\B"[^"]*),(?![^"]*"\B)/))
.filter((warning) => warning.match(/^\d\d\d Elasticsearch-/))
}