std/semver/equals.ts
Tim Reichen 0a32c8f5e8
deprecation(semver): rename eq(), neq(), lt(), lte(), gt() and gte() (#4083)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-01-23 13:04:12 +09:00

13 lines
427 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { compare } from "./compare.ts";
import type { SemVer } from "./types.ts";
/**
* Returns `true` if both semantic versions are logically equivalent, even if they're not the exact same version object.
*
* This is equal to `compare(s0, s1) === 0`.
*/
export function equals(s0: SemVer, s1: SemVer): boolean {
return compare(s0, s1) === 0;
}