Installation
npm install --save @types/jsurl
Summary
This package contains type definitions for jsurl (http://github.com/Sage/jsurl).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsurl.
index.d.ts
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics -- easier to use this function using a generic rather than casting
export function stringify<T>(value: T): string;
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics -- easier to use this function using a generic rather than casting
export function parse<T extends object>(urlFragment: string): T;
/**
* Same as `parse`, but returns `def` if parsing fails.
* @param urlFragment the URL fragment to parse
* @param def the default value to return if parsing fails
*/
export function tryParse<T extends object>(urlFragment: string, def?: T): T;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: none
Credits
These definitions were written by Ben Grynhaus.