Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m #3957

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

m #3957

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/helpers/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface ConstructorArgs {

export class RangeImpl implements Range {
private readonly _zone: Readonly<Zone | UnboundedZone>;
readonly zone: Readonly<Zone>;
readonly parts: Range["parts"];
readonly invalidXc?: string;
readonly prefixSheet: boolean = false;
Expand All @@ -43,6 +44,7 @@ export class RangeImpl implements Range {
this.sheetId = args.sheetId;
this.invalidSheetName = args.invalidSheetName;

this.zone = this.computeZone();
let _fixedParts = [...args.parts];
if (args.parts.length === 1 && getZoneArea(this.zone) > 1) {
_fixedParts.push({ ...args.parts[0] });
Expand All @@ -63,7 +65,7 @@ export class RangeImpl implements Range {
return this._zone;
}

get zone(): Readonly<Zone> {
computeZone(): Readonly<Zone> {
const { left, top, bottom, right } = this._zone;
if (right !== undefined && bottom !== undefined) {
return this._zone as Readonly<Zone>;
Expand Down