core-js-compat
Advanced tools
Comparing version 3.38.0 to 3.38.1
@@ -5,18 +5,22 @@ 'use strict'; | ||
const VERSION_PATTERN = /(\d+)(?:\.(\d+))?(?:\.(\d+))?/; | ||
class SemVer { | ||
constructor(input) { | ||
const match = VERSION_PATTERN.exec(input); | ||
if (!match) throw new TypeError(`Invalid version: ${ input }`); | ||
const [, $major, $minor, $patch] = match; | ||
this.major = +$major; | ||
this.minor = $minor ? +$minor : 0; | ||
this.patch = $patch ? +$patch : 0; | ||
} | ||
toString() { | ||
return `${ this.major }.${ this.minor }.${ this.patch }`; | ||
} | ||
} | ||
function semver(input) { | ||
if (input instanceof semver) return input; | ||
// eslint-disable-next-line new-cap -- ok | ||
if (!(this instanceof semver)) return new semver(input); | ||
const match = /(\d+)(?:\.(\d+))?(?:\.(\d+))?/.exec(input); | ||
if (!match) throw new TypeError(`Invalid version: ${ input }`); | ||
const [, $major, $minor, $patch] = match; | ||
this.major = +$major; | ||
this.minor = $minor ? +$minor : 0; | ||
this.patch = $patch ? +$patch : 0; | ||
return input instanceof SemVer ? input : new SemVer(input); | ||
} | ||
semver.prototype.toString = function () { | ||
return `${ this.major }.${ this.minor }.${ this.patch }`; | ||
}; | ||
function compare($a, operator, $b) { | ||
@@ -23,0 +27,0 @@ const a = semver($a); |
{ | ||
"name": "core-js-compat", | ||
"version": "3.38.0", | ||
"version": "3.38.1", | ||
"type": "commonjs", | ||
@@ -8,3 +8,3 @@ "description": "core-js compat", | ||
"type": "git", | ||
"url": "https://github.com/zloirock/core-js.git", | ||
"url": "git+https://github.com/zloirock/core-js.git", | ||
"directory": "packages/core-js-compat" | ||
@@ -11,0 +11,0 @@ }, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
738910
28545