Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Furi

A class representing a normalized absolute file:// URI.

This is a subclass of url.URL with the following extra checks:

  • The protocol is file:.
  • The pathname does not contain consecutive slashes (a//b) ("normalization").
  • The pathname does not contain the . or .. segments (enforced by url.URL already).
  • The host localhost is represented as the empty string (enforced by url.URL already).

This class extends url.URL. This means that you can pass it to any function expecting a url.URL. It also means that the URI is always absolute.

Notes:

  • A single trailing slash is allowed.
  • The hostname is allowed to be any string. A non-empty string is used by Windows to represents files on a network drive. An empty string means localhost.
  • The username, password and port properties are always "" (enforced by url.URL already). This implies that host only contains hostname.
  • The search and hash properties can have any value.

Hierarchy

  • URL
    • Furi

Index

Constructors

constructor

Properties

hash

hash: string

host

host: string

hostname

hostname: string

href

href: string

origin

origin: string

password

password: string

port

port: string

search

search: string

searchParams

searchParams: URLSearchParams

username

username: string

Accessors

pathname

  • get pathname(): string
  • set pathname(value: string): void

protocol

  • get protocol(): string
  • set protocol(value: string): void

Methods

hasTrailingSlash

  • hasTrailingSlash(): boolean

setTrailingSlash

  • setTrailingSlash(hasTrailingSlash: boolean): void

toJSON

  • toJSON(): string
  • Returns string

toPosixPath

  • toPosixPath(): string

toString

  • toString(): string
  • Returns string

toSysPath

  • toSysPath(windowsLongPath?: boolean): string
  • Parameters

    • Default value windowsLongPath: boolean = false

    Returns string

toWindowsLongPath

  • toWindowsLongPath(): string

toWindowsShortPath

  • toWindowsShortPath(): string

Generated using TypeDoc