MCPcopy
hub / github.com/exceljs/exceljs / model

Method model

lib/doc/worksheet.js:862–905  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

860 // Model
861
862 get model() {
863 const model = {
864 id: this.id,
865 name: this.name,
866 dataValidations: this.dataValidations.model,
867 properties: this.properties,
868 state: this.state,
869 pageSetup: this.pageSetup,
870 headerFooter: this.headerFooter,
871 rowBreaks: this.rowBreaks,
872 views: this.views,
873 autoFilter: this.autoFilter,
874 media: this._media.map(medium => medium.model),
875 sheetProtection: this.sheetProtection,
876 tables: Object.values(this.tables).map(table => table.model),
877 pivotTables: this.pivotTables,
878 conditionalFormattings: this.conditionalFormattings,
879 };
880
881 // =================================================
882 // columns
883 model.cols = Column.toModel(this.columns);
884
885 // ==========================================================
886 // Rows
887 const rows = (model.rows = []);
888 const dimensions = (model.dimensions = new Range());
889 this._rows.forEach(row => {
890 const rowModel = row && row.model;
891 if (rowModel) {
892 dimensions.expand(rowModel.number, rowModel.min, rowModel.number, rowModel.max);
893 rows.push(rowModel);
894 }
895 });
896
897 // ==========================================================
898 // Merges
899 model.merges = [];
900 _.each(this._merges, merge => {
901 model.merges.push(merge.range);
902 });
903
904 return model;
905 }
906
907 _parseRows(model) {
908 this._rows = [];

Callers

nothing calls this directly

Calls 10

_parseRowsMethod · 0.95
_parseMergeCellsMethod · 0.95
toModelMethod · 0.80
mapMethod · 0.65
forEachMethod · 0.65
expandMethod · 0.65
valuesMethod · 0.45
pushMethod · 0.45
eachMethod · 0.45
fromModelMethod · 0.45

Tested by

no test coverage detected