csv_4180
Version:
CSV according to RFC 4180. Everyone else's are weirdly wrong. Heavily tested; in typescript
44 lines (24 loc) • 668 B
text/typescript
type item = string;
type row = item[];
type doc = row[];
enum headerMode {
none = 'none',
index = 'index',
number = 'number',
first = 'first'
};
enum quotingCircumstance {
minimal = 'minimal',
always = 'always',
except_numbers = 'except_numbers',
strict_nl = 'strict_nl'
};
interface stringifyOptions {
headers? : row | false,
quoter? : (s: string) => string,
field_separator? : string,
row_separator? : string,
trailing_row_separator? : boolean
// , consumer: function
}
export { item, row, doc, headerMode, quotingCircumstance, stringifyOptions };