Skip to content

Commit

Permalink
just in case of future reusage, add semver.prototype.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Aug 27, 2022
1 parent 8a7d9e7 commit 10519a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core-js-compat/helpers.js
@@ -1,4 +1,5 @@
'use strict';
// eslint-disable-next-line es-x/no-object-hasown -- safe
const has = Object.hasOwn || Function.call.bind({}.hasOwnProperty);

function semver(input) {
Expand All @@ -13,6 +14,10 @@ function semver(input) {
this.patch = $patch ? +$patch : 0;
}

semver.prototype.toString = function () {
return `${ this.major }.${ this.minor }.${ this.patch }`;
};

function compare($a, operator, $b) {
const a = semver($a);
const b = semver($b);
Expand Down

0 comments on commit 10519a1

Please sign in to comment.