f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/js/formulas/info/ISERR.ts
-rw-r--r--
867
 1import { F7Exception } from "../../errors/F7Exception";
 2import { F7ExceptionName } from "../../errors/F7ExceptionName";
 3import { SheetColumnRowKey } from "../../models/common/SheetColumnRowKey";
 4import { Complex } from "../../models/common/Types";
 5import { Converters } from "../../utils/Converters";
 6import { AbstractFormula } from "../AbstractFormula";
 7import { FormulaName } from "../FormulaName";
 8
 9export class ISERR extends AbstractFormula {
10  static SELF: ISERR = new ISERR();
11  NAME = FormulaName.ISERR;
12
13  internal(origin: SheetColumnRowKey, ...values: Array<Complex>) {
14    AbstractFormula.checkLength(values.length, 1, this.NAME);
15    const first = Converters.first(this.collateralLookup(origin, values[0]));
16    if (first instanceof F7Exception) {
17      return Converters.castAsF7Exception(first).name !== F7ExceptionName.NA;
18    }
19    return false;
20  }
21}