hyperformula
Version:
HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas
30 lines • 662 B
JavaScript
/**
* @license
* Copyright (c) 2025 Handsoncode. All rights reserved.
*/
import { CellError } from "../Cell.mjs";
/**
* Represents a cell that contains a parsing error.
*/
export class ParsingErrorVertex {
/**
* Constructor
*/
constructor(errors, rawInput) {
this.errors = errors;
this.rawInput = rawInput;
}
/**
* Returns the value of the cell.
*/
getCellValue() {
const firstNonemptyMessage = this.errors.map(error => error.message).find(msg => msg);
return CellError.parsingError(firstNonemptyMessage);
}
/**
* Returns the formula of the cell.
*/
getFormula() {
return this.rawInput;
}
}