Skip to content

Commit

Permalink
perf: use node: prefix to bypass require.cache call for builtins (#755
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Sep 10, 2023
1 parent 76c38f3 commit caa939c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/mode/static.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const path = require('path')
const fs = require('fs')
const path = require('node:path')
const fs = require('node:fs')
const yaml = require('yaml')

module.exports = function (fastify, opts, done) {
Expand Down
4 changes: 2 additions & 2 deletions lib/util/read-package-json.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fs = require('fs')
const path = require('path')
const fs = require('node:fs')
const path = require('node:path')

function readPackageJson () {
try {
Expand Down
6 changes: 3 additions & 3 deletions test/mode/static.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict'

const path = require('path')
const path = require('node:path')
const { test } = require('tap')
const Fastify = require('fastify')
const fastifySwagger = require('../../index')
const fastifySwaggerDynamic = require('../../lib/mode/dynamic')
const Swagger = require('@apidevtools/swagger-parser')
const readFileSync = require('fs').readFileSync
const resolve = require('path').resolve
const readFileSync = require('node:fs').readFileSync
const resolve = require('node:path').resolve
const yaml = require('yaml')

test('specification validation check works', async (t) => {
Expand Down

0 comments on commit caa939c

Please sign in to comment.