Skip to content

Commit

Permalink
refactor: Rename AddDirectoryOptions to DirectoryAddOptions
Browse files Browse the repository at this point in the history
BREAKING CHANGE: AddDirectoryOptions -> DirectoryAddOptions
  • Loading branch information
dsherret committed Apr 28, 2018
1 parent 0a39f15 commit ccd1627
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as factories from "./factories";
import { SourceFileStructure } from "./structures";
import { getTsConfigParseResult, getCompilerOptionsFromTsConfigParseResult, getPathsFromTsConfigParseResult, TsConfigParseResult,
FileUtils, ArrayUtils, matchGlobs } from "./utils";
import { DefaultFileSystemHost, VirtualFileSystemHost, FileSystemHost, FileSystemWrapper, Directory, AddDirectoryOptions } from "./fileSystem";
import { DefaultFileSystemHost, VirtualFileSystemHost, FileSystemHost, FileSystemWrapper, Directory, DirectoryAddOptions } from "./fileSystem";
import { ManipulationSettings, ManipulationSettingsContainer, CompilerOptionsContainer } from "./options";
import { GlobalContainer } from "./GlobalContainer";

Expand Down Expand Up @@ -107,7 +107,7 @@ export class Project {
* @param dirPath - Path to add the directory at.
* @param options - Options.
*/
addExistingDirectoryIfExists(dirPath: string, options: AddDirectoryOptions = {}): Directory | undefined {
addExistingDirectoryIfExists(dirPath: string, options: DirectoryAddOptions = {}): Directory | undefined {
dirPath = this.global.fileSystemWrapper.getStandardizedAbsolutePath(dirPath);
return this.global.directoryCoordinator.addExistingDirectoryIfExists(dirPath, options);
}
Expand All @@ -120,7 +120,7 @@ export class Project {
* @param options - Options.
* @throws DirectoryNotFoundError when the directory does not exist.
*/
addExistingDirectory(dirPath: string, options: AddDirectoryOptions = {}): Directory {
addExistingDirectory(dirPath: string, options: DirectoryAddOptions = {}): Directory {
dirPath = this.global.fileSystemWrapper.getStandardizedAbsolutePath(dirPath);
return this.global.directoryCoordinator.addExistingDirectory(dirPath, options);
}
Expand Down
6 changes: 3 additions & 3 deletions src/fileSystem/Directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GlobalContainer } from "../GlobalContainer";
import { SourceFileCreateOptions, SourceFileAddOptions } from "../Project";
import { DirectoryEmitResult } from "./DirectoryEmitResult";

export interface AddDirectoryOptions {
export interface DirectoryAddOptions {
/**
* Whether to also recursively add all the directory's descendant directories.
* @remarks Defaults to false.
Expand Down Expand Up @@ -230,7 +230,7 @@ export class Directory {
* @param dirPath - Directory name or path to the directory that should be added.
* @param options - Options.
*/
addExistingDirectoryIfExists(dirPath: string, options: AddDirectoryOptions = {}) {
addExistingDirectoryIfExists(dirPath: string, options: DirectoryAddOptions = {}) {
dirPath = this.global.fileSystemWrapper.getStandardizedAbsolutePath(dirPath, this.getPath());
return this.global.directoryCoordinator.addExistingDirectoryIfExists(dirPath, options);
}
Expand All @@ -242,7 +242,7 @@ export class Directory {
* @param dirPath - Directory name or path to the directory that should be added.
* @throws DirectoryNotFoundError if the directory does not exist.
*/
addExistingDirectory(dirPath: string, options: AddDirectoryOptions = {}) {
addExistingDirectory(dirPath: string, options: DirectoryAddOptions = {}) {
dirPath = this.global.fileSystemWrapper.getStandardizedAbsolutePath(dirPath, this.getPath());
return this.global.directoryCoordinator.addExistingDirectory(dirPath, options);
}
Expand Down
6 changes: 3 additions & 3 deletions src/fileSystem/DirectoryCoordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as errors from "../errors";
import { FileUtils } from "../utils";
import { FileSystemWrapper } from "./FileSystemWrapper";
import { Directory, AddDirectoryOptions } from "./Directory";
import { Directory, DirectoryAddOptions } from "./Directory";

/**
* Contains common methods between Project and Directory.
Expand All @@ -13,7 +13,7 @@ export class DirectoryCoordinator {
constructor(private readonly compilerFactory: CompilerFactory, private readonly fileSystemWrapper: FileSystemWrapper) {
}

addExistingDirectoryIfExists(dirPath: string, options: AddDirectoryOptions) {
addExistingDirectoryIfExists(dirPath: string, options: DirectoryAddOptions) {
const directory = this.compilerFactory.getDirectoryFromPath(dirPath);
if (directory == null)
return undefined;
Expand All @@ -26,7 +26,7 @@ export class DirectoryCoordinator {
return directory;
}

addExistingDirectory(dirPath: string, options: AddDirectoryOptions) {
addExistingDirectory(dirPath: string, options: DirectoryAddOptions) {
const directory = this.addExistingDirectoryIfExists(dirPath, options);
if (directory == null)
throw new errors.DirectoryNotFoundError(dirPath);
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export * from "./compiler";
export * from "./structures";
export { Project as default } from "./Project";
export { Options, SourceFileCreateOptions, SourceFileAddOptions } from "./Project";
export { FileSystemHost, Directory, DirectoryEmitResult, AddDirectoryOptions } from "./fileSystem";
export { FileSystemHost, Directory, DirectoryEmitResult, DirectoryAddOptions } from "./fileSystem";
export * from "./options";
export { Constructor } from "./Constructor";
export { createWrappedNode, CreateWrappedNodeOptions } from "./utils/compiler/createWrappedNode";
Expand Down

0 comments on commit ccd1627

Please sign in to comment.