UNPKG

hyperformula

Version:

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

28 lines 570 B
/** * @license * Copyright (c) 2025 Handsoncode. All rights reserved. */ import { DenseStrategy } from "./DenseStrategy.mjs"; import { SparseStrategy } from "./SparseStrategy.mjs"; export class DenseSparseChooseBasedOnThreshold { constructor(threshold) { this.threshold = threshold; } call(fill) { if (fill > this.threshold) { return DenseStrategy; } else { return SparseStrategy; } } } export class AlwaysSparse { call() { return SparseStrategy; } } export class AlwaysDense { call() { return DenseStrategy; } }