LesterLyu / fast-formula-parser

Parse and evaluate MS Excel formula in javascript.
https://www.npmjs.com/package/fast-formula-parser
MIT License
462 stars 64 forks source link

README.md lines 101-106 unnecessary #28

Closed danielgesua closed 3 years ago

danielgesua commented 4 years ago

Hi Lester,

Aren't lines 101-106 of your readme example unnecessary and unreachable due to the first return statement? Or I could be missing some silly fact somewhere.

Thanks,

Daniel Gesua

LesterLyu commented 3 years ago

It means you should return one of the two data structure, a range reference (A1:B2) or a single cell reference (A1).

Updated README.md

// If it is a range reference (A1:B2)
return {
    sheet: 'sheet name',
    from: {
        row: 1,
        col: 1,
    },
    to: {
        row: 2,
        col: 2,
    }
};
// If it is a cell reference (A1)
return {
    sheet: 'sheet name',
    row: 1,
    col: 1
}
danielgesua commented 3 years ago

Oh hahaha! Silly me. That's for us to decide. I see