Make client more ESM-friendly (#2348)

* Use node: prefix for stdlib imports

* Make code more ESM-friendly

* Add missing mjs file

* Drop mjs file from package.json
This commit is contained in:
Josh Mock
2024-08-22 11:18:31 -05:00
committed by GitHub
parent 715292b501
commit bf4c57f7bc
13 changed files with 44 additions and 38 deletions

View File

@ -18,12 +18,12 @@
*/
import FakeTimers from '@sinonjs/fake-timers'
import { AssertionError } from 'assert'
import { createReadStream } from 'fs'
import * as http from 'http'
import { join } from 'path'
import { AssertionError } from 'node:assert'
import { createReadStream } from 'node:fs'
import * as http from 'node:http'
import { join } from 'node:path'
import split from 'split2'
import { Readable } from 'stream'
import { Readable } from 'node:stream'
import { test } from 'tap'
import { Client, errors } from '../../../'
import { buildServer, connection } from '../../utils'
@ -936,11 +936,11 @@ test('bulk index', t => {
onDocument (doc) {
t.type(doc.user, 'string') // testing that doc is type of Document
return [
{
index: {
_index: 'test'
}
},
{
index: {
_index: 'test'
}
},
{ ...doc, updatedAt }
]
},
@ -1042,7 +1042,7 @@ test('bulk create', t => {
_index: 'test',
_id: String(id++)
}
},
},
{ ...doc, updatedAt }
]
},