From 6e3124768b46bf79a943a3b4b15209cff6f5cfa6 Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Tue, 3 Sep 2024 12:19:45 +0200 Subject: [PATCH] docs(compensations): document preview string function --- studio/schemas/documents/compensations.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/studio/schemas/documents/compensations.ts b/studio/schemas/documents/compensations.ts index f8f383e81..8a652d0a3 100644 --- a/studio/schemas/documents/compensations.ts +++ b/studio/schemas/documents/compensations.ts @@ -59,6 +59,13 @@ const compensations = defineType({ }, }); +/** + * Generates a preview string based on the selected office locations. + * + * @param {Object} locationsMap - A map of office titles selected for preview, e.g., { office0: "Trondheim", office1: "Oslo", ... }. + * @param {number} cutoff - The maximum number of locations to display before shortening the preview string. + * @returns {string|undefined} - A formatted string summarizing the selected locations or `undefined` if no locations are selected. + */ function previewStringFromLocationsMap( locationsMap: { [key: string]: string;