File tree Expand file tree Collapse file tree 6 files changed +16
-21
lines changed Expand file tree Collapse file tree 6 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ function getValueFromPath<T extends JsonArray | JsonObject>(
115
115
const fragments = parseJsonPath ( path ) ;
116
116
117
117
try {
118
- return fragments . reduce ( ( value : JsonValue , current : string | number ) => {
118
+ return fragments . reduce ( ( value : JsonValue | undefined , current : string | number ) => {
119
119
if ( value == undefined || typeof value != 'object' ) {
120
120
return undefined ;
121
121
} else if ( typeof current == 'string' && ! Array . isArray ( value ) ) {
@@ -139,7 +139,7 @@ function setValueFromPath<T extends JsonArray | JsonObject>(
139
139
const fragments = parseJsonPath ( path ) ;
140
140
141
141
try {
142
- return fragments . reduce ( ( value : JsonValue , current : string | number , index : number ) => {
142
+ return fragments . reduce ( ( value : JsonValue | undefined , current : string | number , index : number ) => {
143
143
if ( value == undefined || typeof value != 'object' ) {
144
144
return undefined ;
145
145
} else if ( typeof current == 'string' && ! Array . isArray ( value ) ) {
Original file line number Diff line number Diff line change @@ -55,9 +55,8 @@ const disableVersionCheck =
55
55
56
56
export class UpdateCommand extends Command < UpdateCommandSchema > {
57
57
public readonly allowMissingWorkspace = true ;
58
-
59
- private workflow : NodeWorkflow ;
60
- private packageManager : PackageManager ;
58
+ private workflow ! : NodeWorkflow ;
59
+ private packageManager = PackageManager . Npm ;
61
60
62
61
async initialize ( ) {
63
62
this . packageManager = await getPackageManager ( this . workspace . root ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import { Schema as Xi18nCommandSchema } from './xi18n';
12
12
13
13
export class Xi18nCommand extends ArchitectCommand < Xi18nCommandSchema > {
14
14
public readonly target = 'extract-i18n' ;
15
- public readonly multiTarget : true ;
16
15
17
16
public async run ( options : Xi18nCommandSchema & Arguments ) {
18
17
const version = process . version . substr ( 1 ) . split ( '.' ) ;
Original file line number Diff line number Diff line change @@ -42,17 +42,14 @@ export default async function(options: { testing?: boolean; cliArgs: string[] })
42
42
} ) ;
43
43
44
44
// Redirect console to logger
45
- console . log = function ( ) {
46
- logger . info ( format . apply ( null , arguments ) ) ;
45
+ console . info = console . log = function ( ... args ) {
46
+ logger . info ( format ( ... args ) ) ;
47
47
} ;
48
- console . info = function ( ) {
49
- logger . info ( format . apply ( null , arguments ) ) ;
48
+ console . warn = function ( ... args ) {
49
+ logger . warn ( format ( ... args ) ) ;
50
50
} ;
51
- console . warn = function ( ) {
52
- logger . warn ( format . apply ( null , arguments ) ) ;
53
- } ;
54
- console . error = function ( ) {
55
- logger . error ( format . apply ( null , arguments ) ) ;
51
+ console . error = function ( ...args ) {
52
+ logger . error ( format ( ...args ) ) ;
56
53
} ;
57
54
58
55
let projectDetails = getWorkspaceDetails ( ) ;
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ export interface ArchitectCommandOptions extends BaseCommandOptions {
26
26
export abstract class ArchitectCommand <
27
27
T extends ArchitectCommandOptions = ArchitectCommandOptions
28
28
> extends Command < T > {
29
- protected _architect : Architect ;
30
- protected _architectHost : WorkspaceNodeModulesArchitectHost ;
31
- protected _workspace : workspaces . WorkspaceDefinition ;
32
- protected _registry : json . schema . SchemaRegistry ;
29
+ protected _architect ! : Architect ;
30
+ protected _architectHost ! : WorkspaceNodeModulesArchitectHost ;
31
+ protected _workspace ! : workspaces . WorkspaceDefinition ;
32
+ protected _registry ! : json . schema . SchemaRegistry ;
33
33
34
34
// If this command supports running multiple targets.
35
35
protected multiTarget = false ;
Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ export abstract class SchematicCommand<
75
75
> extends Command < T > {
76
76
readonly allowPrivateSchematics : boolean = false ;
77
77
private _host = new NodeJsSyncHost ( ) ;
78
- private _workspace : workspaces . WorkspaceDefinition ;
79
- protected _workflow : NodeWorkflow ;
78
+ private _workspace : workspaces . WorkspaceDefinition | undefined ;
79
+ protected _workflow ! : NodeWorkflow ;
80
80
81
81
protected defaultCollectionName = '@schematics/angular' ;
82
82
protected collectionName = this . defaultCollectionName ;
You can’t perform that action at this time.
0 commit comments