npm.io
0.1.2 • Published 2 years ago

@types/jsurl

Licence
MIT
Version
0.1.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0337 GMT
  • Dependencies: none

Credits

These definitions were written by Ben Grynhaus.