File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,10 +160,6 @@ export class BaseTableBuilder {
160160 getMarginEdgeCols ( ) {
161161 const cols = [ ]
162162 this . data . columns . values . forEach ( ( value , icol ) => {
163- if ( ! Array . isArray ( value ) ) {
164- if ( this . options . marginLabels . includes ( value ) ) cols . push ( icol )
165- return
166- }
167163 for ( let level = 0 ; level < value . length ; level ++ ) {
168164 if ( ! this . options . marginLabels . includes ( value [ level ] ) ) continue
169165 if ( this . data . columns . spans [ level ] . some ( s => s . iloc === icol ) ) {
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ export class DefaultTableBuilder extends BaseTableBuilder {
278278 * @returns {string } HTML string for the th element
279279 */
280280 buildColumnLabel ( value , mappedValue , iloc ) {
281- const selectedValue = Array . isArray ( mappedValue ) ? mappedValue . at ( - 1 ) : mappedValue
281+ const selectedValue = mappedValue . at ( - 1 )
282282 const attrs = this . data . columns . attrs [ iloc ]
283283
284284 const attributes = {
@@ -491,7 +491,7 @@ export class DefaultTableBuilder extends BaseTableBuilder {
491491 * @returns {string } HTML string for the index cell
492492 */
493493 buildIndex ( value ) {
494- const selectedValue = Array . isArray ( value ) ? value . at ( - 1 ) : value
494+ const selectedValue = value . at ( - 1 )
495495 const level = this . data . index . nlevels - 1
496496 const attrs = this . data . index . attrs [ level ]
497497 const formattedValue = this . formatValue ( selectedValue , attrs . dtype , attrs . formatOptions ?? this . options )
Original file line number Diff line number Diff line change @@ -111,11 +111,7 @@ export class Data extends EventTarget {
111111
112112 const indexValues = this . index . values
113113 . slice ( startRow , endRow )
114- . map ( value =>
115- Array . isArray ( value )
116- ? value . slice ( dropLevels )
117- : value
118- )
114+ . map ( value => value . slice ( dropLevels ) )
119115
120116 return new Data ( {
121117 values : slicedValues ,
@@ -156,19 +152,15 @@ export class Data extends EventTarget {
156152
157153 const headIdx = indexValues . slice ( 0 , trimSize )
158154 const tailIdx = indexValues . slice ( - trimSize )
159- const sepIdx = Array . isArray ( indexValues [ 0 ] )
160- ? Array ( this . index . nlevels ) . fill ( separator )
161- : separator
155+ const sepIdx = Array ( this . index . nlevels ) . fill ( separator )
162156 indexValues = [ ...headIdx , sepIdx , ...tailIdx ]
163157 }
164158
165159 // Handle columns if needed
166160 if ( this . columns . length > maxColumns ) {
167161 const headCols = columnValues . slice ( 0 , trimSize )
168162 const tailCols = columnValues . slice ( - trimSize )
169- const sepCol = Array . isArray ( columnValues [ 0 ] )
170- ? Array ( this . columns . nlevels ) . fill ( separator )
171- : separator
163+ const sepCol = Array ( this . columns . nlevels ) . fill ( separator )
172164 columnValues = [ ...headCols , sepCol , ...tailCols ]
173165
174166 values = values . map ( row => {
Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ export class FormatTable extends HTMLElement {
322322
323323 return `
324324 <tr data-column-index="${ idx } ">
325- <td>${ Array . isArray ( col ) ? col . at ( - 1 ) : col } </td>
325+ <td>${ col . at ( - 1 ) } </td>
326326 <td>${ attrs . dtype ?? "-" } </td>
327327 <td>${ this . getFormatSummary ( attrs . formatOptions , attrs . dtype ) } </td>
328328 <td>
You can’t perform that action at this time.
0 commit comments