urisanity
Version:
vet URIs in web and web-like applications with confidence
27 lines (22 loc) • 893 B
TypeScript
// Type definitions for urisanity v0.1.6
// Project: https://github.com/codesplinta/URISanity
declare module 'urisanity' {
export type Options = {
allowScriptOrDataURI?: boolean,
allowFileSystemURI?: boolean,
allowCommsAppURI?: boolean,
allowDBConnectionStringURI?: boolean,
allowBrowserSpecificURI?: boolean,
allowWebTransportURI?: boolean,
allowServiceAPIURI?: boolean
};
export type Params = string | Record<string, unknown>;
const URISanity: {
vet(url: string, options?: Options): string;
isSameOrigin(uri: string): boolean;
extractParamValueFromUri(uri: string, queryParamName: string): string;
checkParamsOverWhiteList(uri: string, paramsWhiteList?: string[] | Record<string, RegExp>, params?: Params): boolean;
};
export type URISanityAPI = typeof URISanity;
export default URISanity;
}