csv_4180
Version:
CSV according to RFC 4180. Everyone else's are weirdly wrong. Heavily tested; in typescript
26 lines • 1.61 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const ava_spec_1 = require("ava-spec");
const to_csv_1 = require("../to_csv");
ava_spec_1.describe('quoteMinimal', (it) => __awaiter(this, void 0, void 0, function* () {
it('a', t => t.is('a', to_csv_1.quoteMinimal('a')));
it('b"c', t => t.is('"b""c"', to_csv_1.quoteMinimal('b"c')));
it('"d"', t => t.is('"""d"""', to_csv_1.quoteMinimal('"d"')));
it('""e""', t => t.is('"""""e"""""', to_csv_1.quoteMinimal('""e""')));
it('f\ng', t => t.is('"f\ng"', to_csv_1.quoteMinimal('f\ng')));
it('h\ri', t => t.is('"h\ri"', to_csv_1.quoteMinimal('h\ri')));
it('j\r\nk', t => t.is('"j\r\nk"', to_csv_1.quoteMinimal('j\r\nk')));
it('1', t => t.is('1', to_csv_1.quoteMinimal('1')));
it('-2', t => t.is('-2', to_csv_1.quoteMinimal('-2')));
it('+3', t => t.is('+3', to_csv_1.quoteMinimal('+3')));
it('4.0', t => t.is('4.0', to_csv_1.quoteMinimal('4.0')));
}));
//# sourceMappingURL=quoteMinimal.js.map