packages/opal-node-msexcel/msexcel.js
function writeRegion(ws, urange, contents) {
        let range = ws['!ref'];
        range = check.undefined(range) ? 'A1:A1' : range;
        let dRange = xlsx.utils.decode_range(range);
        let dUrange = xlsx.utils.decode_range(urange);
        let newRef = {s: {c: 0, r: 0}, e: {c: dRange.e.c, r: dRange.e.r}};
        let encCell;

        for (let R = dUrange.s.r, i = 0; R <= dUrange.e.r; ++R, ++i) {
            let cellVal = contents[i];
            if (R > newRef.e.r) {
                newRef.e.r = R;
            }

            for (let C = dUrange.s.c, j = 0; C <= dUrange.e.c; ++C, ++j) {
                encCell = xlsx.utils.encode_cell({c: C, r: R});

                if (C > newRef.e.c) {
                    newRef.e.c = C;
                }
                ws[encCell] = updateCellData(ws[encCell], cellVal[j]);
            }
        }
        ws['!ref'] = xlsx.utils.encode_range(newRef);
        return ws;
    }
function writeRegion(ws, urange, contents) {
        let range = ws['!ref'];
        range = check.undefined(range) ? 'A1:A1' : range;
        let dRange = xlsx.utils.decode_range(range);
        let dUrange = xlsx.utils.decode_range(urange);
        let newRef = {s: {c: 0, r: 0}, e: {c: dRange.e.c, r: dRange.e.r}};
        let encCell;

        for (let R = dUrange.s.r, i = 0; R <= dUrange.e.r; ++R, ++i) {
            let cellVal = contents[i];
            if (R > newRef.e.r) {
                newRef.e.r = R;
            }

            for (let C = dUrange.s.c, j = 0; C <= dUrange.e.c; ++C, ++j) {
                encCell = xlsx.utils.encode_cell({c: C, r: R});

                if (C > newRef.e.c) {
                    newRef.e.c = C;
                }
                ws[encCell] = updateCellData(ws[encCell], cellVal[j]);
            }
        }
        ws['!ref'] = xlsx.utils.encode_range(newRef);
        return ws;
    }
function writeRegion ( ws , urange , contents ) { let range = ws [ '!ref' ] ; range = check . undefined ( range ) ? 'A1:A1' : range ; let dRange = xlsx . utils . decode_range ( range ) ; let dUrange = xlsx . utils . decode_range ( urange ) ; let newRef = { s : { c : 0 , r : 0 } , e : { c : dRange . e . c , r : dRange . e . r } } ; let encCell ; for ( let R = dUrange . s . r , i = 0 ; R <= dUrange . e . r ; ++ R , ++ i ) { let cellVal = contents [ i ] ; if ( R > newRef . e . r ) { newRef . e . r = R ; } for ( let C = dUrange . s . c , j = 0 ; C <= dUrange . e . c ; ++ C , ++ j ) { encCell = xlsx . utils . encode_cell ( { c : C , r : R } ) ; if ( C > newRef . e . c ) { newRef . e . c = C ; } ws [ encCell ] = updateCellData ( ws [ encCell ] , cellVal [ j ] ) ; } } ws [ '!ref' ] = xlsx . utils . encode_range ( newRef ) ; return ws ; }
writes a specified region to an opened workbook
@function
@param {object} ws - worksheet.
@param {object} urange - range where contents are written
@param {boolean} contents - contents that are to written to specified range
@return {object} ws - returns the modified worksheet
writes a specified region to an opened workbook