UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

20 lines (19 loc) 565 B
"use strict"; exports.__esModule = true; exports.valueGetter = valueGetter; var _object = require("../../../helpers/object"); var _array = require("../../../helpers/array"); /** * Defines the value being displayed in an multiSelect-typed cells. * * @param {*} value The value to be displayed. * @returns {*} The final value of the cell. */ function valueGetter(value) { if (Array.isArray(value)) { return (0, _array.arrayToString)(value.map(val => { return (0, _object.isKeyValueObject)(val) ? val.value : val; }), ', '); } return value; }