UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

16 lines 683 B
import { ootbLinkFilename } from '../constants/columnsOOTB'; /** * replaceTitleWithThisColumn will replace the 'Title' column with any other column in an array of fields. * By default, it will replace Title with the LinkFileName since that is the most common replacement for a library. * @param currentFields * @param replacementField * @returns */ export function replaceTitleWithThisColumn(currentFields, replacementField = ootbLinkFilename) { const result = []; currentFields.map((field) => { result.push(field.name !== 'Title' ? field : replacementField); }); return result; } //# sourceMappingURL=replaceTitleWithThisColumn.js.map