удаление неиспользуемого
This commit is contained in:
@@ -4,13 +4,12 @@ import {
|
||||
VOLATILE_FUNCTIONS,
|
||||
} from './functions'
|
||||
|
||||
// Регулярные выражения для ссылок
|
||||
// Ограничиваем поиск ячеек диапазоном A1-Z90
|
||||
const QUALIFIED_REF_RE = /\b[A-Za-z0-9_]+\b/g // SheetName!A1 до SheetName!Z90
|
||||
const LOCAL_REF_RE = /\b[A-Z]([1-9]|[1-8][0-9]|90)\b/g // A1 до Z90
|
||||
const RANGE_RE = /\b[A-Z]([1-9]|[1-8][0-9]|90):[A-Z]([1-9]|[1-8][0-9]|90)\b/g // A1:B2, D5:D7, etc. в диапазоне A1-Z90
|
||||
const QUALIFIED_REF_RE = /\b[A-Za-z0-9_]+\b/g
|
||||
const LOCAL_REF_RE = /\b[A-Z]([1-9]|[1-8][0-9]|90)\b/g
|
||||
const RANGE_RE = /\b[A-Z]([1-9]|[1-8][0-9]|90):[A-Z]([1-9]|[1-8][0-9]|90)\b/g
|
||||
const QUALIFIED_RANGE_RE =
|
||||
/\b[A-Za-z0-9_]+:[A-Z]([1-9]|[1-8][0-9]|90)\b/g // SheetName!A1:B2 в диапазоне A1-Z90
|
||||
/\b[A-Za-z0-9_]+:[A-Z]([1-9]|[1-8][0-9]|90)\b/g
|
||||
|
||||
// Типы для значений ячеек
|
||||
export type CellValue = string | number | boolean | null | undefined
|
||||
@@ -598,10 +597,6 @@ export class Workbook {
|
||||
}
|
||||
}
|
||||
|
||||
removeFunction(name: string): void {
|
||||
delete this._functions[name.toUpperCase()]
|
||||
}
|
||||
|
||||
getFunctions(): Record<string, ExcelFunction> {
|
||||
return this._functions
|
||||
}
|
||||
@@ -641,14 +636,6 @@ export class Workbook {
|
||||
|
||||
// Утилиты для работы с координатами ячеек
|
||||
export class CellUtils {
|
||||
static columnToIndex(column: string): number {
|
||||
let result = 0
|
||||
for (let i = 0; i < column.length; i++) {
|
||||
result = result * 26 + (column.charCodeAt(i) - 65 + 1)
|
||||
}
|
||||
return result - 1
|
||||
}
|
||||
|
||||
static indexToColumn(index: number): string {
|
||||
let result = ''
|
||||
while (index >= 0) {
|
||||
@@ -658,17 +645,6 @@ export class CellUtils {
|
||||
return result
|
||||
}
|
||||
|
||||
static parseCellName(cellName: string): { column: string; row: number } {
|
||||
const match = cellName.match(/^([A-Z]+)(\d+)$/)
|
||||
if (!match) {
|
||||
throw new Error(`Invalid cell name: ${cellName}`)
|
||||
}
|
||||
return {
|
||||
column: match[1],
|
||||
row: parseInt(match[2], 10),
|
||||
}
|
||||
}
|
||||
|
||||
static createCellName(column: string | number, row: number): string {
|
||||
const col =
|
||||
typeof column === 'number' ? CellUtils.indexToColumn(column) : column
|
||||
|
||||
Reference in New Issue
Block a user