@cj-tech-master/excelts 9.2.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/README_zh.md +29 -6
- package/dist/browser/index.browser.d.ts +1 -1
- package/dist/browser/index.browser.js +4 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +4 -0
- package/dist/browser/modules/excel/cell.d.ts +17 -3
- package/dist/browser/modules/excel/cell.js +170 -22
- package/dist/browser/modules/excel/defined-names.d.ts +96 -1
- package/dist/browser/modules/excel/defined-names.js +411 -21
- package/dist/browser/modules/excel/image.d.ts +11 -0
- package/dist/browser/modules/excel/image.js +24 -1
- package/dist/browser/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/browser/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/browser/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/browser/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/browser/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/browser/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/browser/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/browser/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/browser/modules/excel/table.js +15 -2
- package/dist/browser/modules/excel/types.d.ts +133 -2
- package/dist/browser/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/browser/modules/excel/utils/col-cache.js +15 -0
- package/dist/browser/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/browser/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/browser/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/browser/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/browser/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/browser/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/browser/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/browser/modules/excel/utils/shared-strings.js +21 -2
- package/dist/browser/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/browser/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/browser/modules/excel/workbook.browser.js +318 -34
- package/dist/browser/modules/excel/workbook.d.ts +1 -1
- package/dist/browser/modules/excel/worksheet.d.ts +3 -1
- package/dist/browser/modules/excel/worksheet.js +21 -2
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/browser/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/browser/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/browser/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/browser/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/browser/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/browser/modules/formula/compile/address-utils.js +83 -0
- package/dist/browser/modules/formula/compile/binder.d.ts +42 -0
- package/dist/browser/modules/formula/compile/binder.js +487 -0
- package/dist/browser/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/browser/modules/formula/compile/bound-ast.js +80 -0
- package/dist/browser/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/browser/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/browser/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/browser/modules/formula/default-syntax-probe.js +83 -0
- package/dist/browser/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/browser/modules/formula/functions/_date-context.js +29 -0
- package/dist/browser/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/browser/modules/formula/functions/_shared.js +381 -0
- package/dist/browser/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/browser/modules/formula/functions/conditional.js +343 -0
- package/dist/browser/modules/formula/functions/database.d.ts +37 -0
- package/dist/browser/modules/formula/functions/database.js +274 -0
- package/dist/browser/modules/formula/functions/date.d.ts +61 -0
- package/dist/browser/modules/formula/functions/date.js +855 -0
- package/dist/browser/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/browser/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/browser/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/browser/modules/formula/functions/engineering.js +1128 -0
- package/dist/browser/modules/formula/functions/financial.d.ts +202 -0
- package/dist/browser/modules/formula/functions/financial.js +2296 -0
- package/dist/browser/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/browser/modules/formula/functions/lookup.js +886 -0
- package/dist/browser/modules/formula/functions/math.d.ts +114 -0
- package/dist/browser/modules/formula/functions/math.js +1406 -0
- package/dist/browser/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/browser/modules/formula/functions/statistical.js +3390 -0
- package/dist/browser/modules/formula/functions/text.d.ts +86 -0
- package/dist/browser/modules/formula/functions/text.js +1845 -0
- package/dist/browser/modules/formula/host-registry.d.ts +53 -0
- package/dist/browser/modules/formula/host-registry.js +69 -0
- package/dist/browser/modules/formula/index.d.ts +39 -0
- package/dist/browser/modules/formula/index.js +49 -0
- package/dist/browser/modules/formula/install.d.ts +62 -0
- package/dist/browser/modules/formula/install.js +88 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/browser/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/browser/modules/formula/integration/formula-instance.js +79 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/browser/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/browser/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/browser/modules/formula/materialize/types.d.ts +179 -0
- package/dist/browser/modules/formula/materialize/types.js +29 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/browser/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/browser/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/browser/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/browser/modules/formula/runtime/function-registry.js +840 -0
- package/dist/browser/modules/formula/runtime/values.d.ts +211 -0
- package/dist/browser/modules/formula/runtime/values.js +385 -0
- package/dist/browser/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/browser/modules/formula/syntax/ast.js +28 -0
- package/dist/browser/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/browser/modules/formula/syntax/parser.js +439 -0
- package/dist/browser/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/browser/modules/formula/syntax/token-types.js +59 -0
- package/dist/browser/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/dist/browser/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/browser/modules/pdf/excel-bridge.js +9 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/modules/excel/cell.js +170 -22
- package/dist/cjs/modules/excel/defined-names.js +411 -21
- package/dist/cjs/modules/excel/image.js +24 -1
- package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/cjs/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/cjs/modules/excel/table.js +15 -2
- package/dist/cjs/modules/excel/utils/col-cache.js +15 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/cjs/modules/excel/utils/external-link-formula.js +212 -0
- package/dist/cjs/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +42 -2
- package/dist/cjs/modules/excel/utils/shared-strings.js +21 -2
- package/dist/cjs/modules/excel/utils/workbook-protection.js +33 -0
- package/dist/cjs/modules/excel/workbook.browser.js +318 -34
- package/dist/cjs/modules/excel/worksheet.js +20 -1
- package/dist/cjs/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +333 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/external-reference-xform.js +27 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-protection-xform.js +69 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +18 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/metadata-xform.js +161 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +108 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/cjs/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +83 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/cjs/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +408 -18
- package/dist/cjs/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/cjs/modules/formula/compile/address-utils.js +89 -0
- package/dist/cjs/modules/formula/compile/binder.js +489 -0
- package/dist/cjs/modules/formula/compile/bound-ast.js +68 -0
- package/dist/cjs/modules/formula/compile/compiled-formula.js +387 -0
- package/dist/cjs/modules/formula/compile/dependency-analysis.js +437 -0
- package/dist/cjs/modules/formula/compile/structured-ref-utils.js +141 -0
- package/dist/cjs/modules/formula/default-syntax-probe.js +87 -0
- package/dist/cjs/modules/formula/functions/_date-context.js +33 -0
- package/dist/cjs/modules/formula/functions/_shared.js +396 -0
- package/dist/cjs/modules/formula/functions/conditional.js +354 -0
- package/dist/cjs/modules/formula/functions/database.js +288 -0
- package/dist/cjs/modules/formula/functions/date.js +883 -0
- package/dist/cjs/modules/formula/functions/dynamic-array.js +881 -0
- package/dist/cjs/modules/formula/functions/engineering.js +1183 -0
- package/dist/cjs/modules/formula/functions/financial.js +2348 -0
- package/dist/cjs/modules/formula/functions/lookup.js +902 -0
- package/dist/cjs/modules/formula/functions/math.js +1487 -0
- package/dist/cjs/modules/formula/functions/statistical.js +3488 -0
- package/dist/cjs/modules/formula/functions/text.js +1889 -0
- package/dist/cjs/modules/formula/host-registry.js +75 -0
- package/dist/cjs/modules/formula/index.js +58 -0
- package/dist/cjs/modules/formula/install.js +93 -0
- package/dist/cjs/modules/formula/integration/apply-writeback-plan.js +213 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas-impl.js +619 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas.js +71 -0
- package/dist/cjs/modules/formula/integration/formula-instance.js +82 -0
- package/dist/cjs/modules/formula/integration/workbook-adapter.js +327 -0
- package/dist/cjs/modules/formula/integration/workbook-snapshot.js +84 -0
- package/dist/cjs/modules/formula/materialize/build-writeback-plan.js +475 -0
- package/dist/cjs/modules/formula/materialize/spill-engine.js +42 -0
- package/dist/cjs/modules/formula/materialize/types.js +32 -0
- package/dist/cjs/modules/formula/materialize/writeback-plan.js +28 -0
- package/dist/cjs/modules/formula/runtime/evaluator.js +2298 -0
- package/dist/cjs/modules/formula/runtime/function-registry.js +846 -0
- package/dist/cjs/modules/formula/runtime/values.js +385 -0
- package/dist/cjs/modules/formula/syntax/ast.js +8 -0
- package/dist/cjs/modules/formula/syntax/parser.js +440 -0
- package/dist/cjs/modules/formula/syntax/token-types.js +32 -0
- package/dist/cjs/modules/formula/syntax/tokenizer.js +1076 -0
- package/dist/cjs/modules/pdf/excel-bridge.js +9 -0
- package/dist/esm/index.browser.js +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/modules/excel/cell.js +170 -22
- package/dist/esm/modules/excel/defined-names.js +411 -21
- package/dist/esm/modules/excel/image.js +24 -1
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/esm/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/esm/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/esm/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/esm/modules/excel/table.js +15 -2
- package/dist/esm/modules/excel/utils/col-cache.js +15 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/esm/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/esm/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/esm/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/esm/modules/excel/utils/shared-strings.js +21 -2
- package/dist/esm/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/esm/modules/excel/workbook.browser.js +318 -34
- package/dist/esm/modules/excel/worksheet.js +21 -2
- package/dist/esm/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/esm/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/esm/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/esm/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/esm/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/esm/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/esm/modules/formula/compile/address-utils.js +83 -0
- package/dist/esm/modules/formula/compile/binder.js +487 -0
- package/dist/esm/modules/formula/compile/bound-ast.js +80 -0
- package/dist/esm/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/esm/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/esm/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/esm/modules/formula/default-syntax-probe.js +83 -0
- package/dist/esm/modules/formula/functions/_date-context.js +29 -0
- package/dist/esm/modules/formula/functions/_shared.js +381 -0
- package/dist/esm/modules/formula/functions/conditional.js +343 -0
- package/dist/esm/modules/formula/functions/database.js +274 -0
- package/dist/esm/modules/formula/functions/date.js +855 -0
- package/dist/esm/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/esm/modules/formula/functions/engineering.js +1128 -0
- package/dist/esm/modules/formula/functions/financial.js +2296 -0
- package/dist/esm/modules/formula/functions/lookup.js +886 -0
- package/dist/esm/modules/formula/functions/math.js +1406 -0
- package/dist/esm/modules/formula/functions/statistical.js +3390 -0
- package/dist/esm/modules/formula/functions/text.js +1845 -0
- package/dist/esm/modules/formula/host-registry.js +69 -0
- package/dist/esm/modules/formula/index.js +49 -0
- package/dist/esm/modules/formula/install.js +88 -0
- package/dist/esm/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/esm/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/esm/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/esm/modules/formula/integration/formula-instance.js +79 -0
- package/dist/esm/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/esm/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/esm/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/esm/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/esm/modules/formula/materialize/types.js +29 -0
- package/dist/esm/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/esm/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/esm/modules/formula/runtime/function-registry.js +840 -0
- package/dist/esm/modules/formula/runtime/values.js +385 -0
- package/dist/esm/modules/formula/syntax/ast.js +28 -0
- package/dist/esm/modules/formula/syntax/parser.js +439 -0
- package/dist/esm/modules/formula/syntax/token-types.js +59 -0
- package/dist/esm/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/esm/modules/pdf/excel-bridge.js +9 -0
- package/dist/iife/excelts.iife.js +2302 -373
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +34 -34
- package/dist/types/index.browser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/modules/excel/cell.d.ts +17 -3
- package/dist/types/modules/excel/defined-names.d.ts +96 -1
- package/dist/types/modules/excel/image.d.ts +11 -0
- package/dist/types/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/types/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/types/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/types/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/types/modules/excel/types.d.ts +133 -2
- package/dist/types/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/types/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/types/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/types/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/types/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/types/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/types/modules/excel/workbook.d.ts +1 -1
- package/dist/types/modules/excel/worksheet.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/types/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/types/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/types/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/types/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/types/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/types/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/types/modules/formula/compile/binder.d.ts +42 -0
- package/dist/types/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/types/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/types/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/types/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/types/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/types/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/types/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/types/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/types/modules/formula/functions/database.d.ts +37 -0
- package/dist/types/modules/formula/functions/date.d.ts +61 -0
- package/dist/types/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/types/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/types/modules/formula/functions/financial.d.ts +202 -0
- package/dist/types/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/types/modules/formula/functions/math.d.ts +114 -0
- package/dist/types/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/types/modules/formula/functions/text.d.ts +86 -0
- package/dist/types/modules/formula/host-registry.d.ts +53 -0
- package/dist/types/modules/formula/index.d.ts +39 -0
- package/dist/types/modules/formula/install.d.ts +62 -0
- package/dist/types/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/types/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/types/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/types/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/types/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/types/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/types/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/types/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/types/modules/formula/materialize/types.d.ts +179 -0
- package/dist/types/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/types/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/types/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/types/modules/formula/runtime/values.d.ts +211 -0
- package/dist/types/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/types/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/types/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/types/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/package.json +28 -28
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Function Registry — Declarative function descriptors and native implementations.
|
|
4
|
+
*
|
|
5
|
+
* Each function is described by a `FunctionDescriptor` that carries metadata
|
|
6
|
+
* about arity and the implementation itself. The evaluator uses this metadata
|
|
7
|
+
* to validate arguments and invoke functions.
|
|
8
|
+
*
|
|
9
|
+
* Special forms (IF, LET, LAMBDA, etc.) are NOT registered here — they
|
|
10
|
+
* are handled directly by the evaluator's special-form dispatch.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.registerFunction = registerFunction;
|
|
14
|
+
exports.lookupFunction = lookupFunction;
|
|
15
|
+
exports.defineEager = defineEager;
|
|
16
|
+
exports.ensureRegistryInitialized = ensureRegistryInitialized;
|
|
17
|
+
const token_types_1 = require("../syntax/token-types");
|
|
18
|
+
const values_1 = require("./values");
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// Registry
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* The function registry.
|
|
24
|
+
*
|
|
25
|
+
* Maps uppercase canonical function names to their descriptors.
|
|
26
|
+
* Also handles _XLFN. and _XLFN._XLWS. prefix variants.
|
|
27
|
+
*/
|
|
28
|
+
const registryMap = new Map();
|
|
29
|
+
/**
|
|
30
|
+
* Register a function descriptor. The descriptor is stored under its
|
|
31
|
+
* canonical (unprefixed) name only — `_XLFN.` / `_XLFN._XLWS.` prefix
|
|
32
|
+
* variants are resolved dynamically in `lookupFunction`. This keeps the
|
|
33
|
+
* registry small and avoids triple-entry bookkeeping for 200+ functions.
|
|
34
|
+
*/
|
|
35
|
+
function registerFunction(desc) {
|
|
36
|
+
registryMap.set(desc.name, desc);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Look up a function by uppercase name. Accepts `_XLFN.` and
|
|
40
|
+
* `_XLFN._XLWS.` prefixed variants by stripping the prefix before lookup
|
|
41
|
+
* (a no-op for plain names, so plain lookups also go through a single
|
|
42
|
+
* Map.get call — avoiding the double-lookup pattern used previously).
|
|
43
|
+
*/
|
|
44
|
+
function lookupFunction(name) {
|
|
45
|
+
return registryMap.get((0, token_types_1.stripFunctionPrefix)(name));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Convenience: define and register an eager function.
|
|
49
|
+
*/
|
|
50
|
+
function defineEager(name, minArity, maxArity, invoke) {
|
|
51
|
+
const desc = {
|
|
52
|
+
name,
|
|
53
|
+
minArity,
|
|
54
|
+
maxArity,
|
|
55
|
+
invoke
|
|
56
|
+
};
|
|
57
|
+
registerFunction(desc);
|
|
58
|
+
return desc;
|
|
59
|
+
}
|
|
60
|
+
// ============================================================================
|
|
61
|
+
// Registry Initialization
|
|
62
|
+
// ============================================================================
|
|
63
|
+
/**
|
|
64
|
+
* Initialize the registry with all native function implementations.
|
|
65
|
+
*/
|
|
66
|
+
let initialized = false;
|
|
67
|
+
function ensureRegistryInitialized() {
|
|
68
|
+
if (initialized) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
initialized = true;
|
|
72
|
+
// Register native functions first — metadata + implementation co-located.
|
|
73
|
+
registerNativeInformationAndLogical();
|
|
74
|
+
registerNativeTextFunctions();
|
|
75
|
+
registerNativeDateFunctions();
|
|
76
|
+
registerNativeEngineeringFunctions();
|
|
77
|
+
registerNativeFinancialFunctions();
|
|
78
|
+
registerNativeStatisticalFunctions();
|
|
79
|
+
registerNativeMathFunctions();
|
|
80
|
+
registerNativeConditionalFunctions();
|
|
81
|
+
registerNativeLookupFunctions();
|
|
82
|
+
registerNativeDynamicArrayFunctions();
|
|
83
|
+
registerNativeDatabaseFunctions();
|
|
84
|
+
}
|
|
85
|
+
// ============================================================================
|
|
86
|
+
// Native Function Implementations
|
|
87
|
+
// ============================================================================
|
|
88
|
+
/**
|
|
89
|
+
* Register native implementations for information and logical functions.
|
|
90
|
+
* Metadata and implementation are co-located as the single source of truth.
|
|
91
|
+
*/
|
|
92
|
+
function registerNativeInformationAndLogical() {
|
|
93
|
+
const scalar = (args) => (0, values_1.topLeft)(args[0] ?? values_1.BLANK);
|
|
94
|
+
// ── Information ──
|
|
95
|
+
defineEager("ISNUMBER", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind === 1 /* RVKind.Number */));
|
|
96
|
+
defineEager("ISTEXT", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind === 2 /* RVKind.String */));
|
|
97
|
+
defineEager("ISBLANK", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind === 0 /* RVKind.Blank */));
|
|
98
|
+
defineEager("ISLOGICAL", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind === 3 /* RVKind.Boolean */));
|
|
99
|
+
defineEager("ISERROR", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind === 4 /* RVKind.Error */));
|
|
100
|
+
defineEager("ISERR", 1, 1, args => {
|
|
101
|
+
const v = scalar(args);
|
|
102
|
+
return (0, values_1.rvBoolean)(v.kind === 4 /* RVKind.Error */ && v.code !== "#N/A");
|
|
103
|
+
});
|
|
104
|
+
defineEager("ISNA", 1, 1, args => {
|
|
105
|
+
const v = scalar(args);
|
|
106
|
+
return (0, values_1.rvBoolean)(v.kind === 4 /* RVKind.Error */ && v.code === "#N/A");
|
|
107
|
+
});
|
|
108
|
+
defineEager("ISNONTEXT", 1, 1, args => (0, values_1.rvBoolean)(scalar(args).kind !== 2 /* RVKind.String */));
|
|
109
|
+
defineEager("ISEVEN", 1, 1, args => {
|
|
110
|
+
const v = scalar(args);
|
|
111
|
+
if (v.kind === 4 /* RVKind.Error */) {
|
|
112
|
+
return v;
|
|
113
|
+
}
|
|
114
|
+
if (v.kind !== 1 /* RVKind.Number */) {
|
|
115
|
+
return values_1.ERRORS.VALUE;
|
|
116
|
+
}
|
|
117
|
+
return (0, values_1.rvBoolean)(Math.floor(Math.abs(v.value)) % 2 === 0);
|
|
118
|
+
});
|
|
119
|
+
defineEager("ISODD", 1, 1, args => {
|
|
120
|
+
const v = scalar(args);
|
|
121
|
+
if (v.kind === 4 /* RVKind.Error */) {
|
|
122
|
+
return v;
|
|
123
|
+
}
|
|
124
|
+
if (v.kind !== 1 /* RVKind.Number */) {
|
|
125
|
+
return values_1.ERRORS.VALUE;
|
|
126
|
+
}
|
|
127
|
+
return (0, values_1.rvBoolean)(Math.floor(Math.abs(v.value)) % 2 === 1);
|
|
128
|
+
});
|
|
129
|
+
defineEager("N", 1, 1, args => {
|
|
130
|
+
const v = scalar(args);
|
|
131
|
+
if (v.kind === 1 /* RVKind.Number */) {
|
|
132
|
+
return v;
|
|
133
|
+
}
|
|
134
|
+
if (v.kind === 3 /* RVKind.Boolean */) {
|
|
135
|
+
return (0, values_1.rvNumber)(v.value ? 1 : 0);
|
|
136
|
+
}
|
|
137
|
+
if (v.kind === 4 /* RVKind.Error */) {
|
|
138
|
+
return v;
|
|
139
|
+
}
|
|
140
|
+
return (0, values_1.rvNumber)(0);
|
|
141
|
+
});
|
|
142
|
+
defineEager("TYPE", 1, 1, args => {
|
|
143
|
+
// Check for array BEFORE topLeft extraction
|
|
144
|
+
if (args[0]?.kind === 5 /* RVKind.Array */) {
|
|
145
|
+
return (0, values_1.rvNumber)(64);
|
|
146
|
+
}
|
|
147
|
+
const v = scalar(args);
|
|
148
|
+
switch (v.kind) {
|
|
149
|
+
case 1 /* RVKind.Number */:
|
|
150
|
+
return (0, values_1.rvNumber)(1);
|
|
151
|
+
case 2 /* RVKind.String */:
|
|
152
|
+
return (0, values_1.rvNumber)(2);
|
|
153
|
+
case 3 /* RVKind.Boolean */:
|
|
154
|
+
return (0, values_1.rvNumber)(4);
|
|
155
|
+
case 4 /* RVKind.Error */:
|
|
156
|
+
return (0, values_1.rvNumber)(16);
|
|
157
|
+
default:
|
|
158
|
+
return (0, values_1.rvNumber)(1);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
defineEager("ERROR.TYPE", 1, 1, args => {
|
|
162
|
+
const v = scalar(args);
|
|
163
|
+
if (v.kind !== 4 /* RVKind.Error */) {
|
|
164
|
+
return values_1.ERRORS.NA;
|
|
165
|
+
}
|
|
166
|
+
const map = {
|
|
167
|
+
"#NULL!": 1,
|
|
168
|
+
"#DIV/0!": 2,
|
|
169
|
+
"#VALUE!": 3,
|
|
170
|
+
"#REF!": 4,
|
|
171
|
+
"#NAME?": 5,
|
|
172
|
+
"#NUM!": 6,
|
|
173
|
+
"#N/A": 7
|
|
174
|
+
};
|
|
175
|
+
return map[v.code] !== undefined ? (0, values_1.rvNumber)(map[v.code]) : values_1.ERRORS.NA;
|
|
176
|
+
});
|
|
177
|
+
defineEager("NA", 0, 0, () => values_1.ERRORS.NA);
|
|
178
|
+
// ── Stubs — limited implementations for functions that need runtime context ──
|
|
179
|
+
// INFO returns a handful of environment-describing strings. We implement
|
|
180
|
+
// the subset that's meaningful in a headless engine: `"release"` (engine
|
|
181
|
+
// version — we use "16.0" to pretend to be a modern Excel), `"system"`
|
|
182
|
+
// (the host OS string — the platform that loaded the workbook), and
|
|
183
|
+
// `"numfile"` / `"origin"` (which require UI context and are always
|
|
184
|
+
// `#N/A`).
|
|
185
|
+
defineEager("INFO", 1, 1, args => {
|
|
186
|
+
if (args.length === 0) {
|
|
187
|
+
return values_1.ERRORS.NA;
|
|
188
|
+
}
|
|
189
|
+
const t = args[0];
|
|
190
|
+
if (t.kind === 4 /* RVKind.Error */) {
|
|
191
|
+
return t;
|
|
192
|
+
}
|
|
193
|
+
const info = (t.kind === 2 /* RVKind.String */ ? t.value : "").toLowerCase();
|
|
194
|
+
switch (info) {
|
|
195
|
+
case "release":
|
|
196
|
+
return (0, values_1.rvString)("16.0");
|
|
197
|
+
case "osversion":
|
|
198
|
+
return (0, values_1.rvString)(`${typeof process !== "undefined" && process.platform ? process.platform : "browser"}`);
|
|
199
|
+
case "system":
|
|
200
|
+
// Excel reports "pcdos" or "mac"; we map Node's platform string so
|
|
201
|
+
// tests that grep for these values behave consistently.
|
|
202
|
+
if (typeof process !== "undefined" && process.platform) {
|
|
203
|
+
return (0, values_1.rvString)(process.platform === "darwin" ? "mac" : "pcdos");
|
|
204
|
+
}
|
|
205
|
+
return (0, values_1.rvString)("pcdos");
|
|
206
|
+
case "recalc":
|
|
207
|
+
return (0, values_1.rvString)("Automatic");
|
|
208
|
+
case "directory":
|
|
209
|
+
case "numfile":
|
|
210
|
+
case "origin":
|
|
211
|
+
return values_1.ERRORS.NA;
|
|
212
|
+
default:
|
|
213
|
+
return values_1.ERRORS.VALUE;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
// CELL: the evaluator intercepts CELL before this point and handles the
|
|
217
|
+
// supported info-type subset (address, row, col, contents, type, width,
|
|
218
|
+
// filename). This fallback only fires if an argument arrangement bypasses
|
|
219
|
+
// the interception — in which case #N/A matches Excel for unsupported info.
|
|
220
|
+
defineEager("CELL", 1, 2, () => values_1.ERRORS.NA);
|
|
221
|
+
// ISREF: the evaluator intercepts ISREF before this point and decides
|
|
222
|
+
// based on the raw BoundExpr / runtime ReferenceValue. This fallback only
|
|
223
|
+
// fires if an argument arrangement bypasses the interception — after
|
|
224
|
+
// dereferencing the answer is always false.
|
|
225
|
+
defineEager("ISREF", 1, 1, () => (0, values_1.rvBoolean)(false));
|
|
226
|
+
// SHEET/SHEETS: would need full workbook context — returns 1 as default
|
|
227
|
+
defineEager("SHEET", 0, 1, () => (0, values_1.rvNumber)(1));
|
|
228
|
+
defineEager("SHEETS", 0, 1, () => (0, values_1.rvNumber)(1));
|
|
229
|
+
// ISFORMULA / FORMULATEXT: need evaluator-level reference inspection.
|
|
230
|
+
// The evaluator intercepts these when the argument is a CellRef/AreaRef;
|
|
231
|
+
// these stubs only run when the argument has been dereferenced to a value,
|
|
232
|
+
// in which case the answer is false / #N/A respectively.
|
|
233
|
+
defineEager("ISFORMULA", 1, 1, () => (0, values_1.rvBoolean)(false));
|
|
234
|
+
defineEager("FORMULATEXT", 1, 1, () => values_1.ERRORS.NA);
|
|
235
|
+
// HYPERLINK: simplified semantics — return the friendly name if provided,
|
|
236
|
+
// otherwise the URL. The link behavior is outside the calculation engine.
|
|
237
|
+
defineEager("HYPERLINK", 1, 2, args => {
|
|
238
|
+
const display = args.length > 1 ? (0, values_1.topLeft)(args[1]) : (0, values_1.topLeft)(args[0]);
|
|
239
|
+
if (display.kind === 4 /* RVKind.Error */) {
|
|
240
|
+
return display;
|
|
241
|
+
}
|
|
242
|
+
if (display.kind === 0 /* RVKind.Blank */) {
|
|
243
|
+
// If friendly_name was an empty/blank cell, fall back to URL.
|
|
244
|
+
const url = (0, values_1.topLeft)(args[0]);
|
|
245
|
+
if (url.kind === 4 /* RVKind.Error */) {
|
|
246
|
+
return url;
|
|
247
|
+
}
|
|
248
|
+
return (0, values_1.rvString)(url.kind === 2 /* RVKind.String */ ? url.value : String(url));
|
|
249
|
+
}
|
|
250
|
+
if (display.kind === 2 /* RVKind.String */) {
|
|
251
|
+
return display;
|
|
252
|
+
}
|
|
253
|
+
if (display.kind === 1 /* RVKind.Number */) {
|
|
254
|
+
return (0, values_1.rvString)(String(display.value));
|
|
255
|
+
}
|
|
256
|
+
if (display.kind === 3 /* RVKind.Boolean */) {
|
|
257
|
+
return (0, values_1.rvString)(display.value ? "TRUE" : "FALSE");
|
|
258
|
+
}
|
|
259
|
+
return (0, values_1.rvString)("");
|
|
260
|
+
});
|
|
261
|
+
// ── Logical ──
|
|
262
|
+
defineEager("NOT", 1, 1, args => {
|
|
263
|
+
const v = scalar(args);
|
|
264
|
+
if (v.kind === 4 /* RVKind.Error */) {
|
|
265
|
+
return v;
|
|
266
|
+
}
|
|
267
|
+
if (v.kind === 3 /* RVKind.Boolean */) {
|
|
268
|
+
return (0, values_1.rvBoolean)(!v.value);
|
|
269
|
+
}
|
|
270
|
+
if (v.kind === 1 /* RVKind.Number */) {
|
|
271
|
+
return (0, values_1.rvBoolean)(v.value === 0);
|
|
272
|
+
}
|
|
273
|
+
return values_1.ERRORS.VALUE;
|
|
274
|
+
});
|
|
275
|
+
defineEager("AND", 1, 255, args => boolAggregate(args, true, (cur, val) => cur && val));
|
|
276
|
+
defineEager("OR", 1, 255, args => boolAggregate(args, false, (cur, val) => cur || val));
|
|
277
|
+
defineEager("XOR", 1, 255, args => {
|
|
278
|
+
let count = 0;
|
|
279
|
+
let found = false;
|
|
280
|
+
for (const arg of args) {
|
|
281
|
+
const r = walkBoolArg(arg, v => {
|
|
282
|
+
// `found` must only flip when `walkBoolArg` actually visits a
|
|
283
|
+
// boolean-like cell. The previous code set it after every
|
|
284
|
+
// argument (even BLANK/empty ranges), so `XOR(A1, B1)` on two
|
|
285
|
+
// empty cells returned FALSE; Excel returns #VALUE!.
|
|
286
|
+
found = true;
|
|
287
|
+
if (v) {
|
|
288
|
+
count++;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
if (r) {
|
|
292
|
+
return r;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return found ? (0, values_1.rvBoolean)(count % 2 === 1) : values_1.ERRORS.VALUE;
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Helper: aggregate boolean args (for AND/OR).
|
|
300
|
+
*/
|
|
301
|
+
function boolAggregate(args, init, combine) {
|
|
302
|
+
let result = init;
|
|
303
|
+
let found = false;
|
|
304
|
+
for (const arg of args) {
|
|
305
|
+
const err = walkBoolArg(arg, v => {
|
|
306
|
+
found = true;
|
|
307
|
+
result = combine(result, v);
|
|
308
|
+
});
|
|
309
|
+
if (err) {
|
|
310
|
+
return err;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return found ? (0, values_1.rvBoolean)(result) : values_1.ERRORS.VALUE;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Helper: walk a single argument for boolean aggregation.
|
|
317
|
+
* Returns an error value if one is encountered, otherwise undefined.
|
|
318
|
+
*/
|
|
319
|
+
function walkBoolArg(arg, cb) {
|
|
320
|
+
if (arg.kind === 4 /* RVKind.Error */) {
|
|
321
|
+
return arg;
|
|
322
|
+
}
|
|
323
|
+
if (arg.kind === 5 /* RVKind.Array */) {
|
|
324
|
+
for (const row of arg.rows) {
|
|
325
|
+
for (const cell of row) {
|
|
326
|
+
if (cell.kind === 4 /* RVKind.Error */) {
|
|
327
|
+
return cell;
|
|
328
|
+
}
|
|
329
|
+
if (cell.kind === 3 /* RVKind.Boolean */) {
|
|
330
|
+
cb(cell.value);
|
|
331
|
+
}
|
|
332
|
+
else if (cell.kind === 1 /* RVKind.Number */) {
|
|
333
|
+
cb(cell.value !== 0);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
const v = (0, values_1.topLeft)(arg);
|
|
340
|
+
if (v.kind === 4 /* RVKind.Error */) {
|
|
341
|
+
return v;
|
|
342
|
+
}
|
|
343
|
+
if (v.kind === 3 /* RVKind.Boolean */) {
|
|
344
|
+
cb(v.value);
|
|
345
|
+
}
|
|
346
|
+
else if (v.kind === 1 /* RVKind.Number */) {
|
|
347
|
+
cb(v.value !== 0);
|
|
348
|
+
}
|
|
349
|
+
else if (v.kind === 2 /* RVKind.String */) {
|
|
350
|
+
const upper = v.value.toUpperCase();
|
|
351
|
+
if (upper === "TRUE") {
|
|
352
|
+
cb(true);
|
|
353
|
+
}
|
|
354
|
+
else if (upper === "FALSE") {
|
|
355
|
+
cb(false);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
return values_1.ERRORS.VALUE;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
else if (v.kind !== 0 /* RVKind.Blank */) {
|
|
362
|
+
return values_1.ERRORS.VALUE;
|
|
363
|
+
}
|
|
364
|
+
return undefined;
|
|
365
|
+
}
|
|
366
|
+
// ============================================================================
|
|
367
|
+
// Native Text Functions
|
|
368
|
+
// ============================================================================
|
|
369
|
+
const text_1 = require("../functions/text");
|
|
370
|
+
function registerNativeTextFunctions() {
|
|
371
|
+
defineEager("CONCATENATE", 1, 255, text_1.fnCONCATENATE);
|
|
372
|
+
defineEager("CONCAT", 1, 255, text_1.fnCONCAT);
|
|
373
|
+
defineEager("TEXTJOIN", 3, 255, text_1.fnTEXTJOIN);
|
|
374
|
+
defineEager("LEFT", 1, 2, text_1.fnLEFT);
|
|
375
|
+
defineEager("LEFTB", 1, 2, text_1.fnLEFT);
|
|
376
|
+
defineEager("RIGHT", 1, 2, text_1.fnRIGHT);
|
|
377
|
+
defineEager("RIGHTB", 1, 2, text_1.fnRIGHT);
|
|
378
|
+
defineEager("MID", 3, 3, text_1.fnMID);
|
|
379
|
+
defineEager("MIDB", 3, 3, text_1.fnMID);
|
|
380
|
+
defineEager("LEN", 1, 1, text_1.fnLEN);
|
|
381
|
+
defineEager("LENB", 1, 1, text_1.fnLEN);
|
|
382
|
+
defineEager("TRIM", 1, 1, text_1.fnTRIM);
|
|
383
|
+
defineEager("LOWER", 1, 1, text_1.fnLOWER);
|
|
384
|
+
defineEager("UPPER", 1, 1, text_1.fnUPPER);
|
|
385
|
+
defineEager("PROPER", 1, 1, text_1.fnPROPER);
|
|
386
|
+
defineEager("SUBSTITUTE", 3, 4, text_1.fnSUBSTITUTE);
|
|
387
|
+
defineEager("REPLACE", 4, 4, text_1.fnREPLACE);
|
|
388
|
+
defineEager("FIND", 2, 3, text_1.fnFIND);
|
|
389
|
+
defineEager("FINDB", 2, 3, text_1.fnFIND);
|
|
390
|
+
defineEager("SEARCH", 2, 3, text_1.fnSEARCH);
|
|
391
|
+
defineEager("SEARCHB", 2, 3, text_1.fnSEARCH);
|
|
392
|
+
defineEager("REPT", 2, 2, text_1.fnREPT);
|
|
393
|
+
defineEager("TEXT", 2, 2, text_1.fnTEXT);
|
|
394
|
+
defineEager("VALUE", 1, 1, text_1.fnVALUE);
|
|
395
|
+
defineEager("EXACT", 2, 2, text_1.fnEXACT);
|
|
396
|
+
defineEager("CODE", 1, 1, text_1.fnCODE);
|
|
397
|
+
defineEager("CHAR", 1, 1, text_1.fnCHAR);
|
|
398
|
+
defineEager("CLEAN", 1, 1, text_1.fnCLEAN);
|
|
399
|
+
defineEager("T", 1, 1, text_1.fnT);
|
|
400
|
+
defineEager("UNICHAR", 1, 1, text_1.fnUNICHAR);
|
|
401
|
+
defineEager("UNICODE", 1, 1, text_1.fnUNICODE);
|
|
402
|
+
defineEager("BAHTTEXT", 1, 1, text_1.fnBAHTTEXT);
|
|
403
|
+
defineEager("DOLLAR", 1, 2, text_1.fnDOLLAR);
|
|
404
|
+
defineEager("FIXED", 1, 3, text_1.fnFIXED);
|
|
405
|
+
defineEager("ASC", 1, 1, text_1.fnASC);
|
|
406
|
+
defineEager("DBCS", 1, 1, text_1.fnDBCS);
|
|
407
|
+
defineEager("JIS", 1, 1, text_1.fnJIS);
|
|
408
|
+
defineEager("PHONETIC", 1, 1, text_1.fnPHONETIC);
|
|
409
|
+
defineEager("NUMBERVALUE", 1, 3, text_1.fnNUMBERVALUE);
|
|
410
|
+
defineEager("TEXTBEFORE", 2, 6, text_1.fnTEXTBEFORE);
|
|
411
|
+
defineEager("TEXTAFTER", 2, 6, text_1.fnTEXTAFTER);
|
|
412
|
+
defineEager("TEXTSPLIT", 2, 6, text_1.fnTEXTSPLIT);
|
|
413
|
+
defineEager("REGEXTEST", 2, 3, text_1.fnREGEXTEST);
|
|
414
|
+
defineEager("REGEXEXTRACT", 2, 4, text_1.fnREGEXEXTRACT);
|
|
415
|
+
defineEager("REGEXREPLACE", 3, 5, text_1.fnREGEXREPLACE);
|
|
416
|
+
defineEager("VALUETOTEXT", 1, 2, text_1.fnVALUETOTEXT);
|
|
417
|
+
defineEager("ARRAYTOTEXT", 1, 2, text_1.fnARRAYTOTEXT);
|
|
418
|
+
defineEager("ENCODEURL", 1, 1, text_1.fnENCODEURL);
|
|
419
|
+
}
|
|
420
|
+
// ============================================================================
|
|
421
|
+
// Native Date Functions
|
|
422
|
+
// ============================================================================
|
|
423
|
+
const date_1 = require("../functions/date");
|
|
424
|
+
function registerNativeDateFunctions() {
|
|
425
|
+
defineEager("TODAY", 0, 0, date_1.fnTODAY);
|
|
426
|
+
defineEager("NOW", 0, 0, date_1.fnNOW);
|
|
427
|
+
defineEager("YEAR", 1, 1, date_1.fnYEAR);
|
|
428
|
+
defineEager("MONTH", 1, 1, date_1.fnMONTH);
|
|
429
|
+
defineEager("DAY", 1, 1, date_1.fnDAY);
|
|
430
|
+
defineEager("DATE", 3, 3, date_1.fnDATE);
|
|
431
|
+
defineEager("TIME", 3, 3, date_1.fnTIME);
|
|
432
|
+
defineEager("HOUR", 1, 1, date_1.fnHOUR);
|
|
433
|
+
defineEager("MINUTE", 1, 1, date_1.fnMINUTE);
|
|
434
|
+
defineEager("SECOND", 1, 1, date_1.fnSECOND);
|
|
435
|
+
defineEager("WEEKDAY", 1, 2, date_1.fnWEEKDAY);
|
|
436
|
+
defineEager("EOMONTH", 2, 2, date_1.fnEOMONTH);
|
|
437
|
+
defineEager("EDATE", 2, 2, date_1.fnEDATE);
|
|
438
|
+
defineEager("DATEDIF", 3, 3, date_1.fnDATEDIF);
|
|
439
|
+
defineEager("DAYS", 2, 2, date_1.fnDAYS);
|
|
440
|
+
defineEager("DAYS360", 2, 3, date_1.fnDAYS360);
|
|
441
|
+
defineEager("ISOWEEKNUM", 1, 1, date_1.fnISOWEEKNUM);
|
|
442
|
+
defineEager("WEEKNUM", 1, 2, date_1.fnWEEKNUM);
|
|
443
|
+
defineEager("NETWORKDAYS", 2, 3, date_1.fnNETWORKDAYS);
|
|
444
|
+
defineEager("NETWORKDAYS.INTL", 2, 4, date_1.fnNETWORKDAYS_INTL);
|
|
445
|
+
defineEager("WORKDAY", 2, 3, date_1.fnWORKDAY);
|
|
446
|
+
defineEager("WORKDAY.INTL", 2, 4, date_1.fnWORKDAY_INTL);
|
|
447
|
+
defineEager("YEARFRAC", 2, 3, date_1.fnYEARFRAC);
|
|
448
|
+
defineEager("DATEVALUE", 1, 1, date_1.fnDATEVALUE);
|
|
449
|
+
defineEager("TIMEVALUE", 1, 1, date_1.fnTIMEVALUE);
|
|
450
|
+
}
|
|
451
|
+
// ============================================================================
|
|
452
|
+
// Native Engineering Functions
|
|
453
|
+
// ============================================================================
|
|
454
|
+
const engineering_1 = require("../functions/engineering");
|
|
455
|
+
function registerNativeEngineeringFunctions() {
|
|
456
|
+
defineEager("BIN2DEC", 1, 1, engineering_1.fnBIN2DEC);
|
|
457
|
+
defineEager("DEC2BIN", 1, 2, engineering_1.fnDEC2BIN);
|
|
458
|
+
defineEager("HEX2DEC", 1, 1, engineering_1.fnHEX2DEC);
|
|
459
|
+
defineEager("DEC2HEX", 1, 2, engineering_1.fnDEC2HEX);
|
|
460
|
+
defineEager("OCT2DEC", 1, 1, engineering_1.fnOCT2DEC);
|
|
461
|
+
defineEager("DEC2OCT", 1, 2, engineering_1.fnDEC2OCT);
|
|
462
|
+
defineEager("DELTA", 1, 2, engineering_1.fnDELTA);
|
|
463
|
+
defineEager("GESTEP", 1, 2, engineering_1.fnGESTEP);
|
|
464
|
+
defineEager("COMPLEX", 2, 3, engineering_1.fnCOMPLEX);
|
|
465
|
+
defineEager("IMREAL", 1, 1, engineering_1.fnIMREAL);
|
|
466
|
+
defineEager("IMAGINARY", 1, 1, engineering_1.fnIMAGINARY);
|
|
467
|
+
defineEager("IMABS", 1, 1, engineering_1.fnIMABS);
|
|
468
|
+
defineEager("IMARGUMENT", 1, 1, engineering_1.fnIMARGUMENT);
|
|
469
|
+
defineEager("IMCONJUGATE", 1, 1, engineering_1.fnIMCONJUGATE);
|
|
470
|
+
defineEager("IMSUM", 1, 255, engineering_1.fnIMSUM);
|
|
471
|
+
defineEager("IMSUB", 2, 2, engineering_1.fnIMSUB);
|
|
472
|
+
defineEager("IMPRODUCT", 1, 255, engineering_1.fnIMPRODUCT);
|
|
473
|
+
defineEager("IMDIV", 2, 2, engineering_1.fnIMDIV);
|
|
474
|
+
defineEager("IMPOWER", 2, 2, engineering_1.fnIMPOWER);
|
|
475
|
+
defineEager("IMSQRT", 1, 1, engineering_1.fnIMSQRT);
|
|
476
|
+
defineEager("IMLN", 1, 1, engineering_1.fnIMLN);
|
|
477
|
+
defineEager("IMLOG2", 1, 1, engineering_1.fnIMLOG2);
|
|
478
|
+
defineEager("IMLOG10", 1, 1, engineering_1.fnIMLOG10);
|
|
479
|
+
defineEager("IMEXP", 1, 1, engineering_1.fnIMEXP);
|
|
480
|
+
defineEager("IMSIN", 1, 1, engineering_1.fnIMSIN);
|
|
481
|
+
defineEager("IMCOS", 1, 1, engineering_1.fnIMCOS);
|
|
482
|
+
defineEager("IMTAN", 1, 1, engineering_1.fnIMTAN);
|
|
483
|
+
defineEager("IMCSC", 1, 1, engineering_1.fnIMCSC);
|
|
484
|
+
defineEager("IMSEC", 1, 1, engineering_1.fnIMSEC);
|
|
485
|
+
defineEager("IMCOT", 1, 1, engineering_1.fnIMCOT);
|
|
486
|
+
defineEager("IMSINH", 1, 1, engineering_1.fnIMSINH);
|
|
487
|
+
defineEager("IMCOSH", 1, 1, engineering_1.fnIMCOSH);
|
|
488
|
+
defineEager("IMTANH", 1, 1, engineering_1.fnIMTANH);
|
|
489
|
+
defineEager("IMCSCH", 1, 1, engineering_1.fnIMCSCH);
|
|
490
|
+
defineEager("IMSECH", 1, 1, engineering_1.fnIMSECH);
|
|
491
|
+
defineEager("IMCOTH", 1, 1, engineering_1.fnIMCOTH);
|
|
492
|
+
defineEager("BIN2HEX", 1, 2, engineering_1.fnBIN2HEX);
|
|
493
|
+
defineEager("BIN2OCT", 1, 2, engineering_1.fnBIN2OCT);
|
|
494
|
+
defineEager("HEX2BIN", 1, 2, engineering_1.fnHEX2BIN);
|
|
495
|
+
defineEager("HEX2OCT", 1, 2, engineering_1.fnHEX2OCT);
|
|
496
|
+
defineEager("OCT2BIN", 1, 2, engineering_1.fnOCT2BIN);
|
|
497
|
+
defineEager("OCT2HEX", 1, 2, engineering_1.fnOCT2HEX);
|
|
498
|
+
defineEager("BESSELJ", 2, 2, engineering_1.fnBESSELJ);
|
|
499
|
+
defineEager("BESSELI", 2, 2, engineering_1.fnBESSELI);
|
|
500
|
+
defineEager("BESSELK", 2, 2, engineering_1.fnBESSELK);
|
|
501
|
+
defineEager("BESSELY", 2, 2, engineering_1.fnBESSELY);
|
|
502
|
+
defineEager("BITAND", 2, 2, engineering_1.fnBITAND);
|
|
503
|
+
defineEager("BITOR", 2, 2, engineering_1.fnBITOR);
|
|
504
|
+
defineEager("BITXOR", 2, 2, engineering_1.fnBITXOR);
|
|
505
|
+
defineEager("BITLSHIFT", 2, 2, engineering_1.fnBITLSHIFT);
|
|
506
|
+
defineEager("BITRSHIFT", 2, 2, engineering_1.fnBITRSHIFT);
|
|
507
|
+
}
|
|
508
|
+
// ============================================================================
|
|
509
|
+
// Native Financial Functions
|
|
510
|
+
// ============================================================================
|
|
511
|
+
const financial_1 = require("../functions/financial");
|
|
512
|
+
function registerNativeFinancialFunctions() {
|
|
513
|
+
defineEager("PMT", 3, 5, financial_1.fnPMT);
|
|
514
|
+
defineEager("FV", 3, 5, financial_1.fnFV);
|
|
515
|
+
defineEager("PV", 3, 5, financial_1.fnPV);
|
|
516
|
+
defineEager("NPV", 2, 255, financial_1.fnNPV);
|
|
517
|
+
defineEager("IRR", 1, 2, financial_1.fnIRR);
|
|
518
|
+
defineEager("NPER", 3, 5, financial_1.fnNPER);
|
|
519
|
+
defineEager("RATE", 3, 6, financial_1.fnRATE);
|
|
520
|
+
defineEager("SLN", 3, 3, financial_1.fnSLN);
|
|
521
|
+
defineEager("SYD", 4, 4, financial_1.fnSYD);
|
|
522
|
+
defineEager("VDB", 5, 7, financial_1.fnVDB);
|
|
523
|
+
defineEager("FVSCHEDULE", 2, 2, financial_1.fnFVSCHEDULE);
|
|
524
|
+
defineEager("PDURATION", 3, 3, financial_1.fnPDURATION);
|
|
525
|
+
defineEager("RRI", 3, 3, financial_1.fnRRI);
|
|
526
|
+
defineEager("DB", 4, 5, financial_1.fnDB);
|
|
527
|
+
defineEager("DDB", 4, 5, financial_1.fnDDB);
|
|
528
|
+
defineEager("IPMT", 4, 6, financial_1.fnIPMT);
|
|
529
|
+
defineEager("PPMT", 4, 6, financial_1.fnPPMT);
|
|
530
|
+
defineEager("EFFECT", 2, 2, financial_1.fnEFFECT);
|
|
531
|
+
defineEager("NOMINAL", 2, 2, financial_1.fnNOMINAL);
|
|
532
|
+
defineEager("XNPV", 3, 3, financial_1.fnXNPV);
|
|
533
|
+
defineEager("XIRR", 2, 3, financial_1.fnXIRR);
|
|
534
|
+
defineEager("MIRR", 3, 3, financial_1.fnMIRR);
|
|
535
|
+
defineEager("ISPMT", 4, 4, financial_1.fnISPMT);
|
|
536
|
+
defineEager("CUMPRINC", 6, 6, financial_1.fnCUMPRINC);
|
|
537
|
+
defineEager("CUMIPMT", 6, 6, financial_1.fnCUMIPMT);
|
|
538
|
+
defineEager("DOLLARDE", 2, 2, financial_1.fnDOLLARDE);
|
|
539
|
+
defineEager("DOLLARFR", 2, 2, financial_1.fnDOLLARFR);
|
|
540
|
+
defineEager("DISC", 4, 5, financial_1.fnDISC);
|
|
541
|
+
defineEager("PRICEDISC", 4, 5, financial_1.fnPRICEDISC);
|
|
542
|
+
defineEager("YIELDDISC", 4, 5, financial_1.fnYIELDDISC);
|
|
543
|
+
defineEager("RECEIVED", 4, 5, financial_1.fnRECEIVED);
|
|
544
|
+
defineEager("INTRATE", 4, 5, financial_1.fnINTRATE);
|
|
545
|
+
defineEager("PRICE", 6, 7, financial_1.fnPRICE);
|
|
546
|
+
defineEager("YIELD", 6, 7, financial_1.fnYIELD);
|
|
547
|
+
defineEager("DURATION", 5, 6, financial_1.fnDURATION);
|
|
548
|
+
defineEager("MDURATION", 5, 6, financial_1.fnMDURATION);
|
|
549
|
+
defineEager("ACCRINT", 6, 8, financial_1.fnACCRINT);
|
|
550
|
+
defineEager("ACCRINTM", 4, 5, financial_1.fnACCRINTM);
|
|
551
|
+
defineEager("TBILLPRICE", 3, 3, financial_1.fnTBILLPRICE);
|
|
552
|
+
defineEager("TBILLYIELD", 3, 3, financial_1.fnTBILLYIELD);
|
|
553
|
+
defineEager("TBILLEQ", 3, 3, financial_1.fnTBILLEQ);
|
|
554
|
+
defineEager("PRICEMAT", 5, 6, financial_1.fnPRICEMAT);
|
|
555
|
+
defineEager("YIELDMAT", 5, 6, financial_1.fnYIELDMAT);
|
|
556
|
+
defineEager("COUPNCD", 3, 4, financial_1.fnCOUPNCD);
|
|
557
|
+
defineEager("COUPPCD", 3, 4, financial_1.fnCOUPPCD);
|
|
558
|
+
defineEager("COUPNUM", 3, 4, financial_1.fnCOUPNUM);
|
|
559
|
+
defineEager("COUPDAYSNC", 3, 4, financial_1.fnCOUPDAYSNC);
|
|
560
|
+
defineEager("COUPDAYBS", 3, 4, financial_1.fnCOUPDAYBS);
|
|
561
|
+
defineEager("COUPDAYS", 3, 4, financial_1.fnCOUPDAYS);
|
|
562
|
+
}
|
|
563
|
+
// ============================================================================
|
|
564
|
+
// Native Statistical Functions
|
|
565
|
+
// ============================================================================
|
|
566
|
+
const statistical_1 = require("../functions/statistical");
|
|
567
|
+
function registerNativeStatisticalFunctions() {
|
|
568
|
+
defineEager("MEDIAN", 1, 255, statistical_1.fnMEDIAN);
|
|
569
|
+
defineEager("LARGE", 2, 2, statistical_1.fnLARGE);
|
|
570
|
+
defineEager("SMALL", 2, 2, statistical_1.fnSMALL);
|
|
571
|
+
defineEager("RANK", 2, 3, statistical_1.fnRANK);
|
|
572
|
+
defineEager("RANK.EQ", 2, 3, statistical_1.fnRANK);
|
|
573
|
+
defineEager("STDEV", 1, 255, statistical_1.fnSTDEV);
|
|
574
|
+
defineEager("STDEV.S", 1, 255, statistical_1.fnSTDEV);
|
|
575
|
+
defineEager("STDEVP", 1, 255, statistical_1.fnSTDEVP);
|
|
576
|
+
defineEager("STDEV.P", 1, 255, statistical_1.fnSTDEVP);
|
|
577
|
+
defineEager("VAR", 1, 255, statistical_1.fnVAR);
|
|
578
|
+
defineEager("VAR.S", 1, 255, statistical_1.fnVAR);
|
|
579
|
+
defineEager("VARP", 1, 255, statistical_1.fnVARP);
|
|
580
|
+
defineEager("VAR.P", 1, 255, statistical_1.fnVARP);
|
|
581
|
+
defineEager("NORM.S.DIST", 2, 2, statistical_1.fnNORMSDIST);
|
|
582
|
+
defineEager("NORMSDIST", 1, 2, statistical_1.fnNORMSDIST);
|
|
583
|
+
defineEager("NORM.DIST", 4, 4, statistical_1.fnNORMDIST);
|
|
584
|
+
defineEager("NORMDIST", 4, 4, statistical_1.fnNORMDIST);
|
|
585
|
+
defineEager("NORM.S.INV", 1, 1, statistical_1.fnNORMSINV);
|
|
586
|
+
defineEager("NORMSINV", 1, 1, statistical_1.fnNORMSINV);
|
|
587
|
+
defineEager("NORM.INV", 3, 3, statistical_1.fnNORMINV);
|
|
588
|
+
defineEager("NORMINV", 3, 3, statistical_1.fnNORMINV);
|
|
589
|
+
defineEager("PERCENTILE", 2, 2, statistical_1.fnPERCENTILE);
|
|
590
|
+
defineEager("PERCENTILE.INC", 2, 2, statistical_1.fnPERCENTILE);
|
|
591
|
+
defineEager("PERCENTILE.EXC", 2, 2, statistical_1.fnPERCENTILEEXC);
|
|
592
|
+
defineEager("QUARTILE", 2, 2, statistical_1.fnQUARTILE);
|
|
593
|
+
defineEager("QUARTILE.INC", 2, 2, statistical_1.fnQUARTILE);
|
|
594
|
+
defineEager("QUARTILE.EXC", 2, 2, statistical_1.fnQUARTILEEXC);
|
|
595
|
+
defineEager("PERCENTRANK", 2, 3, statistical_1.fnPERCENTRANK_INC);
|
|
596
|
+
defineEager("PERCENTRANK.INC", 2, 3, statistical_1.fnPERCENTRANK_INC);
|
|
597
|
+
defineEager("PERCENTRANK.EXC", 2, 3, statistical_1.fnPERCENTRANK_EXC);
|
|
598
|
+
defineEager("PROB", 3, 4, statistical_1.fnPROB);
|
|
599
|
+
defineEager("MODE", 1, 255, statistical_1.fnMODE);
|
|
600
|
+
defineEager("MODE.SNGL", 1, 255, statistical_1.fnMODE);
|
|
601
|
+
defineEager("CORREL", 2, 2, statistical_1.fnCORREL);
|
|
602
|
+
defineEager("SLOPE", 2, 2, statistical_1.fnSLOPE);
|
|
603
|
+
defineEager("INTERCEPT", 2, 2, statistical_1.fnINTERCEPT);
|
|
604
|
+
defineEager("RSQ", 2, 2, statistical_1.fnRSQ);
|
|
605
|
+
defineEager("STEYX", 2, 2, statistical_1.fnSTEYX);
|
|
606
|
+
defineEager("FORECAST", 3, 3, statistical_1.fnFORECAST);
|
|
607
|
+
defineEager("FORECAST.LINEAR", 3, 3, statistical_1.fnFORECAST);
|
|
608
|
+
defineEager("GEOMEAN", 1, 255, statistical_1.fnGEOMEAN);
|
|
609
|
+
defineEager("HARMEAN", 1, 255, statistical_1.fnHARMEAN);
|
|
610
|
+
defineEager("TRIMMEAN", 2, 2, statistical_1.fnTRIMMEAN);
|
|
611
|
+
defineEager("DEVSQ", 1, 255, statistical_1.fnDEVSQ);
|
|
612
|
+
defineEager("AVEDEV", 1, 255, statistical_1.fnAVEDEV);
|
|
613
|
+
defineEager("CONFIDENCE.NORM", 3, 3, statistical_1.fnCONFIDENCENORM);
|
|
614
|
+
defineEager("CONFIDENCE.T", 3, 3, statistical_1.fnCONFIDENCE_T);
|
|
615
|
+
defineEager("COVARIANCE.P", 2, 2, statistical_1.fnCOVARIANCE_P);
|
|
616
|
+
defineEager("COVARIANCE.S", 2, 2, statistical_1.fnCOVARIANCE_S);
|
|
617
|
+
defineEager("RANK.AVG", 2, 3, statistical_1.fnRANK_AVG);
|
|
618
|
+
defineEager("MODE.MULT", 1, 255, statistical_1.fnMODE_MULT);
|
|
619
|
+
defineEager("CONFIDENCE", 3, 3, statistical_1.fnCONFIDENCENORM);
|
|
620
|
+
defineEager("FISHER", 1, 1, statistical_1.fnFISHER);
|
|
621
|
+
defineEager("FISHERINV", 1, 1, statistical_1.fnFISHERINV);
|
|
622
|
+
defineEager("AVERAGEA", 1, 255, statistical_1.fnAVERAGEA);
|
|
623
|
+
defineEager("MAXA", 1, 255, statistical_1.fnMAXA);
|
|
624
|
+
defineEager("MINA", 1, 255, statistical_1.fnMINA);
|
|
625
|
+
defineEager("POISSON.DIST", 3, 3, statistical_1.fnPOISSON_DIST);
|
|
626
|
+
defineEager("BINOM.DIST", 4, 4, statistical_1.fnBINOM_DIST);
|
|
627
|
+
defineEager("BINOMDIST", 4, 4, statistical_1.fnBINOM_DIST);
|
|
628
|
+
defineEager("BINOM.DIST.RANGE", 3, 4, statistical_1.fnBINOM_DIST_RANGE);
|
|
629
|
+
defineEager("BINOM.INV", 3, 3, statistical_1.fnBINOM_INV);
|
|
630
|
+
defineEager("HYPGEOM.DIST", 5, 5, statistical_1.fnHYPGEOM_DIST);
|
|
631
|
+
defineEager("NEGBINOM.DIST", 4, 4, statistical_1.fnNEGBINOM_DIST);
|
|
632
|
+
defineEager("CHISQ.DIST", 3, 3, statistical_1.fnCHISQ_DIST);
|
|
633
|
+
defineEager("CHISQ.INV", 2, 2, statistical_1.fnCHISQ_INV);
|
|
634
|
+
defineEager("CHISQ.INV.RT", 2, 2, statistical_1.fnCHISQ_INV_RT);
|
|
635
|
+
defineEager("Z.TEST", 2, 3, statistical_1.fnZ_TEST);
|
|
636
|
+
defineEager("ZTEST", 2, 3, statistical_1.fnZ_TEST);
|
|
637
|
+
defineEager("T.TEST", 4, 4, statistical_1.fnT_TEST);
|
|
638
|
+
defineEager("TTEST", 4, 4, statistical_1.fnT_TEST);
|
|
639
|
+
defineEager("F.TEST", 2, 2, statistical_1.fnF_TEST);
|
|
640
|
+
defineEager("FTEST", 2, 2, statistical_1.fnF_TEST);
|
|
641
|
+
defineEager("CHISQ.TEST", 2, 2, statistical_1.fnCHISQ_TEST);
|
|
642
|
+
defineEager("CHITEST", 2, 2, statistical_1.fnCHISQ_TEST);
|
|
643
|
+
defineEager("CHISQ.DIST.RT", 2, 2, statistical_1.fnCHISQ_DIST_RT);
|
|
644
|
+
defineEager("F.DIST", 4, 4, statistical_1.fnF_DIST);
|
|
645
|
+
defineEager("F.INV", 3, 3, statistical_1.fnF_INV);
|
|
646
|
+
defineEager("F.DIST.RT", 3, 3, statistical_1.fnF_DIST_RT);
|
|
647
|
+
defineEager("F.INV.RT", 3, 3, statistical_1.fnF_INV_RT);
|
|
648
|
+
defineEager("SKEW", 1, 255, statistical_1.fnSKEW);
|
|
649
|
+
defineEager("SKEW.P", 1, 255, statistical_1.fnSKEW_P);
|
|
650
|
+
defineEager("KURT", 1, 255, statistical_1.fnKURT);
|
|
651
|
+
defineEager("T.DIST", 3, 3, statistical_1.fnT_DIST);
|
|
652
|
+
defineEager("T.INV", 2, 2, statistical_1.fnT_INV);
|
|
653
|
+
defineEager("T.DIST.2T", 2, 2, statistical_1.fnT_DIST_2T);
|
|
654
|
+
defineEager("T.DIST.RT", 2, 2, statistical_1.fnT_DIST_RT);
|
|
655
|
+
defineEager("T.INV.2T", 2, 2, statistical_1.fnT_INV_2T);
|
|
656
|
+
defineEager("BETA.DIST", 4, 6, statistical_1.fnBETA_DIST);
|
|
657
|
+
defineEager("BETA.INV", 3, 5, statistical_1.fnBETA_INV);
|
|
658
|
+
defineEager("GAMMA", 1, 1, statistical_1.fnGAMMA);
|
|
659
|
+
defineEager("GAMMALN", 1, 1, statistical_1.fnGAMMALN);
|
|
660
|
+
defineEager("GAMMALN.PRECISE", 1, 1, statistical_1.fnGAMMALN);
|
|
661
|
+
defineEager("GAMMA.DIST", 4, 4, statistical_1.fnGAMMA_DIST);
|
|
662
|
+
defineEager("GAMMA.INV", 3, 3, statistical_1.fnGAMMA_INV);
|
|
663
|
+
defineEager("EXPON.DIST", 3, 3, statistical_1.fnEXPON_DIST);
|
|
664
|
+
defineEager("WEIBULL.DIST", 4, 4, statistical_1.fnWEIBULL_DIST);
|
|
665
|
+
defineEager("LOGNORM.DIST", 4, 4, statistical_1.fnLOGNORM_DIST);
|
|
666
|
+
defineEager("LOGNORM.INV", 3, 3, statistical_1.fnLOGNORM_INV);
|
|
667
|
+
defineEager("PHI", 1, 1, statistical_1.fnPHI);
|
|
668
|
+
defineEager("GAUSS", 1, 1, statistical_1.fnGAUSS);
|
|
669
|
+
defineEager("ERF", 1, 2, statistical_1.fnERF);
|
|
670
|
+
defineEager("ERF.PRECISE", 1, 2, statistical_1.fnERF);
|
|
671
|
+
defineEager("ERFC", 1, 1, statistical_1.fnERFC);
|
|
672
|
+
defineEager("ERFC.PRECISE", 1, 1, statistical_1.fnERFC);
|
|
673
|
+
defineEager("STANDARDIZE", 3, 3, statistical_1.fnSTANDARDIZE);
|
|
674
|
+
defineEager("FREQUENCY", 2, 2, statistical_1.fnFREQUENCY);
|
|
675
|
+
defineEager("GROWTH", 1, 4, statistical_1.fnGROWTH);
|
|
676
|
+
defineEager("TREND", 1, 4, statistical_1.fnTREND);
|
|
677
|
+
defineEager("LINEST", 1, 4, statistical_1.fnLINEST);
|
|
678
|
+
defineEager("LOGEST", 1, 4, statistical_1.fnLOGEST);
|
|
679
|
+
}
|
|
680
|
+
// ============================================================================
|
|
681
|
+
// Native Math Functions
|
|
682
|
+
// ============================================================================
|
|
683
|
+
const math_1 = require("../functions/math");
|
|
684
|
+
function registerNativeMathFunctions() {
|
|
685
|
+
defineEager("SUM", 1, 255, math_1.fnSUM);
|
|
686
|
+
defineEager("AVERAGE", 1, 255, math_1.fnAVERAGE);
|
|
687
|
+
defineEager("MIN", 1, 255, math_1.fnMIN);
|
|
688
|
+
defineEager("MAX", 1, 255, math_1.fnMAX);
|
|
689
|
+
defineEager("COUNT", 1, 255, math_1.fnCOUNT);
|
|
690
|
+
defineEager("COUNTA", 1, 255, math_1.fnCOUNTA);
|
|
691
|
+
defineEager("COUNTBLANK", 1, 1, math_1.fnCOUNTBLANK);
|
|
692
|
+
defineEager("PRODUCT", 1, 255, math_1.fnPRODUCT);
|
|
693
|
+
defineEager("SUMPRODUCT", 1, 255, math_1.fnSUMPRODUCT);
|
|
694
|
+
defineEager("MMULT", 2, 2, math_1.fnMMULT);
|
|
695
|
+
defineEager("MDETERM", 1, 1, math_1.fnMDETERM);
|
|
696
|
+
defineEager("MINVERSE", 1, 1, math_1.fnMINVERSE);
|
|
697
|
+
defineEager("MUNIT", 1, 1, math_1.fnMUNIT);
|
|
698
|
+
defineEager("SERIESSUM", 4, 4, math_1.fnSERIESSUM);
|
|
699
|
+
defineEager("ABS", 1, 1, math_1.fnABS);
|
|
700
|
+
defineEager("CEILING", 2, 2, math_1.fnCEILING);
|
|
701
|
+
defineEager("CEILING.MATH", 1, 3, math_1.fnCEILING);
|
|
702
|
+
defineEager("CEILING.PRECISE", 1, 2, math_1.fnCEILING);
|
|
703
|
+
defineEager("ISO.CEILING", 1, 2, math_1.fnCEILING);
|
|
704
|
+
defineEager("FLOOR", 2, 2, math_1.fnFLOOR);
|
|
705
|
+
defineEager("FLOOR.MATH", 1, 3, math_1.fnFLOOR);
|
|
706
|
+
defineEager("FLOOR.PRECISE", 1, 2, math_1.fnFLOOR);
|
|
707
|
+
defineEager("INT", 1, 1, math_1.fnINT);
|
|
708
|
+
defineEager("MOD", 2, 2, math_1.fnMOD);
|
|
709
|
+
defineEager("POWER", 2, 2, math_1.fnPOWER);
|
|
710
|
+
defineEager("ROUND", 2, 2, math_1.fnROUND);
|
|
711
|
+
defineEager("ROUNDDOWN", 2, 2, math_1.fnROUNDDOWN);
|
|
712
|
+
defineEager("ROUNDUP", 2, 2, math_1.fnROUNDUP);
|
|
713
|
+
defineEager("SQRT", 1, 1, math_1.fnSQRT);
|
|
714
|
+
defineEager("SQRTPI", 1, 1, math_1.fnSQRTPI);
|
|
715
|
+
defineEager("LN", 1, 1, math_1.fnLN);
|
|
716
|
+
defineEager("LOG", 1, 2, math_1.fnLOG);
|
|
717
|
+
defineEager("LOG10", 1, 1, math_1.fnLOG10);
|
|
718
|
+
defineEager("EXP", 1, 1, math_1.fnEXP);
|
|
719
|
+
defineEager("PI", 0, 0, math_1.fnPI);
|
|
720
|
+
defineEager("RAND", 0, 0, math_1.fnRAND);
|
|
721
|
+
defineEager("RANDBETWEEN", 2, 2, math_1.fnRANDBETWEEN);
|
|
722
|
+
defineEager("SIGN", 1, 1, math_1.fnSIGN);
|
|
723
|
+
defineEager("TRUNC", 1, 2, math_1.fnTRUNC);
|
|
724
|
+
defineEager("SUMSQ", 1, 255, math_1.fnSUMSQ);
|
|
725
|
+
defineEager("GCD", 1, 255, math_1.fnGCD);
|
|
726
|
+
defineEager("LCM", 1, 255, math_1.fnLCM);
|
|
727
|
+
defineEager("EVEN", 1, 1, math_1.fnEVEN);
|
|
728
|
+
defineEager("ODD", 1, 1, math_1.fnODD);
|
|
729
|
+
defineEager("MROUND", 2, 2, math_1.fnMROUND);
|
|
730
|
+
defineEager("QUOTIENT", 2, 2, math_1.fnQUOTIENT);
|
|
731
|
+
defineEager("BASE", 2, 3, math_1.fnBASE);
|
|
732
|
+
defineEager("DECIMAL", 2, 2, math_1.fnDECIMAL);
|
|
733
|
+
defineEager("ROMAN", 1, 2, math_1.fnROMAN);
|
|
734
|
+
defineEager("ARABIC", 1, 1, math_1.fnARABIC);
|
|
735
|
+
defineEager("DEGREES", 1, 1, math_1.fnDEGREES);
|
|
736
|
+
defineEager("RADIANS", 1, 1, math_1.fnRADIANS);
|
|
737
|
+
defineEager("SUMX2MY2", 2, 2, math_1.fnSUMX2MY2);
|
|
738
|
+
defineEager("SUMX2PY2", 2, 2, math_1.fnSUMX2PY2);
|
|
739
|
+
defineEager("SUMXMY2", 2, 2, math_1.fnSUMXMY2);
|
|
740
|
+
defineEager("MULTINOMIAL", 1, 255, math_1.fnMULTINOMIAL);
|
|
741
|
+
defineEager("FACT", 1, 1, math_1.fnFACT);
|
|
742
|
+
defineEager("FACTDOUBLE", 1, 1, math_1.fnFACTDOUBLE);
|
|
743
|
+
defineEager("COMBIN", 2, 2, math_1.fnCOMBIN);
|
|
744
|
+
defineEager("COMBINA", 2, 2, math_1.fnCOMBINA);
|
|
745
|
+
defineEager("PERMUT", 2, 2, math_1.fnPERMUT);
|
|
746
|
+
defineEager("SIN", 1, 1, math_1.fnSIN);
|
|
747
|
+
defineEager("COS", 1, 1, math_1.fnCOS);
|
|
748
|
+
defineEager("TAN", 1, 1, math_1.fnTAN);
|
|
749
|
+
defineEager("ASIN", 1, 1, math_1.fnASIN);
|
|
750
|
+
defineEager("ACOS", 1, 1, math_1.fnACOS);
|
|
751
|
+
defineEager("ATAN", 1, 1, math_1.fnATAN);
|
|
752
|
+
defineEager("ATAN2", 2, 2, math_1.fnATAN2);
|
|
753
|
+
defineEager("SINH", 1, 1, math_1.fnSINH);
|
|
754
|
+
defineEager("COSH", 1, 1, math_1.fnCOSH);
|
|
755
|
+
defineEager("TANH", 1, 1, math_1.fnTANH);
|
|
756
|
+
defineEager("ASINH", 1, 1, math_1.fnASINH);
|
|
757
|
+
defineEager("ACOSH", 1, 1, math_1.fnACOSH);
|
|
758
|
+
defineEager("ATANH", 1, 1, math_1.fnATANH);
|
|
759
|
+
defineEager("SEC", 1, 1, math_1.fnSEC);
|
|
760
|
+
defineEager("CSC", 1, 1, math_1.fnCSC);
|
|
761
|
+
defineEager("COT", 1, 1, math_1.fnCOT);
|
|
762
|
+
defineEager("SECH", 1, 1, math_1.fnSECH);
|
|
763
|
+
defineEager("CSCH", 1, 1, math_1.fnCSCH);
|
|
764
|
+
defineEager("COTH", 1, 1, math_1.fnCOTH);
|
|
765
|
+
defineEager("ACOT", 1, 1, math_1.fnACOT);
|
|
766
|
+
defineEager("ACOTH", 1, 1, math_1.fnACOTH);
|
|
767
|
+
}
|
|
768
|
+
// ============================================================================
|
|
769
|
+
// Native Conditional Functions
|
|
770
|
+
// ============================================================================
|
|
771
|
+
const conditional_1 = require("../functions/conditional");
|
|
772
|
+
function registerNativeConditionalFunctions() {
|
|
773
|
+
defineEager("SUMIF", 2, 3, conditional_1.fnSUMIF);
|
|
774
|
+
defineEager("SUMIFS", 3, 255, conditional_1.fnSUMIFS);
|
|
775
|
+
defineEager("COUNTIF", 2, 2, conditional_1.fnCOUNTIF);
|
|
776
|
+
defineEager("COUNTIFS", 2, 255, conditional_1.fnCOUNTIFS);
|
|
777
|
+
defineEager("AVERAGEIF", 2, 3, conditional_1.fnAVERAGEIF);
|
|
778
|
+
defineEager("AVERAGEIFS", 3, 255, conditional_1.fnAVERAGEIFS);
|
|
779
|
+
defineEager("MAXIFS", 3, 255, conditional_1.fnMAXIFS);
|
|
780
|
+
defineEager("MINIFS", 3, 255, conditional_1.fnMINIFS);
|
|
781
|
+
}
|
|
782
|
+
// ============================================================================
|
|
783
|
+
// Native Lookup Functions
|
|
784
|
+
// ============================================================================
|
|
785
|
+
const lookup_1 = require("../functions/lookup");
|
|
786
|
+
function registerNativeLookupFunctions() {
|
|
787
|
+
defineEager("ROW", 0, 1, lookup_1.fnROW);
|
|
788
|
+
defineEager("COLUMN", 0, 1, lookup_1.fnCOLUMN);
|
|
789
|
+
defineEager("ROWS", 1, 1, lookup_1.fnROWS);
|
|
790
|
+
defineEager("COLUMNS", 1, 1, lookup_1.fnCOLUMNS);
|
|
791
|
+
defineEager("INDEX", 2, 4, lookup_1.fnINDEX);
|
|
792
|
+
defineEager("MATCH", 2, 3, lookup_1.fnMATCH);
|
|
793
|
+
defineEager("VLOOKUP", 3, 4, lookup_1.fnVLOOKUP);
|
|
794
|
+
defineEager("HLOOKUP", 3, 4, lookup_1.fnHLOOKUP);
|
|
795
|
+
defineEager("XLOOKUP", 3, 6, lookup_1.fnXLOOKUP);
|
|
796
|
+
defineEager("XMATCH", 2, 4, lookup_1.fnXMATCH);
|
|
797
|
+
defineEager("ADDRESS", 2, 5, lookup_1.fnADDRESS);
|
|
798
|
+
defineEager("LOOKUP", 2, 3, lookup_1.fnLOOKUP);
|
|
799
|
+
defineEager("TRANSPOSE", 1, 1, lookup_1.fnTRANSPOSE);
|
|
800
|
+
defineEager("AREAS", 1, 1, lookup_1.fnAREAS);
|
|
801
|
+
}
|
|
802
|
+
// ============================================================================
|
|
803
|
+
// Native Dynamic Array Functions
|
|
804
|
+
// ============================================================================
|
|
805
|
+
const dynamic_array_1 = require("../functions/dynamic-array");
|
|
806
|
+
function registerNativeDynamicArrayFunctions() {
|
|
807
|
+
defineEager("FILTER", 2, 3, dynamic_array_1.fnFILTER);
|
|
808
|
+
defineEager("SORT", 1, 4, dynamic_array_1.fnSORT);
|
|
809
|
+
defineEager("UNIQUE", 1, 3, dynamic_array_1.fnUNIQUE);
|
|
810
|
+
defineEager("SORTBY", 2, 255, dynamic_array_1.fnSORTBY);
|
|
811
|
+
defineEager("SEQUENCE", 1, 4, dynamic_array_1.fnSEQUENCE);
|
|
812
|
+
defineEager("RANDARRAY", 0, 5, dynamic_array_1.fnRANDARRAY);
|
|
813
|
+
defineEager("TOCOL", 1, 3, dynamic_array_1.fnTOCOL);
|
|
814
|
+
defineEager("TOROW", 1, 3, dynamic_array_1.fnTOROW);
|
|
815
|
+
defineEager("CHOOSEROWS", 2, 255, dynamic_array_1.fnCHOOSEROWS);
|
|
816
|
+
defineEager("CHOOSECOLS", 2, 255, dynamic_array_1.fnCHOOSECOLS);
|
|
817
|
+
defineEager("VSTACK", 1, 255, dynamic_array_1.fnVSTACK);
|
|
818
|
+
defineEager("HSTACK", 1, 255, dynamic_array_1.fnHSTACK);
|
|
819
|
+
defineEager("WRAPROWS", 2, 3, dynamic_array_1.fnWRAPROWS);
|
|
820
|
+
defineEager("WRAPCOLS", 2, 3, dynamic_array_1.fnWRAPCOLS);
|
|
821
|
+
defineEager("EXPAND", 2, 4, dynamic_array_1.fnEXPAND);
|
|
822
|
+
defineEager("TAKE", 2, 3, dynamic_array_1.fnTAKE);
|
|
823
|
+
defineEager("DROP", 2, 3, dynamic_array_1.fnDROP);
|
|
824
|
+
defineEager("SUBTOTAL", 2, 255, dynamic_array_1.fnSUBTOTAL);
|
|
825
|
+
defineEager("AGGREGATE", 3, 255, dynamic_array_1.fnAGGREGATE);
|
|
826
|
+
}
|
|
827
|
+
// ============================================================================
|
|
828
|
+
// Native Database Functions
|
|
829
|
+
// ============================================================================
|
|
830
|
+
const database_1 = require("../functions/database");
|
|
831
|
+
function registerNativeDatabaseFunctions() {
|
|
832
|
+
defineEager("DSUM", 3, 3, database_1.fnDSUM);
|
|
833
|
+
defineEager("DAVERAGE", 3, 3, database_1.fnDAVERAGE);
|
|
834
|
+
defineEager("DCOUNT", 3, 3, database_1.fnDCOUNT);
|
|
835
|
+
defineEager("DCOUNTA", 3, 3, database_1.fnDCOUNTA);
|
|
836
|
+
defineEager("DMAX", 3, 3, database_1.fnDMAX);
|
|
837
|
+
defineEager("DMIN", 3, 3, database_1.fnDMIN);
|
|
838
|
+
defineEager("DPRODUCT", 3, 3, database_1.fnDPRODUCT);
|
|
839
|
+
defineEager("DGET", 3, 3, database_1.fnDGET);
|
|
840
|
+
defineEager("DSTDEV", 3, 3, database_1.fnDSTDEV);
|
|
841
|
+
defineEager("DSTDEVP", 3, 3, database_1.fnDSTDEVP);
|
|
842
|
+
defineEager("DVAR", 3, 3, database_1.fnDVAR);
|
|
843
|
+
defineEager("DVARP", 3, 3, database_1.fnDVARP);
|
|
844
|
+
}
|
|
845
|
+
// Auto-initialize on import
|
|
846
|
+
ensureRegistryInitialized();
|