Skip to content

Commit 62e72fe

Browse files
hanslvikerman
authored andcommittedAug 28, 2018
fix(@angular-devkit/architect): explicitly type functions
Closes: #11992
1 parent 02bfde5 commit 62e72fe

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed
 

‎packages/angular_devkit/architect/testing/test-project-host.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {
1010
Path,
11+
PathFragment,
1112
basename,
1213
dirname,
1314
join,
@@ -128,7 +129,7 @@ export class TestProjectHost extends NodeJsSyncHost {
128129
virtualFs.stringToFileBuffer(content.concat(str)));
129130
}
130131

131-
fileMatchExists(dir: string, regex: RegExp) {
132+
fileMatchExists(dir: string, regex: RegExp): PathFragment | undefined {
132133
const [fileName] = this.scopedSync().list(normalize(dir)).filter(name => name.match(regex));
133134

134135
return fileName || undefined;

‎packages/angular_devkit/build_angular/test/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*/
88

99
import { TestProjectHost } from '@angular-devkit/architect/testing';
10-
import { join, normalize } from '@angular-devkit/core';
10+
import { Path, join, normalize } from '@angular-devkit/core';
1111

1212

1313
const devkitRoot = normalize((global as any)._DevKitRoot); // tslint:disable-line:no-any
1414
const workspaceRoot = join(devkitRoot, 'tests/angular_devkit/build_angular/hello-world-app/');
1515
export const host = new TestProjectHost(workspaceRoot);
16-
export const outputPath = normalize('dist');
16+
export const outputPath: Path = normalize('dist');
1717

1818
export const browserTargetSpec = { project: 'app', target: 'build' };
1919
export const devServerTargetSpec = { project: 'app', target: 'serve' };

‎packages/angular_devkit/core/src/virtual-fs/host/test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { Observable } from 'rxjs';
9-
import { Path, join, normalize } from '../path';
9+
import { Path, PathFragment, join, normalize } from '../path';
1010
import { fileBufferToString, stringToFileBuffer } from './buffer';
1111
import { FileBuffer, HostWatchEvent, HostWatchOptions, Stats } from './interface';
1212
import { SimpleMemoryHost, SimpleMemoryHostStats } from './memory';
@@ -96,7 +96,7 @@ export class TestHost extends SimpleMemoryHost {
9696

9797
return super._rename(from, to);
9898
}
99-
protected _list(path: Path) {
99+
protected _list(path: Path): PathFragment[] {
100100
this._records.push({ kind: 'list', path });
101101

102102
return super._list(path);
@@ -135,7 +135,7 @@ export class TestHost extends SimpleMemoryHost {
135135
return fileBufferToString(super._read(normalize(path)));
136136
}
137137

138-
$list(path: string) {
138+
$list(path: string): PathFragment[] {
139139
return super._list(normalize(path));
140140
}
141141

0 commit comments

Comments
 (0)