UNPKG

csv_4180

Version:

CSV according to RFC 4180. Everyone else's are weirdly wrong. Heavily tested; in typescript

15 lines (6 loc) 404 B
import {describe} from 'ava-spec'; import {stringifyMakeRow, quoteMinimal, quoteAlways} from '../to_csv'; describe('stringifyMakeRow', async it => { it("['a','b','c']", t => t.is( 'a,b,c', stringifyMakeRow(['a','b','c'], quoteMinimal, ',') ) ); it("['a','b','c']", t => t.is( '"a";"b";"c"', stringifyMakeRow(['a','b','c'], quoteAlways, ';') ) ); });