Remove Node.js v8 support (#1402)

This commit is contained in:
Tomas Della Vedova
2021-02-19 08:27:20 +01:00
committed by GitHub
parent 7801b2cc13
commit ab5d8997b8
44 changed files with 258 additions and 302 deletions

View File

@ -57,7 +57,7 @@ async function run () {
})
// stream async iteration, available in Node.js ≥ 10
var payload = ''
let payload = ''
body.setEncoding('utf8')
for await (const chunk of body) {
payload += chunk
@ -65,7 +65,7 @@ async function run () {
console.log(JSON.parse(payload))
// classic stream callback style
var payload = ''
let payload = ''
body.setEncoding('utf8')
body.on('data', chunk => { payload += chunk })
body.on('error', console.log)
@ -101,4 +101,4 @@ fastify.post('/search/:index', async (req, reply) => {
})
fastify.listen(3000)
----
----

View File

@ -124,7 +124,7 @@ const client = new Client({ node: 'http://localhost:9200' })
// Scroll utility
async function * scrollSearch (params) {
var response = await client.search(params)
let response = await client.search(params)
while (true) {
const sourceHits = response.body.hits.hits
@ -190,4 +190,4 @@ async function run () {
}
run().catch(console.log)
----
----

View File

@ -58,7 +58,7 @@ async function run () {
const data = body.rows.map(row => {
const obj = {}
for (var i = 0; i < row.length; i++) {
for (let i = 0; i < row.length; i++) {
obj[body.columns[i].name] = row[i]
}
return obj