@ournet/domain
Version:
Ournet domain
29 lines (28 loc) • 1.51 kB
TypeScript
export declare function md5(value: string): string;
export declare function sha1(value: string): string;
export declare type NormalizeUrlOptions = {
readonly defaultProtocol?: string;
readonly normalizeProtocol?: boolean;
readonly forceHttp?: boolean;
readonly forceHttps?: boolean;
readonly stripAuthentication?: boolean;
readonly stripHash?: boolean;
readonly stripProtocol?: boolean;
readonly stripWWW?: boolean;
readonly removeQueryParameters?: ReadonlyArray<RegExp | string>;
readonly removeTrailingSlash?: boolean;
readonly removeDirectoryIndex?: ReadonlyArray<RegExp | string>;
readonly sortQueryParameters?: boolean;
};
export declare function normalizeUrl(url: string, options?: NormalizeUrlOptions): string;
export declare function uniq<T>(items: T[]): T[];
export declare function uniqByProperty<T>(items: T[], prop: keyof T): T[];
export declare function mapPromise<T, R>(keys: T[], callback: (key: T) => Promise<R>): Promise<Map<T, R>>;
export declare function isAbbr(name: string): boolean;
export declare function clearText(text: string): string;
export declare function atonic(text: string): string;
export declare function countWords(name: string): number;
export declare function getWeekNumber(d: Date): number;
export declare function getRandomInt(min: number, max: number): number;
export declare function getRandomIntInclusive(min: number, max: number): number;
export declare function unixTime(date?: Date): number;