Home Reference Source Repository
import Path from 'Uri/src/Path.js'
public class | source

Path

Class to manage URL paths

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

ctx: *

Method Summary

Public Methods
public

append(s: string): instance

Append to a path

public

delete(loc: integer): instance

Delete end of path

public

get(): array

Get the path

public

parse(f: string): instance

Parse the path part of a URl

public

replace(f: string, loc: integer): instance

Replace part of a path

public

toString(uri: boolen): string

Get string representatio of the path or the uri

Public Constructors

public constructor(f: string, ctx: object) source

Params:

NameTypeAttributeDescription
f string

string path

ctx object

context of Uri class

Public Members

public ctx: * source

Public Methods

public append(s: string): instance source

Append to a path

Params:

NameTypeAttributeDescription
s string

path to append

Return:

instance

for chaining

public delete(loc: integer): instance source

Delete end of path

Params:

NameTypeAttributeDescription
loc integer

segment of path to delete

Return:

instance

for chaining

public get(): array source

Get the path

Return:

array

path as array

public parse(f: string): instance source

Parse the path part of a URl

Params:

NameTypeAttributeDescription
f string

string path

Return:

instance

for chaining

public replace(f: string, loc: integer): instance source

Replace part of a path

Params:

NameTypeAttributeDescription
f string

path replacement

loc integer

location to replace

Return:

instance

for chaining

public toString(uri: boolen): string source

Get string representatio of the path or the uri

Params:

NameTypeAttributeDescription
uri boolen

if true return string represention of uri

Return:

string

path or uri as string