refactor: reduce implicit types

This commit is contained in:
Kamil Myśliwiec
2018-11-24 17:28:28 +01:00
parent 1cb3ed7f87
commit 0b23422ab1
54 changed files with 218 additions and 178 deletions

View File

@@ -1,11 +1,11 @@
export const isUndefined = (obj): obj is undefined =>
export const isUndefined = (obj: any): obj is undefined =>
typeof obj === 'undefined';
export const isFunction = (fn): boolean => typeof fn === 'function';
export const isObject = (fn): fn is object => typeof fn === 'object';
export const isString = (fn): fn is string => typeof fn === 'string';
export const isConstructor = (fn): boolean => fn === 'constructor';
export const validatePath = (path): string =>
export const isFunction = (fn: any): boolean => typeof fn === 'function';
export const isObject = (fn: any): fn is object => typeof fn === 'object';
export const isString = (fn: any): fn is string => typeof fn === 'string';
export const isConstructor = (fn: any): boolean => fn === 'constructor';
export const validatePath = (path: string): string =>
path.charAt(0) !== '/' ? '/' + path : path;
export const isNil = (obj): boolean => isUndefined(obj) || obj === null;
export const isEmpty = (array): boolean => !(array && array.length > 0);
export const isSymbol = (fn): boolean => typeof fn === 'symbol';
export const isNil = (obj: any): boolean => isUndefined(obj) || obj === null;
export const isEmpty = (array: any): boolean => !(array && array.length > 0);
export const isSymbol = (fn: any): boolean => typeof fn === 'symbol';