UNPKG

@hyext/utils

Version:

A tools lib for huya miniapp business development

27 lines (26 loc) 1.26 kB
export declare function isUndef(v: any): boolean; export declare function isDef(v: any): boolean; export declare function isTrue(v: any): boolean; export declare function isFalse(v: any): boolean; export declare const isObject: (v: any) => boolean; export declare const isFunction: (v: any) => boolean; export declare const isArray: (v: any) => boolean; export declare function isPlainObject(obj: any): boolean; export declare function isRegExp(v: any): boolean; export declare const capitalize: (str: string) => string; export declare const camelize: (str: string) => string; export declare const hyphenate: (str: string) => string; /** * Convert an input value to a number for persistence. * If the conversion fails, return original string. */ export declare function toNumber(val: string): number | string; /** * Convert a value to a string */ export declare function toString(val: any): string; export declare const patchNumber: (v: number | string) => string | number; export declare const getTime: (date?: Date) => string; export declare const delay: (duration: number) => Promise<unknown>; export declare const second2Minute: (seconds: number) => string; export declare function limit(v: string | number): number | "99+";