Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use node: prefix to bypass require.cache call for builtins #143

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cache-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// - https://csswizardry.com/2019/03/cache-control-for-civilians/
// - https://jakearchibald.com/2016/caching-best-practices/

const assert = require('assert')
const assert = require('node:assert')
const ms = require('@lukeed/ms').parse

const validSingletimes = [
Expand Down
2 changes: 1 addition & 1 deletion lib/httpErrors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const createError = require('http-errors')
const statusCodes = require('http').STATUS_CODES
const statusCodes = require('node:http').STATUS_CODES

const statusCodesMap = Object.assign({}, statusCodes)
Object.keys(statusCodesMap).forEach(code => {
Expand Down
2 changes: 1 addition & 1 deletion test/httpErrors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { test } = require('tap')
const createError = require('http-errors')
const statusCodes = require('http').STATUS_CODES
const statusCodes = require('node:http').STATUS_CODES
const Fastify = require('fastify')
const Sensible = require('../index')
const HttpError = require('../lib/httpErrors').HttpError
Expand Down
2 changes: 1 addition & 1 deletion test/httpErrorsReply.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('tap')
const statusCodes = require('http').STATUS_CODES
const statusCodes = require('node:http').STATUS_CODES
const Fastify = require('fastify')
const Sensible = require('../index')

Expand Down