constants.js 657 B

123456789101112131415161718192021222324252627282930
  1. // Note: this is the semver.org version of the spec that it implements
  2. // Not necessarily the package version of this code.
  3. const SEMVER_SPEC_VERSION = '2.0.0'
  4. const MAX_LENGTH = 256
  5. const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  6. /* istanbul ignore next */ 9007199254740991
  7. // Max safe segment length for coercion.
  8. const MAX_SAFE_COMPONENT_LENGTH = 16
  9. const RELEASE_TYPES = [
  10. 'major',
  11. 'premajor',
  12. 'minor',
  13. 'preminor',
  14. 'patch',
  15. 'prepatch',
  16. 'prerelease',
  17. ]
  18. module.exports = {
  19. MAX_LENGTH,
  20. MAX_SAFE_COMPONENT_LENGTH,
  21. MAX_SAFE_INTEGER,
  22. RELEASE_TYPES,
  23. SEMVER_SPEC_VERSION,
  24. FLAG_INCLUDE_PRERELEASE: 0b001,
  25. FLAG_LOOSE: 0b010,
  26. }