From ab01ce495d878a75b8824c6cfc763a162ed0be26 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 12 Nov 2020 15:01:11 -0500 Subject: [PATCH] (core) make ValueFormatter.format honor its return type Summary: make ValueFormatter.format honor its return type Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D2663 --- app/common/ValueFormatter.ts | 2 +- app/server/serverMethods.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/ValueFormatter.ts b/app/common/ValueFormatter.ts index 73aa1c30..24598c6d 100644 --- a/app/common/ValueFormatter.ts +++ b/app/common/ValueFormatter.ts @@ -56,7 +56,7 @@ export class BaseFormatter { * classes to handle values in formatter-specific ways. */ public format(value: any): string { - return value; + return String(value); } /** diff --git a/app/server/serverMethods.js b/app/server/serverMethods.js index be79084c..0d3d93a3 100644 --- a/app/server/serverMethods.js +++ b/app/server/serverMethods.js @@ -105,7 +105,7 @@ function makeCSV(activeDoc, viewSectionId, sortOrder, req) { rowIds.forEach(row => { csvMatrix.push(access.map((getter, c) => formatters[c].formatAny(getter(row)))); }); - return csv.stringifyAsync(csvMatrix, {formatters: {bool: v => '' + Number(v)}}); + return csv.stringifyAsync(csvMatrix); }); } exports.makeCSV = makeCSV;