Skip to content

Commit

Permalink
perf: use node: prefix to bypass require.cache call for builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Sep 10, 2023
1 parent 523d7b5 commit 86c5050
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions boot.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const fastq = require('fastq')
const EE = require('events').EventEmitter
const inherits = require('util').inherits
const EE = require('node:events').EventEmitter
const inherits = require('node:util').inherits
const {
AVV_ERR_EXPOSE_ALREADY_DEFINED,
AVV_ERR_CALLBACK_NOT_FN,
Expand Down
2 changes: 1 addition & 1 deletion lib/debug.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { debuglog } = require('util')
const { debuglog } = require('node:util')

/**
* @callback DebugLogger
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { EventEmitter } = require('events')
const { inherits } = require('util')
const { EventEmitter } = require('node:events')
const { inherits } = require('node:util')
const { debug } = require('./debug')
const { createPromise } = require('./create-promise')
const { AVV_ERR_PLUGIN_EXEC_TIMEOUT } = require('./errors')
Expand Down
6 changes: 3 additions & 3 deletions test/await-after.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

const { test } = require('tap')
const boot = require('..')
const { promisify } = require('util')
const { promisify } = require('node:util')
const sleep = promisify(setTimeout)
const fs = require('fs').promises
const path = require('path')
const fs = require('node:fs').promises
const path = require('node:path')

test('await after - nested plugins with same tick callbacks', async (t) => {
const app = {}
Expand Down
2 changes: 1 addition & 1 deletion test/await-use.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('tap')
const { promisify } = require('util')
const { promisify } = require('node:util')
const sleep = promisify(setTimeout)
const boot = require('..')

Expand Down
2 changes: 1 addition & 1 deletion test/express.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { test } = require('tap')
const express = require('express')
const http = require('http')
const http = require('node:http')
const boot = require('..')

test('express support', (t) => {
Expand Down

0 comments on commit 86c5050

Please sign in to comment.