Interface Dsv

Index

Call signatures

Methods

Call signatures

(url: string, callback?: (error: any, response: any[]) => void): Xhr

Request a delimited values file

Parameters

  • url: string

    Url to request

  • callback?: (error: any, response: any[]) => void optional

    Function to invoke when resource is loaded or the request fails

Returns

Xhr

Methods

public format(rows: Array<any>): string

Format an array of tuples into a delimited string.

Parameters

  • rows: Array<any>

    Array to convert to a delimited string

Returns

string

public parse(string: string): Array<any>

Parse a delimited string into objects using the header row.

Parameters

  • string: string

    delimited formatted string to parse

Returns

Array<any>

public parseRows(string: string, accessor: (row: any[], index: number) => any): any

Parse a delimited string into tuples, ignoring the header row.

Parameters

  • string: string

    delimited formatted string to parse

  • accessor: (row: any[], index: number) => any

Returns

any