// Derived from node-semver v7.8.5 under the ISC license. // none of these are semvers // [value, reason, opt] import { MAX_LENGTH } from '../../../src/version/constants.ts' const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER const fixtures: readonly (readonly unknown[])[] = [ [new Array(MAX_LENGTH).join('1') + '.0.0', 'too long'], [`${MAX_SAFE_INTEGER}0.0.0`, 'too big'], [`0.${MAX_SAFE_INTEGER}0.0`, 'too big'], [`0.0.${MAX_SAFE_INTEGER}0`, 'too big'], ['hello, world', 'not a version'], ['hello, world', 'even loose, its still junk', true], ['xyz', 'even loose as an opt, same', { loose: true }], [/a regexp/, 'regexp is not a string'], [/1.2.3/, 'semver-ish regexp is not a string'], [ { /* v8 ignore next -- @preserve */ toString: () => { throw new Error('never throw') }, }, 'obj with a tostring is not a string', ], ] export default fixtures