@types/jsurl
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jsurl

Weekly Downloads

18,535

Version

0.1.2

License

MIT

Unpacked Size

3.76 kB

Total Files

5

Last publish

Collaborators

  • types