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>(
115115 const fragments = parseJsonPath ( path ) ;
116116
117117 try {
118- return fragments . reduce ( ( value : JsonValue , current : string | number ) => {
118+ return fragments . reduce ( ( value : JsonValue | undefined , current : string | number ) => {
119119 if ( value == undefined || typeof value != 'object' ) {
120120 return undefined ;
121121 } else if ( typeof current == 'string' && ! Array . isArray ( value ) ) {
@@ -139,7 +139,7 @@ function setValueFromPath<T extends JsonArray | JsonObject>(
139139 const fragments = parseJsonPath ( path ) ;
140140
141141 try {
142- return fragments . reduce ( ( value : JsonValue , current : string | number , index : number ) => {
142+ return fragments . reduce ( ( value : JsonValue | undefined , current : string | number , index : number ) => {
143143 if ( value == undefined || typeof value != 'object' ) {
144144 return undefined ;
145145 } else if ( typeof current == 'string' && ! Array . isArray ( value ) ) {
Original file line number Diff line number Diff line change @@ -55,9 +55,8 @@ const disableVersionCheck =
5555
5656export class UpdateCommand extends Command < UpdateCommandSchema > {
5757 public readonly allowMissingWorkspace = true ;
58-
59- private workflow : NodeWorkflow ;
60- private packageManager : PackageManager ;
58+ private workflow ! : NodeWorkflow ;
59+ private packageManager = PackageManager . Npm ;
6160
6261 async initialize ( ) {
6362 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';
1212
1313export class Xi18nCommand extends ArchitectCommand < Xi18nCommandSchema > {
1414 public readonly target = 'extract-i18n' ;
15- public readonly multiTarget : true ;
1615
1716 public async run ( options : Xi18nCommandSchema & Arguments ) {
1817 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[] })
4242 } ) ;
4343
4444 // 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 ) ) ;
4747 } ;
48- console . info = function ( ) {
49- logger . info ( format . apply ( null , arguments ) ) ;
48+ console . warn = function ( ... args ) {
49+ logger . warn ( format ( ... args ) ) ;
5050 } ;
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 ) ) ;
5653 } ;
5754
5855 let projectDetails = getWorkspaceDetails ( ) ;
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ export interface ArchitectCommandOptions extends BaseCommandOptions {
2626export abstract class ArchitectCommand <
2727 T extends ArchitectCommandOptions = ArchitectCommandOptions
2828> 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 ;
3333
3434 // If this command supports running multiple targets.
3535 protected multiTarget = false ;
Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ export abstract class SchematicCommand<
7575> extends Command < T > {
7676 readonly allowPrivateSchematics : boolean = false ;
7777 private _host = new NodeJsSyncHost ( ) ;
78- private _workspace : workspaces . WorkspaceDefinition ;
79- protected _workflow : NodeWorkflow ;
78+ private _workspace : workspaces . WorkspaceDefinition | undefined ;
79+ protected _workflow ! : NodeWorkflow ;
8080
8181 protected defaultCollectionName = '@schematics/angular' ;
8282 protected collectionName = this . defaultCollectionName ;
You can’t perform that action at this time.
0 commit comments