UNPKG

hyperformula

Version:

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

22 lines 686 B
/** * @license * Copyright (c) 2025 Handsoncode. All rights reserved. */ /** * Converts sheet names to ids and adds placeholder sheets if they don't exist. */ export class SheetReferenceRegistrar { constructor(sheetMapping, addressMapping) { this.sheetMapping = sheetMapping; this.addressMapping = addressMapping; } /** * Adds placeholder sheet if it doesn't exist and adds placeholder strategy to address mapping. * @returns {number} sheet id */ ensureSheetRegistered(sheetName) { const sheetId = this.sheetMapping.addPlaceholderIfNotExists(sheetName); this.addressMapping.addSheetStrategyPlaceholderIfNotExists(sheetId); return sheetId; } }