Closed klimashkin closed 10 years ago
Hello! If I have Opera 12.00, useragent returns me
{major: '12', minor: '00', patch: '0'}
And then semver 'satisfies' returns error
TypeError: Invalid Version: 12.00.0
because
Agent.prototype.satisfies = function satisfies (range) { return semver.satisfies(this.major + '.' + this.minor + '.' + this.patch, range); };
Maybe it must be like this
Agent.prototype.satisfies = function satisfies (range) { return semver.satisfies((Number(this.major) || 0) + '.' + (Number(this.minor) || 0) + '.' + (Number(this.patch) || 0), range); };
Yes, that's because the satisfies assumes that the versioning scheme follows the semver specification. Parsing the values down to number would probably be a good idea. Could you create a pull request for that?
Hello! If I have Opera 12.00, useragent returns me
And then semver 'satisfies' returns error
because
Maybe it must be like this