From 39a95bc21b2fbe9339ab53c279b35786ecaf17c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Mon, 16 Oct 2023 12:28:31 +0200 Subject: [PATCH] Replaced Number.POSITIVE_INFINITY and Number.NEGATIVE_INFINITY with Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER --- libs/extensions/std/exec/src/text-range-selector-executor.ts | 2 +- libs/extensions/std/lang/src/text-range-selector-meta-inf.ts | 2 +- .../src/lib/ast/wrappers/cell-range-wrapper.ts | 2 +- .../src/lib/constraint/length-constraint-meta-inf.ts | 2 +- .../src/lib/constraint/range-constraint-meta-inf.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/extensions/std/exec/src/text-range-selector-executor.ts b/libs/extensions/std/exec/src/text-range-selector-executor.ts index 9c325d53e..d86b7eabe 100644 --- a/libs/extensions/std/exec/src/text-range-selector-executor.ts +++ b/libs/extensions/std/exec/src/text-range-selector-executor.ts @@ -41,7 +41,7 @@ export class TextRangeSelectorExecutor extends AbstractBlockExecutor< context.logger.logDebug( `Selecting lines from ${lineFrom} to ${ - lineTo === Number.POSITIVE_INFINITY || lineTo >= numberOfLines + lineTo === Number.MAX_SAFE_INTEGER || lineTo >= numberOfLines ? 'the end' : `${lineTo}` }`, diff --git a/libs/extensions/std/lang/src/text-range-selector-meta-inf.ts b/libs/extensions/std/lang/src/text-range-selector-meta-inf.ts index 80a618cc8..03f268e90 100644 --- a/libs/extensions/std/lang/src/text-range-selector-meta-inf.ts +++ b/libs/extensions/std/lang/src/text-range-selector-meta-inf.ts @@ -24,7 +24,7 @@ export class TextRangeSelectorMetaInformation extends BlockMetaInformation { }, lineTo: { type: PrimitiveValuetypes.Integer, - defaultValue: Number.POSITIVE_INFINITY, + defaultValue: Number.MAX_SAFE_INTEGER, validation: greaterThanZeroValidation, }, }, diff --git a/libs/language-server/src/lib/ast/wrappers/cell-range-wrapper.ts b/libs/language-server/src/lib/ast/wrappers/cell-range-wrapper.ts index c50511cb4..57e7ad64e 100644 --- a/libs/language-server/src/lib/ast/wrappers/cell-range-wrapper.ts +++ b/libs/language-server/src/lib/ast/wrappers/cell-range-wrapper.ts @@ -28,7 +28,7 @@ import { columnIndexAsCharacters, } from './util/column-id-util'; -export const LAST_INDEX = Number.POSITIVE_INFINITY; +export const LAST_INDEX = Number.MAX_SAFE_INTEGER; export class CellIndex { constructor( diff --git a/libs/language-server/src/lib/constraint/length-constraint-meta-inf.ts b/libs/language-server/src/lib/constraint/length-constraint-meta-inf.ts index 09bcc4f94..42ba3d8fd 100644 --- a/libs/language-server/src/lib/constraint/length-constraint-meta-inf.ts +++ b/libs/language-server/src/lib/constraint/length-constraint-meta-inf.ts @@ -23,7 +23,7 @@ export class LengthConstraintMetaInformation extends ConstraintMetaInformation { }, maxLength: { type: PrimitiveValuetypes.Integer, - defaultValue: Number.POSITIVE_INFINITY, + defaultValue: Number.MAX_SAFE_INTEGER, validation: nonNegativeValidation, }, }, diff --git a/libs/language-server/src/lib/constraint/range-constraint-meta-inf.ts b/libs/language-server/src/lib/constraint/range-constraint-meta-inf.ts index 33722eaae..f6b379189 100644 --- a/libs/language-server/src/lib/constraint/range-constraint-meta-inf.ts +++ b/libs/language-server/src/lib/constraint/range-constraint-meta-inf.ts @@ -13,7 +13,7 @@ export class RangeConstraintMetaInformation extends ConstraintMetaInformation { { lowerBound: { type: PrimitiveValuetypes.Decimal, - defaultValue: Number.NEGATIVE_INFINITY, + defaultValue: Number.MIN_SAFE_INTEGER, }, lowerBoundInclusive: { type: PrimitiveValuetypes.Boolean, @@ -21,7 +21,7 @@ export class RangeConstraintMetaInformation extends ConstraintMetaInformation { }, upperBound: { type: PrimitiveValuetypes.Decimal, - defaultValue: Number.POSITIVE_INFINITY, + defaultValue: Number.MAX_SAFE_INTEGER, }, upperBoundInclusive: { type: PrimitiveValuetypes.Boolean,