vhp-vapi-client

Home BACK

VHP API Library

Printing

SaveTableToExcel

/**
 * Will only create a single tab with the default name ('sheet1')
 * @param { object } param0 
 * @param { string } param0.name The filename of the resulting file
 * @param { object[] } param0.list The table to become the sheet
 * @returns 
 */

SaveObjectToExcel

/**
 * For creating more complex Workbooks
 * @param { object } param0 
 * @param { string } param0.filename The filename of the resulting file
 * @param { object[] } param0.tables Array of tables to turn in to tabs
 * @param { string } param0.tables.tabname Tab name
 * @param { object[] } param0.tables.data Array to convert into a table
 * @returns 
 */

Formatting

months

/**
 * Standard array of months to use for calculations / display / etc.
 * Array postition [i] is representative of the number order of the months in the year NOT the Date().getMonth value
 * [{ name, abbrev }]
 */

ioFormat() & typeFormats

ioFormat()

/**
 * @param { number | string | date } value The value to be converted
 * @param { string } type The type of formatting requested ( number, price, percent, phone, zip, date )
 * @param { string } [direct='set'] The direction the value is going through ( set || get )
 * @param { object[] } [options] 
 * @returns { number | string | date } The returned formatted string or de-formatted value
 */

setNumberFormat()

setPriceFormat()

setPercentFormat()

setPhoneFormat()

setZipFormat()

setDateFormat()

toTitleCase

/**
 * 
 * @param { string } str The string to be converted
 * @returns { string } Converted string
 */

Sortlist

/**
 * 
 * @param { object[] } list 
 * @param { string } sortopt 
 * @param { number } sortorder 
 * @returns { Promise < object[] > }
 */

Assurance

StringValidate

/**
 * 
 * @param { string } str The string to check for invalid characters
 * @returns { boolean }
 */