Skip to content

Commit

Permalink
fix(@schematics/angular): working with formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
InSantoshMahto authored and alan-agius4 committed Jun 7, 2021
1 parent 052b8fa commit d13a866
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/schematics/angular/web-worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function addSnippet(options: WebWorkerOptions): Rule {
export default function (options: WebWorkerOptions): Rule {
return async (host: Tree) => {
const workspace = await getWorkspace(host);

if (!options.project) {
throw new SchematicsException('Option "project" is required.');
}
Expand All @@ -124,8 +125,7 @@ export default function (options: WebWorkerOptions): Rule {
if (!projectTarget) {
throw new Error(`Target is not defined for this project.`);
}
const projectTargetOptions = ((projectTarget.options ||
{}) as unknown) as BrowserBuilderOptions;
const projectTargetOptions = (projectTarget.options || {}) as unknown as BrowserBuilderOptions;

if (options.path === undefined) {
options.path = buildDefaultPath(project);
Expand All @@ -143,8 +143,8 @@ export default function (options: WebWorkerOptions): Rule {

const projectTestTarget = project.targets.get('test');
if (projectTestTarget) {
const projectTestTargetOptions = ((projectTestTarget.options ||
{}) as unknown) as BrowserBuilderOptions;
const projectTestTargetOptions = (projectTestTarget.options ||
{}) as unknown as BrowserBuilderOptions;

const needWebWorkerConfig = !projectTestTargetOptions.webWorkerTsConfig;
if (needWebWorkerConfig) {
Expand Down

0 comments on commit d13a866

Please sign in to comment.