packages/opal-node-msexcel/msexcel.js
function writeRows(ws, rows, contents) {
        // console.log('Typeof Rows %s', typeof rows);
        // console.log('Typeof Rows %s', rows);
        // console.log('Length Rows %d', rows.length);
        let range = ws['!ref'];
        range = check.undefined(range) ? 'A1:A1' : range;
        let dRange = xlsx.utils.decode_range(range);
        let newRef = {s: {c: 0, r: 0}, e: {c: dRange.e.c, r: dRange.e.r}};
        let encCell;
        if (typeof rows === 'string') {
            rows = rows.split(',');
        }
        for (let i = 0; i < rows.length; ++i) {
            let dRow = xlsx.utils.decode_row(rows[i]);
            let cellVal = contents[i];
            // console.log('contents[%d]=%s', i, cellVal);
            if (dRow > newRef.e.r) {
                newRef.e.r = dRow;
            }

            for (let C = dRange.s.c; C < cellVal.length; ++C) {
                encCell = xlsx.utils.encode_cell({c: C, r: dRow});
                if (C > newRef.e.c) {
                    newRef.e.c = C;
                }
                ws[encCell] = updateCellData(ws[encCell], cellVal[C]);
            }
        }
        ws['!ref'] = xlsx.utils.encode_range(newRef);
        return ws;
    }
function writeRows(ws, rows, contents) {
        // console.log('Typeof Rows %s', typeof rows);
        // console.log('Typeof Rows %s', rows);
        // console.log('Length Rows %d', rows.length);
        let range = ws['!ref'];
        range = check.undefined(range) ? 'A1:A1' : range;
        let dRange = xlsx.utils.decode_range(range);
        let newRef = {s: {c: 0, r: 0}, e: {c: dRange.e.c, r: dRange.e.r}};
        let encCell;
        if (typeof rows === 'string') {
            rows = rows.split(',');
        }
        for (let i = 0; i < rows.length; ++i) {
            let dRow = xlsx.utils.decode_row(rows[i]);
            let cellVal = contents[i];
            // console.log('contents[%d]=%s', i, cellVal);
            if (dRow > newRef.e.r) {
                newRef.e.r = dRow;
            }

            for (let C = dRange.s.c; C < cellVal.length; ++C) {
                encCell = xlsx.utils.encode_cell({c: C, r: dRow});
                if (C > newRef.e.c) {
                    newRef.e.c = C;
                }
                ws[encCell] = updateCellData(ws[encCell], cellVal[C]);
            }
        }
        ws['!ref'] = xlsx.utils.encode_range(newRef);
        return ws;
    }
function writeRows ( ws , rows , contents ) { // console.log('Typeof Rows %s', typeof rows); // console.log('Typeof Rows %s', rows); // console.log('Length Rows %d', rows.length); let range = ws [ '!ref' ] ; range = check . undefined ( range ) ? 'A1:A1' : range ; let dRange = xlsx . utils . decode_range ( range ) ; let newRef = { s : { c : 0 , r : 0 } , e : { c : dRange . e . c , r : dRange . e . r } } ; let encCell ; if ( typeof rows === 'string' ) { rows = rows . split ( ',' ) ; } for ( let i = 0 ; i < rows . length ; ++ i ) { let dRow = xlsx . utils . decode_row ( rows [ i ] ) ; let cellVal = contents [ i ] ; // console.log('contents[%d]=%s', i, cellVal); if ( dRow > newRef . e . r ) { newRef . e . r = dRow ; } for ( let C = dRange . s . c ; C < cellVal . length ; ++ C ) { encCell = xlsx . utils . encode_cell ( { c : C , r : dRow } ) ; if ( C > newRef . e . c ) { newRef . e . c = C ; } ws [ encCell ] = updateCellData ( ws [ encCell ] , cellVal [ C ] ) ; } } ws [ '!ref' ] = xlsx . utils . encode_range ( newRef ) ; return ws ; }
writes specified rows to an opened workbook
@function
@param {object} ws - worksheet.
@param {object} rows - rows where contents are written
@param {boolean} contents - contents that are to written to specified rows
@return {object} ws - returns the modified worksheet
writes specified rows to an opened workbook