From 9af0c5843b66b5f3d6fc3afb497fbf29b909b47d Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 10 Apr 2020 02:27:37 +0300 Subject: [PATCH] fix: replace infered with inferred --- .../packages/core/src/lib/models/utility.ts | 4 ++-- .../src/lib/strategies/context.strategy.ts | 12 +++++------ .../src/lib/strategies/projection.strategy.ts | 20 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/models/utility.ts b/npm/ng-packs/packages/core/src/lib/models/utility.ts index 5fe76af3c9..e84ad15340 100644 --- a/npm/ng-packs/packages/core/src/lib/models/utility.ts +++ b/npm/ng-packs/packages/core/src/lib/models/utility.ts @@ -1,4 +1,4 @@ import { TemplateRef, Type } from '@angular/core'; -export type InferedInstanceOf = T extends Type ? U : never; -export type InferedContextOf = T extends TemplateRef ? U : never; +export type InferredInstanceOf = T extends Type ? U : never; +export type InferredContextOf = T extends TemplateRef ? U : never; diff --git a/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts index e3d16c0573..21007eae1c 100644 --- a/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts +++ b/npm/ng-packs/packages/core/src/lib/strategies/context.strategy.ts @@ -1,11 +1,11 @@ import { ComponentRef, TemplateRef, Type } from '@angular/core'; -import { InferedContextOf, InferedInstanceOf } from '../models'; +import { InferredContextOf, InferredInstanceOf } from '../models'; export abstract class ContextStrategy { constructor(public context: Partial>) {} /* tslint:disable-next-line:no-unused-variable */ - setContext(componentRef?: ComponentRef>): Partial> { + setContext(componentRef?: ComponentRef>): Partial> { return this.context; } } @@ -19,7 +19,7 @@ export class NoContextStrategy< } export class ComponentContextStrategy = any> extends ContextStrategy { - setContext(componentRef: ComponentRef>): Partial> { + setContext(componentRef: ComponentRef>): Partial> { Object.keys(this.context).forEach(key => (componentRef.instance[key] = this.context[key])); componentRef.changeDetectorRef.detectChanges(); return this.context; @@ -27,7 +27,7 @@ export class ComponentContextStrategy = any> extends Context } export class TemplateContextStrategy = any> extends ContextStrategy { - setContext(): Partial> { + setContext(): Partial> { return this.context; } } @@ -36,10 +36,10 @@ export const CONTEXT_STRATEGY = { None | TemplateRef = any>() { return new NoContextStrategy(); }, - Component = any>(context: Partial>) { + Component = any>(context: Partial>) { return new ComponentContextStrategy(context); }, - Template = any>(context: Partial>) { + Template = any>(context: Partial>) { return new TemplateContextStrategy(context); }, }; diff --git a/npm/ng-packs/packages/core/src/lib/strategies/projection.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/projection.strategy.ts index ad5927e09e..e7a62383a2 100644 --- a/npm/ng-packs/packages/core/src/lib/strategies/projection.strategy.ts +++ b/npm/ng-packs/packages/core/src/lib/strategies/projection.strategy.ts @@ -8,7 +8,7 @@ import { Type, ViewContainerRef, } from '@angular/core'; -import { InferedContextOf, InferedInstanceOf } from '../models/utility'; +import { InferredContextOf, InferredInstanceOf } from '../models/utility'; import { ContainerStrategy, CONTAINER_STRATEGY } from './container.strategy'; import { ContextStrategy, CONTEXT_STRATEGY } from './context.strategy'; import { DomStrategy, DOM_STRATEGY } from './dom.strategy'; @@ -32,7 +32,7 @@ export class ComponentProjectionStrategy> extends Projection this.containerStrategy.prepare(); const resolver = injector.get(ComponentFactoryResolver) as ComponentFactoryResolver; - const factory = resolver.resolveComponentFactory>(this.content); + const factory = resolver.resolveComponentFactory>(this.content); const componentRef = this.containerStrategy.containerRef.createComponent( factory, @@ -58,7 +58,7 @@ export class RootComponentProjectionStrategy> extends Projec const appRef = injector.get(ApplicationRef); const resolver = injector.get(ComponentFactoryResolver) as ComponentFactoryResolver; const componentRef = resolver - .resolveComponentFactory>(this.content) + .resolveComponentFactory>(this.content) .create(injector); this.contextStrategy.setContext(componentRef); @@ -95,7 +95,7 @@ export class TemplateProjectionStrategy> extends Proj } export const PROJECTION_STRATEGY = { - AppendComponentToBody>(component: T, context?: InferedInstanceOf) { + AppendComponentToBody>(component: T, context?: InferredInstanceOf) { return new RootComponentProjectionStrategy( component, context && CONTEXT_STRATEGY.Component(context), @@ -104,7 +104,7 @@ export const PROJECTION_STRATEGY = { AppendComponentToContainer>( component: T, containerRef: ViewContainerRef, - context?: InferedInstanceOf, + context?: InferredInstanceOf, ) { return new ComponentProjectionStrategy( component, @@ -115,7 +115,7 @@ export const PROJECTION_STRATEGY = { AppendTemplateToContainer>( templateRef: T, containerRef: ViewContainerRef, - context?: InferedContextOf, + context?: InferredContextOf, ) { return new TemplateProjectionStrategy( templateRef, @@ -126,7 +126,7 @@ export const PROJECTION_STRATEGY = { PrependComponentToContainer>( component: T, containerRef: ViewContainerRef, - context?: InferedInstanceOf, + context?: InferredInstanceOf, ) { return new ComponentProjectionStrategy( component, @@ -137,7 +137,7 @@ export const PROJECTION_STRATEGY = { PrependTemplateToContainer>( templateRef: T, containerRef: ViewContainerRef, - context?: InferedContextOf, + context?: InferredContextOf, ) { return new TemplateProjectionStrategy( templateRef, @@ -148,7 +148,7 @@ export const PROJECTION_STRATEGY = { ProjectComponentToContainer>( component: T, containerRef: ViewContainerRef, - context?: InferedInstanceOf, + context?: InferredInstanceOf, ) { return new ComponentProjectionStrategy( component, @@ -159,7 +159,7 @@ export const PROJECTION_STRATEGY = { ProjectTemplateToContainer>( templateRef: T, containerRef: ViewContainerRef, - context?: InferedContextOf, + context?: InferredContextOf, ) { return new TemplateProjectionStrategy( templateRef,