Skip to content

Commit c5abbed

Browse files
committed
Fix parameter optionality
1 parent c6d9ed7 commit c5abbed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/reviews/api/node-core-library.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ export class ProtectableMap<K, V> {
845845

846846
// @public
847847
export class RealNodeModulePathResolver {
848-
constructor(options: IRealNodeModulePathResolverOptions);
848+
constructor(options?: IRealNodeModulePathResolverOptions);
849849
clearCache(): void;
850850
readonly realNodeModulePath: (input: string) => string;
851851
}

libraries/node-core-library/src/RealNodeModulePath.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class RealNodeModulePathResolver {
4141
private readonly _fs: Required<NonNullable<IRealNodeModulePathResolverOptions['fs']>>;
4242
private readonly _path: Required<NonNullable<IRealNodeModulePathResolverOptions['path']>>;
4343

44-
public constructor(options: IRealNodeModulePathResolverOptions) {
44+
public constructor(options: IRealNodeModulePathResolverOptions = {}) {
4545
const {
4646
fs: { lstatSync = nodeFs.lstatSync, readlinkSync = nodeFs.readlinkSync } = nodeFs,
4747
path: {
@@ -50,7 +50,7 @@ export class RealNodeModulePathResolver {
5050
resolve = nodePath.resolve,
5151
sep = nodePath.sep
5252
} = nodePath
53-
} = options ?? {};
53+
} = options;
5454
const cache: Map<string, string> = (this._cache = new Map());
5555
this._fs = {
5656
lstatSync,

0 commit comments

Comments
 (0)