Skip to content

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4518
-2857
lines changed

package-lock.json

Lines changed: 4380 additions & 2722 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"private": true,
44
"type": "module",
55
"devDependencies": {
6-
"husky": "^7.0.4",
6+
"husky": "^8.0.3",
77
"lerna": "^4.0.0",
8-
"lint-staged": "^12.3.7",
9-
"standard": "^16.0.4",
10-
"ts-standard": "^11.0.0",
11-
"typescript": "^4.6.3"
8+
"lint-staged": "^14.0.0",
9+
"standard": "^17.1.0",
10+
"ts-standard": "^12.0.2",
11+
"typescript": "^4.9.5"
1212
},
1313
"lint-staged": {
1414
"*.{js,md,html}": [

packages/bolt-connection/src/bolt/bolt-protocol-v1.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default class BoltProtocol {
202202
logoff ({ onComplete, onError, flush } = {}) {
203203
const observer = new LogoffObserver({
204204
onCompleted: onComplete,
205-
onError: onError
205+
onError
206206
})
207207

208208
// TODO: Verify the Neo4j version in the message
@@ -284,8 +284,8 @@ export default class BoltProtocol {
284284
'BEGIN',
285285
bookmarks ? bookmarks.asBeginTransactionParameters() : {},
286286
{
287-
bookmarks: bookmarks,
288-
txConfig: txConfig,
287+
bookmarks,
288+
txConfig,
289289
database,
290290
mode,
291291
impersonatedUser,

packages/bolt-connection/src/bolt/bolt-protocol-v4x0.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export default class BoltProtocol extends BoltProtocolV3 {
111111
) {
112112
const observer = new ResultStreamObserver({
113113
server: this._server,
114-
reactive: reactive,
115-
fetchSize: fetchSize,
114+
reactive,
115+
fetchSize,
116116
moreFunction: this._requestMore.bind(this),
117117
discardFunction: this._requestDiscard.bind(this),
118118
beforeKeys,

packages/bolt-connection/src/bolt/bolt-protocol-v4x4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export default class BoltProtocol extends BoltProtocolV43 {
104104
) {
105105
const observer = new ResultStreamObserver({
106106
server: this._server,
107-
reactive: reactive,
108-
fetchSize: fetchSize,
107+
reactive,
108+
fetchSize,
109109
moreFunction: this._requestMore.bind(this),
110110
discardFunction: this._requestDiscard.bind(this),
111111
beforeKeys,

packages/bolt-connection/src/bolt/bolt-protocol-v5x1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default class BoltProtocol extends BoltProtocolV5x0 {
123123
logoff ({ onComplete, onError, flush } = {}) {
124124
const observer = new LogoffObserver({
125125
onCompleted: onComplete,
126-
onError: onError
126+
onError
127127
})
128128

129129
this.write(

packages/bolt-connection/src/bolt/bolt-protocol-v5x2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ export default class BoltProtocol extends BoltProtocolV5x1 {
137137
) {
138138
const observer = new ResultStreamObserver({
139139
server: this._server,
140-
reactive: reactive,
141-
fetchSize: fetchSize,
140+
reactive,
141+
fetchSize,
142142
moreFunction: this._requestMore.bind(this),
143143
discardFunction: this._requestDiscard.bind(this),
144144
beforeKeys,

packages/bolt-connection/src/channel/browser/browser-channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function determineWebSocketScheme (config, protocolSupplier) {
359359
ENCRYPTION_OFF +
360360
'"` in the driver configuration.'
361361
)
362-
return { scheme: null, error: error }
362+
return { scheme: null, error }
363363
}
364364
}
365365

packages/bolt-connection/src/channel/channel-buf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function newChannelJSBuffer (arg) {
9595
return buffer.Buffer.alloc(arg)
9696
} else {
9797
// fallback to the old, potentially deprecated constructor
98-
// eslint-disable-next-line node/no-deprecated-api
98+
// eslint-disable-next-line n/no-deprecated-api
9999
return new buffer.Buffer(arg)
100100
}
101101
}

packages/bolt-connection/src/channel/node/node-channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function newTlsOptions (hostname, ca = undefined) {
206206
return {
207207
rejectUnauthorized: false, // we manually check for this in the connect callback, to give a more helpful error to the user
208208
servername: hostname, // server name for the SNI (Server Name Indication) TLS extension
209-
ca: ca // optional CA useful for TRUST_CUSTOM_CA_SIGNED_CERTIFICATES trust mode
209+
ca // optional CA useful for TRUST_CUSTOM_CA_SIGNED_CERTIFICATES trust mode
210210
}
211211
}
212212

packages/bolt-connection/src/channel/utf8.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function newBuffer (str) {
9393
if (typeof buffer.Buffer.from === 'function') {
9494
return buffer.Buffer.from(str, 'utf8')
9595
} else {
96-
// eslint-disable-next-line node/no-deprecated-api
96+
// eslint-disable-next-line n/no-deprecated-api
9797
return new buffer.Buffer(str, 'utf8')
9898
}
9999
}

packages/bolt-connection/src/rediscovery/routing-table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ function parseServers (rawRoutingTable, routerAddress) {
200200
})
201201

202202
return {
203-
routers: routers,
204-
readers: readers,
205-
writers: writers
203+
routers,
204+
readers,
205+
writers
206206
}
207207
} catch (error) {
208208
throw newError(

packages/bolt-connection/test/bolt/bolt-protocol-v1.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('#unit BoltProtocolV1', () => {
174174
const bookmarks = new Bookmarks('neo4j:bookmark:v1:tx42')
175175

176176
const observer = protocol.beginTransaction({
177-
bookmarks: bookmarks,
177+
bookmarks,
178178
txConfig: TxConfig.empty(),
179179
mode: WRITE
180180
})

packages/bolt-connection/test/bolt/bolt-protocol-v5x3.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ describe('#unit BoltProtocolV5x3', () => {
275275
}
276276
const authToken = { username: 'neo4j', password: 'secret' }
277277

278-
const observer = protocol.initialize({ userAgent: clientName, boltAgent: boltAgent, authToken })
278+
const observer = protocol.initialize({ userAgent: clientName, boltAgent, authToken })
279279

280280
protocol.verifyMessageCount(2)
281281
expect(protocol.messages[0]).toBeMessage(

packages/bolt-connection/test/bolt/stream-observer.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ describe('#unit ResultStreamObserver', () => {
388388
const more = jest.fn()
389389
const streamObserver = new ResultStreamObserver({
390390
moreFunction: more,
391-
fetchSize: fetchSize
391+
fetchSize
392392
})
393393

394394
streamObserver.pause()
@@ -418,7 +418,7 @@ describe('#unit ResultStreamObserver', () => {
418418
const more = jest.fn()
419419
const streamObserver = new ResultStreamObserver({
420420
moreFunction: more,
421-
fetchSize: fetchSize,
421+
fetchSize,
422422
reactive: true
423423
})
424424
streamObserver.pause()
@@ -441,7 +441,7 @@ describe('#unit ResultStreamObserver', () => {
441441
const more = jest.fn()
442442
const streamObserver = new ResultStreamObserver({
443443
moreFunction: more,
444-
fetchSize: fetchSize,
444+
fetchSize,
445445
reactive: true
446446
})
447447
streamObserver.pause()
@@ -462,7 +462,7 @@ describe('#unit ResultStreamObserver', () => {
462462
const more = jest.fn()
463463
const streamObserver = new ResultStreamObserver({
464464
moreFunction: more,
465-
fetchSize: fetchSize,
465+
fetchSize,
466466
reactive: false
467467
})
468468
streamObserver.pause()
@@ -485,7 +485,7 @@ describe('#unit ResultStreamObserver', () => {
485485
const more = jest.fn()
486486
const streamObserver = new ResultStreamObserver({
487487
moreFunction: more,
488-
fetchSize: fetchSize
488+
fetchSize
489489
})
490490

491491
streamObserver.pause()
@@ -508,7 +508,7 @@ describe('#unit ResultStreamObserver', () => {
508508
const more = jest.fn()
509509
const streamObserver = new ResultStreamObserver({
510510
moreFunction: more,
511-
fetchSize: fetchSize
511+
fetchSize
512512
})
513513

514514
streamObserver.pause()
@@ -541,7 +541,7 @@ describe('#unit ResultStreamObserver', () => {
541541
const more = jest.fn()
542542
const streamObserver = new ResultStreamObserver({
543543
moreFunction: more,
544-
fetchSize: fetchSize
544+
fetchSize
545545
})
546546

547547
streamObserver.pause()
@@ -570,7 +570,7 @@ describe('#unit ResultStreamObserver', () => {
570570
const more = jest.fn()
571571
const streamObserver = new ResultStreamObserver({
572572
moreFunction: more,
573-
fetchSize: fetchSize
573+
fetchSize
574574
})
575575

576576
streamObserver.pause()
@@ -610,7 +610,7 @@ describe('#unit ResultStreamObserver', () => {
610610
const more = jest.fn()
611611
const streamObserver = new ResultStreamObserver({
612612
moreFunction: more,
613-
fetchSize: fetchSize
613+
fetchSize
614614
})
615615

616616
streamObserver.pause()
@@ -985,8 +985,8 @@ function newStreamObserver (server) {
985985

986986
function newObserver (onNext = NO_OP, onError = NO_OP, onCompleted = NO_OP) {
987987
return {
988-
onNext: onNext,
989-
onError: onError,
990-
onCompleted: onCompleted
988+
onNext,
989+
onError,
990+
onCompleted
991991
}
992992
}

packages/bolt-connection/test/channel/browser/browser-channel.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ describe('WebSocketChannel', () => {
253253
const address = ServerAddress.fromUrl('bolt://localhost:8989')
254254
const config = new ChannelConfig(
255255
address,
256-
{ encrypted: encrypted },
256+
{ encrypted },
257257
SERVICE_UNAVAILABLE
258258
)
259259
const protocolSupplier = () => (scheme != null ? scheme + ':' : scheme)

packages/bolt-connection/test/connection-provider/connection-provider-direct.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ function newDirectConnectionProvider (address, pool, authTokenManager) {
735735
id: 0,
736736
config: {},
737737
log: Logger.noOp(),
738-
address: address,
738+
address,
739739
authTokenManager
740740
})
741741
connectionProvider._connectionPool = pool

packages/bolt-connection/test/connection-provider/connection-provider-routing.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3727,7 +3727,7 @@ describe.each([
37273727
hostNameResolver: new SimpleHostNameResolver(),
37283728
config: {},
37293729
log: Logger.noOp(),
3730-
routingTablePurgeDelay: routingTablePurgeDelay
3730+
routingTablePurgeDelay
37313731
})
37323732
connectionProvider._connectionPool = pool
37333733
routingTables.forEach(r => {

packages/bolt-connection/test/pool/pool.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ describe('#unit Pool', () => {
731731
// Create a fake connection that makes it possible control when it's connected
732732
// and released from the outer scope.
733733
const conn = {
734-
server: server,
735-
release: release
734+
server,
735+
release
736736
}
737737
const promise = new Promise((resolve, reject) => {
738738
conn.resolve = resolve
@@ -1204,8 +1204,8 @@ describe('#unit Pool', () => {
12041204
const pool = new Pool({
12051205
create: (_, server, release) =>
12061206
Promise.resolve(new Resource(server, counter++, release)),
1207-
destroy: destroy,
1208-
removeIdleObserver: removeIdleObserver,
1207+
destroy,
1208+
removeIdleObserver,
12091209
config: new PoolConfig(1, 5000)
12101210
})
12111211

packages/core/src/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const auth = {
3434
scheme: 'basic',
3535
principal: username,
3636
credentials: password,
37-
realm: realm
37+
realm
3838
}
3939
} else {
4040
return { scheme: 'basic', principal: username, credentials: password }
@@ -66,8 +66,8 @@ const auth = {
6666
parameters?: object
6767
) => {
6868
const output: any = {
69-
scheme: scheme,
70-
principal: principal
69+
scheme,
70+
principal
7171
}
7272
if (isNotEmpty(credentials)) {
7373
output.credentials = credentials

packages/core/src/graph-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ function isPath<T extends NumberOrInteger = Integer> (obj: unknown): obj is Path
461461
return hasIdentifierProperty(obj, PATH_IDENTIFIER_PROPERTY)
462462
}
463463

464-
function _valueOrGetDefault<T> (value: T|undefined|null, getDefault: () => T): T {
464+
function _valueOrGetDefault<T> (value: T | undefined | null, getDefault: () => T): T {
465465
return value === undefined || value === null ? getDefault() : value
466466
}
467467

packages/core/src/integer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ class Integer {
179179
// Do several (6) digits each time through the loop, so as to
180180
// minimize the calls to the very expensive emulated div.
181181
const radixToPower = Integer.fromNumber(Math.pow(radix, 6))
182+
// eslint-disable-next-line @typescript-eslint/no-this-alias
182183
rem = this
183184
let result = ''
184185
while (true) {
@@ -579,6 +580,7 @@ class Integer {
579580
// the approximate value is less than or equal to the real value so that the
580581
// remainder never becomes negative.
581582
res = Integer.ZERO
583+
// eslint-disable-next-line @typescript-eslint/no-this-alias
582584
rem = this
583585
while (rem.greaterThanOrEqual(theDivisor)) {
584586
// Approximate the result of division. This may be a little greater or
@@ -853,7 +855,7 @@ class Integer {
853855
* @returns {!Integer} The corresponding Integer value
854856
* @expose
855857
*/
856-
static fromString (str: string, radix?: number, { strictStringValidation }: { strictStringValidation?: boolean} = {}): Integer {
858+
static fromString (str: string, radix?: number, { strictStringValidation }: { strictStringValidation?: boolean } = {}): Integer {
857859
if (str.length === 0) {
858860
throw newError('number format error: empty string')
859861
}

packages/core/src/internal/connection-holder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class ConnectionHolder implements ConnectionHolderInterface {
218218
*/
219219
private _releaseConnection (hasTx?: boolean): Promise<Connection | null> {
220220
this._connectionPromise = this._connectionPromise
221-
.then((connection?: Connection|null) => {
221+
.then((connection?: Connection | null) => {
222222
if (connection != null) {
223223
if (connection.isOpen() && (connection.hasOngoingObservableRequests() || hasTx === true)) {
224224
return connection
@@ -333,7 +333,7 @@ class EmptyConnectionHolder extends ConnectionHolder {
333333
*/
334334
const EMPTY_CONNECTION_HOLDER: EmptyConnectionHolder = new EmptyConnectionHolder()
335335

336-
// eslint-disable-next-line node/handle-callback-err
336+
// eslint-disable-next-line n/handle-callback-err
337337
function ignoreError (error: Error): null {
338338
return null
339339
}

packages/core/src/internal/observers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ export class CompletedObserver implements ResultStreamObserver {
146146
// do nothing
147147
}
148148

149-
// eslint-disable-next-line node/handle-callback-err
150149
onError (error: Error): void {
151150
// nothing to do, already finished
152-
throw Error('CompletedObserver not supposed to call onError')
151+
// eslint-disable-next-line
152+
// @ts-ignore: not available in ES oldest supported version
153+
throw new Error('CompletedObserver not supposed to call onError', { cause: error })
153154
}
154155
}
155156

packages/core/src/internal/url-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function sanitizeUrl (url: string): { schemeMissing: boolean, url: string } {
124124
return { schemeMissing: true, url: `none://${url}` }
125125
}
126126

127-
return { schemeMissing: false, url: url }
127+
return { schemeMissing: false, url }
128128
}
129129

130130
function extractScheme (scheme?: string): string | null {

packages/core/src/result-summary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ const notificationSeverityLevel: { [key in NotificationSeverityLevel]: key } = {
435435
Object.freeze(notificationSeverityLevel)
436436
const severityLevels = Object.values(notificationSeverityLevel)
437437

438-
type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' |
438+
type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMANCE' |
439439
'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
440440
/**
441441
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'} NotificationCategory

0 commit comments

Comments
 (0)