semver.js 433 B

12345678910111213141516171819
  1. import gt from 'semver/functions/gt';
  2. import lt from 'semver/functions/lt';
  3. import eq from 'semver/functions/eq';
  4. import neq from 'semver/functions/neq';
  5. import gte from 'semver/functions/gte';
  6. import lte from 'semver/functions/lte';
  7. export class semver {
  8. static compare(comparator, v1, v2) {
  9. return this.comparator[comparator](v1, v2);
  10. }
  11. }
  12. semver.comparator = {
  13. gt,
  14. lt,
  15. eq,
  16. neq,
  17. gte,
  18. lte,
  19. };