Remove Node.js v8 support (#1402)
This commit is contained in:
committed by
GitHub
parent
7801b2cc13
commit
ab5d8997b8
@ -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)
|
||||
----
|
||||
----
|
||||
|
||||
@ -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)
|
||||
----
|
||||
----
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user