UNPKG

@ynmstudio/utils

Version:
43 lines (41 loc) 2.38 kB
type CollectionPredicate = (item?: any, index?: number, collection?: any[]) => boolean; declare function isUndefined(value: any): value is undefined; declare function isNull(value: any): value is null; declare function isNumber(value: any): value is number; declare function isNumberFinite(value: any): value is number; declare function isPositive(value: number): boolean; declare function isInteger(value: number): boolean; declare function isNil(value: any): value is null | undefined; declare function isString(value: any): value is string; declare function isObject(value: any): boolean; declare function isArray(value: any): boolean; declare function isFunction(value: any): boolean; declare function toDecimal(value: number, decimal: number): number; declare function upperFirst(value: string): string; declare function createRound(method: string): Function; declare function leftPad(str: string, len?: number, ch?: any): string; declare function rightPad(str: string, len?: number, ch?: any): string; declare function toString(value: number | string): string; declare function pad(str: string, len?: number, ch?: any): string; declare function flatten(input: any[], index?: number): any[]; declare function getProperty(value: { [key: string]: any; }, key: string): any; declare function sum(input: Array<number>, initial?: number): number; declare function shuffle(input: any): any; declare function deepIndexOf(collection: any[], value: any): number; declare function deepEqual(a: any, b: any): boolean; declare function isDeepObject(object: any): any; declare function wrapDeep(object: any): DeepWrapper; declare function unwrapDeep(object: any): any; declare class DeepWrapper { data: any; __isDeepObject__: boolean; constructor(data: any); } declare function count(input: any): any; declare function empty(input: any): any; declare function every(input: any, predicate: CollectionPredicate): any; declare function takeUntil(input: any[], predicate: CollectionPredicate): any; export { DeepWrapper, count, createRound, deepEqual, deepIndexOf, empty, every, flatten, getProperty, isArray, isDeepObject, isFunction, isInteger, isNil, isNull, isNumber, isNumberFinite, isObject, isPositive, isString, isUndefined, leftPad, pad, rightPad, shuffle, sum, takeUntil, toDecimal, toString, unwrapDeep, upperFirst, wrapDeep }; export type { CollectionPredicate };