Skip to content

IDataParserOptions

Type interface

Defines common options for all data parsers.

Sources

IDataParserOptions is an interface: it describes a shape of data and is not imported on its own.

Inheritance

IDataParserOptions does not extend any other symbol.

IDataParserOptions is extended by ICSVOptions, IJSONOptions.

Properties

dateFields

Type string[]

List of fields in data that need to be treated as Dates, i.e. converted to Date objects from whatever source format they are currently in.

dateFormat

Type string

Override date format set in dateFormatter.

More info: Formatting Date & Time: parsing dates Tutorial on date parsing

dateFormatter

Type DateFormatter

An instance of DateFormatter to use when parsing string-based dates.

If it's not set, the parser will create it's own instance of DateFormatter, should any date parsing required. (dateFields is set)Unless dateFormat is set in parser options, the parser will try to look for dateFormat in dateFormatter.

More info: Formatting Date & Time: parsing dates Tutorial on date parsing

emptyAs

Type any

Empty values (e.g. empty strings, null, etc.) will be replaced with this.

numberFields

Type string[]

List of fields in data that hold numeric values. Parser will try to convert the value in those fields to a number.