refactor: Use node protocol when importing builtins

This commit is contained in:
Joachim Van Herwegen
2023-10-30 15:53:29 +01:00
parent def0b5c732
commit 990184dbb5
127 changed files with 170 additions and 172 deletions

View File

@@ -1,4 +1,4 @@
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
/**
* A typed interface of {@link EventEmitter}.

View File

@@ -1,4 +1,4 @@
import type { IncomingHttpHeaders } from 'http';
import type { IncomingHttpHeaders } from 'node:http';
import escapeStringRegexp from 'escape-string-regexp';
import { getLoggerFor } from '../logging/LogUtil';
import type { HttpResponse } from '../server/HttpResponse';

View File

@@ -1,4 +1,4 @@
import { posix, win32 } from 'path';
import { posix, win32 } from 'node:path';
import { readJson } from 'fs-extra';
import urljoin from 'url-join';
import type { TargetExtractor } from '../http/input/identifier/TargetExtractor';

View File

@@ -1,4 +1,4 @@
import { types } from 'util';
import { types } from 'node:util';
import { createAggregateError } from './errors/HttpErrorUtil';
export type PromiseOrValue<T> = T | Promise<T>;

View File

@@ -1,4 +1,4 @@
import type { Readable } from 'stream';
import type { Readable } from 'node:stream';
import type { NamedNode } from '@rdfjs/types';
import arrayifyStream from 'arrayify-stream';
import type { ParserOptions } from 'n3';

View File

@@ -1,5 +1,5 @@
import type { Readable, TransformCallback, TransformOptions } from 'stream';
import { Transform } from 'stream';
import type { Readable, TransformCallback, TransformOptions } from 'node:stream';
import { Transform } from 'node:stream';
import { RangeNotSatisfiedHttpError } from './errors/RangeNotSatisfiedHttpError';
import { pipeSafely } from './StreamUtil';

View File

@@ -1,6 +1,6 @@
import type { DuplexOptions, ReadableOptions, Writable } from 'stream';
import { Readable, Transform } from 'stream';
import { promisify } from 'util';
import type { DuplexOptions, ReadableOptions, Writable } from 'node:stream';
import { Readable, Transform } from 'node:stream';
import { promisify } from 'node:util';
import arrayifyStream from 'arrayify-stream';
import eos from 'end-of-stream';
import { Store } from 'n3';

View File

@@ -1,4 +1,4 @@
import { types } from 'util';
import { types } from 'node:util';
/**
* Checks if the input is an {@link Error}.

View File

@@ -1,4 +1,4 @@
import { URL } from 'url';
import { URL } from 'node:url';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import { errorTermsToMetadata } from '../errors/HttpErrorUtil';
import { InternalServerError } from '../errors/InternalServerError';

View File

@@ -1,4 +1,4 @@
import { createHash } from 'crypto';
import { createHash } from 'node:crypto';
import { ensureDir, remove } from 'fs-extra';
import type { LockOptions, UnlockOptions } from 'proper-lockfile';
import { lock, unlock } from 'proper-lockfile';

View File

@@ -1,4 +1,4 @@
import { promises as fsPromises } from 'fs';
import { promises as fsPromises } from 'node:fs';
import { joinFilePath, resolveAssetPath } from '../PathUtil';
import type { Template } from './TemplateEngine';