UNPKG

hyperformula

Version:

HyperFormula is a JavaScript engine for efficient processing of spreadsheet-like data and formulas

36 lines (34 loc) 894 B
"use strict"; exports.__esModule = true; exports.DenseSparseChooseBasedOnThreshold = exports.AlwaysSparse = exports.AlwaysDense = void 0; var _DenseStrategy = require("./DenseStrategy"); var _SparseStrategy = require("./SparseStrategy"); /** * @license * Copyright (c) 2025 Handsoncode. All rights reserved. */ class DenseSparseChooseBasedOnThreshold { constructor(threshold) { this.threshold = threshold; } call(fill) { if (fill > this.threshold) { return _DenseStrategy.DenseStrategy; } else { return _SparseStrategy.SparseStrategy; } } } exports.DenseSparseChooseBasedOnThreshold = DenseSparseChooseBasedOnThreshold; class AlwaysSparse { call() { return _SparseStrategy.SparseStrategy; } } exports.AlwaysSparse = AlwaysSparse; class AlwaysDense { call() { return _DenseStrategy.DenseStrategy; } } exports.AlwaysDense = AlwaysDense;