From dbf1883f5a81dcf668c3c1cd66fd19aa7043c5e5 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 1 Feb 2024 23:22:37 +0100 Subject: [PATCH 1/4] remove replacement --- semver/gtr.ts | 16 +++++++++++++--- semver/ltr.ts | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/semver/gtr.ts b/semver/gtr.ts index 6d32024e9218..10e4cdbe0b4d 100644 --- a/semver/gtr.ts +++ b/semver/gtr.ts @@ -1,12 +1,22 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import type { Range, SemVer, SemVerRange } from "./types.ts"; import { rangeMax } from "./range_max.ts"; -import { gt } from "./gt.ts"; +import { greaterThan } from "./greater_than.ts"; +import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; -/** Checks to see if the version is greater than all possible versions of the range. */ +/** + * Checks to see if the version is greater than all possible versions of the range. + * @deprecated (will be removed after 0.215.0) Use `greaterThan(version, rangeMax(range))` instead. + */ export function gtr( version: SemVer, range: SemVerRange | Range, ): boolean { - return gt(version, rangeMax(range)); + warnOnDeprecatedApi({ + apiName: "gtr", + stack: new Error().stack!, + removalVersion: "0.215.0", + suggestion: "Use 'greaterThan(version, rangeMax(range))' instead.", + }); + return greaterThan(version, rangeMax(range)); } diff --git a/semver/ltr.ts b/semver/ltr.ts index e86f5cd0e49a..cd932c960255 100644 --- a/semver/ltr.ts +++ b/semver/ltr.ts @@ -1,12 +1,22 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import type { Range, SemVer, SemVerRange } from "./types.ts"; -import { lt } from "./lt.ts"; +import { lessThan } from "./less_than.ts"; import { rangeMin } from "./range_min.ts"; +import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; -/** Less than range comparison */ +/** + * Less than range comparison + * @deprecated (will be removed after 0.215.0) Use `lessThan(version, rangeMin(range))` instead. + */ export function ltr( version: SemVer, range: SemVerRange | Range, ): boolean { - return lt(version, rangeMin(range)); + warnOnDeprecatedApi({ + apiName: "ltr", + stack: new Error().stack!, + removalVersion: "0.215.0", + suggestion: "Use 'lessThan(version, rangeMin(range))' instead.", + }); + return lessThan(version, rangeMin(range)); } From c7025980f5c06ebb6aa786c0c806b619d53d1ac3 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 2 Feb 2024 14:53:01 +0900 Subject: [PATCH 2/4] move removal version forward --- semver/gtr.ts | 2 +- semver/ltr.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/semver/gtr.ts b/semver/gtr.ts index 10e4cdbe0b4d..6aee6775ccc7 100644 --- a/semver/gtr.ts +++ b/semver/gtr.ts @@ -6,7 +6,7 @@ import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; /** * Checks to see if the version is greater than all possible versions of the range. - * @deprecated (will be removed after 0.215.0) Use `greaterThan(version, rangeMax(range))` instead. + * @deprecated (will be removed after 0.217.0) Use `greaterThan(version, rangeMax(range))` instead. */ export function gtr( version: SemVer, diff --git a/semver/ltr.ts b/semver/ltr.ts index cd932c960255..5f0b951a6995 100644 --- a/semver/ltr.ts +++ b/semver/ltr.ts @@ -6,7 +6,7 @@ import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; /** * Less than range comparison - * @deprecated (will be removed after 0.215.0) Use `lessThan(version, rangeMin(range))` instead. + * @deprecated (will be removed after 0.217.0) Use `lessThan(version, rangeMin(range))` instead. */ export function ltr( version: SemVer, From cae9c13410a8d9e7545aa01b9e15d4504849cc7d Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Sat, 3 Feb 2024 10:13:25 +1100 Subject: [PATCH 3/4] remove use of `warnOnDeprecatedApi()` --- semver/gtr.ts | 7 ------- semver/ltr.ts | 7 ------- 2 files changed, 14 deletions(-) diff --git a/semver/gtr.ts b/semver/gtr.ts index 6aee6775ccc7..8460f03ff37b 100644 --- a/semver/gtr.ts +++ b/semver/gtr.ts @@ -2,7 +2,6 @@ import type { Range, SemVer, SemVerRange } from "./types.ts"; import { rangeMax } from "./range_max.ts"; import { greaterThan } from "./greater_than.ts"; -import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; /** * Checks to see if the version is greater than all possible versions of the range. @@ -12,11 +11,5 @@ export function gtr( version: SemVer, range: SemVerRange | Range, ): boolean { - warnOnDeprecatedApi({ - apiName: "gtr", - stack: new Error().stack!, - removalVersion: "0.215.0", - suggestion: "Use 'greaterThan(version, rangeMax(range))' instead.", - }); return greaterThan(version, rangeMax(range)); } diff --git a/semver/ltr.ts b/semver/ltr.ts index 5f0b951a6995..73b5a387cb1c 100644 --- a/semver/ltr.ts +++ b/semver/ltr.ts @@ -2,7 +2,6 @@ import type { Range, SemVer, SemVerRange } from "./types.ts"; import { lessThan } from "./less_than.ts"; import { rangeMin } from "./range_min.ts"; -import { warnOnDeprecatedApi } from "../internal/warn_on_deprecated_api.ts"; /** * Less than range comparison @@ -12,11 +11,5 @@ export function ltr( version: SemVer, range: SemVerRange | Range, ): boolean { - warnOnDeprecatedApi({ - apiName: "ltr", - stack: new Error().stack!, - removalVersion: "0.215.0", - suggestion: "Use 'lessThan(version, rangeMin(range))' instead.", - }); return lessThan(version, rangeMin(range)); } From 71cde97878c3ba852f63d347a312f6952c344bc1 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Sat, 3 Feb 2024 10:33:57 +1100 Subject: [PATCH 4/4] tweaks --- semver/gtr.ts | 4 +++- semver/ltr.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/semver/gtr.ts b/semver/gtr.ts index 8460f03ff37b..f4ec3f3ecadd 100644 --- a/semver/gtr.ts +++ b/semver/gtr.ts @@ -5,7 +5,9 @@ import { greaterThan } from "./greater_than.ts"; /** * Checks to see if the version is greater than all possible versions of the range. - * @deprecated (will be removed after 0.217.0) Use `greaterThan(version, rangeMax(range))` instead. + * @deprecated (will be removed after 0.217.0) See + * {@link https://github.com/denoland/deno_std/issues/4273 | deno_std#4273} + * for details. */ export function gtr( version: SemVer, diff --git a/semver/ltr.ts b/semver/ltr.ts index 73b5a387cb1c..b076c9ccfcf2 100644 --- a/semver/ltr.ts +++ b/semver/ltr.ts @@ -5,7 +5,9 @@ import { rangeMin } from "./range_min.ts"; /** * Less than range comparison - * @deprecated (will be removed after 0.217.0) Use `lessThan(version, rangeMin(range))` instead. + * @deprecated (will be removed after 0.217.0) See + * {@link https://github.com/denoland/deno_std/issues/4273 | deno_std#4273} + * for details. */ export function ltr( version: SemVer,