UNPKG

website-scrap-engine

Version:
22 lines 1.16 kB
import type { ResourceBody, ResourceEncoding } from './resource.js'; export declare const sleep: (ms: number) => Promise<void>; export declare const escapePath: (str: string) => string; export declare const isSiteMap: (url?: string) => boolean | "" | void; export declare const arrayToMap: (array: (string | number)[], freeze?: boolean) => Record<string | number, number>; export declare const toString: (body: ResourceBody, encoding: ResourceEncoding) => string; export declare const importDefaultFromPath: <T>(path: string) => Promise<T>; export declare const orderUrlSearch: (search: string) => string; export declare const simpleHashString: (str: string) => string; export declare const hasOwnProperty: (v: PropertyKey) => boolean; /** * Merge values from source to target only if key not exists in target * Note that using this function against incompatible type or null | undefined * may lead to typescript parser errors. */ export declare const weakAssign: <T, U>(target: T, source: U) => T & U; /** * Test if the given url is http url * @param url */ export declare const isUrlHttp: (url: string) => boolean; //# sourceMappingURL=util.d.ts.map