Skip to content

Commit

Permalink
Fixed new tslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampo Kivistö committed Jan 28, 2020
1 parent 41e4a8d commit ff1e6c6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/inferno-compat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function unmountComponentAtNode(container: Element | SVGAElement | DocumentFragm
return true;
}

export type IterateChildrenFn = (value: InfernoNode | any, index: number, array: Array<InfernoNode | any>) => any;
export type IterateChildrenFn = (value: InfernoNode | any, index: number, array: any[]) => any;

function flatten(arr, result) {
for (let i = 0, len = arr.length; i < len; ++i) {
Expand All @@ -74,7 +74,7 @@ function flatten(arr, result) {
const ARR = [];

const Children = {
map(children: Array<InfernoNode | any>, fn: IterateChildrenFn, ctx: any): any[] {
map(children: any[], fn: IterateChildrenFn, ctx: any): any[] {
if (isNullOrUndef(children)) {
return children;
}
Expand All @@ -84,7 +84,7 @@ const Children = {
}
return children.map(fn);
},
forEach(children: Array<InfernoNode | any>, fn: IterateChildrenFn, ctx?: any): void {
forEach(children: any[], fn: IterateChildrenFn, ctx?: any): void {
if (isNullOrUndef(children)) {
return;
}
Expand All @@ -98,18 +98,18 @@ const Children = {
fn(child, i, children);
}
},
count(children: Array<InfernoNode | any>): number {
count(children: any[]): number {
children = Children.toArray(children);
return children.length;
},
only(children: Array<InfernoNode | any>): InfernoNode | any {
only(children: any[]): InfernoNode | any {
children = Children.toArray(children);
if (children.length !== 1) {
throw new Error('Children.only() expects only one child.');
}
return children[0];
},
toArray(children: Array<InfernoNode | any>): Array<InfernoNode | any> {
toArray(children: any[]): any[] {
if (isNullOrUndef(children)) {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/inferno-router/src/BrowserRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface IBrowserRouterProps {
forceRefresh?: boolean;
getUserConfirmation?: () => {};
keyLength?: number;
children: Array<Component<any, any>> | JSX.Element;
children: Component<any, any>[] | JSX.Element;
}

export class BrowserRouter extends Component<IBrowserRouterProps, any> {
Expand Down
2 changes: 1 addition & 1 deletion packages/inferno-router/src/HashRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface IHashRouterProps {
basename?: string;
getUserConfirmation?: () => {};
hashType?: string;
children: Array<Component<any, any>> | JSX.Element;
children: Component<any, any>[] | JSX.Element;
}

export class HashRouter extends Component<IHashRouterProps, any> {
Expand Down
2 changes: 1 addition & 1 deletion packages/inferno-router/src/MemoryRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface IMemoryRouterProps {
initialIndex?: number;
getUserConfirmation?: () => {};
keyLength?: number;
children: Array<Component<any, any>> | JSX.Element;
children: Component<any, any>[] | JSX.Element;
}

export class MemoryRouter extends Component<IMemoryRouterProps, any> {
Expand Down
3 changes: 2 additions & 1 deletion packages/inferno/src/core/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { combineFrom, isFunction, isNullOrUndef, throwError } from 'inferno-shar
import { updateClassComponent } from '../DOM/patching';
import { callAll, EMPTY_OBJ, findDOMfromVNode, renderCheck } from '../DOM/utils/common';

const QUEUE: Array<Component<any, any>> = [];
const QUEUE: Component<any, any>[] = [];

const nextTick =
typeof Promise !== 'undefined'
? Promise.resolve().then.bind(Promise.resolve())
Expand Down

0 comments on commit ff1e6c6

Please sign in to comment.