@@ -398,14 +398,15 @@ range, use the `satisfies(version, range)` function.
398398
399399* ` coerce(version) ` : Coerces a string to semver if possible
400400
401- This aims to provide a very forgiving translation of a non-semver
402- string to semver. It looks for the first digit in a string, and
403- consumes all remaining characters which satisfy at least a partial semver
404- (e.g., ` 1 ` , ` 1.2 ` , ` 1.2.3 ` ) up to the max permitted length (256 characters).
405- Longer versions are simply truncated (` 4.6.3.9.2-alpha2 ` becomes ` 4.6.3 ` ).
406- All surrounding text is simply ignored (` v3.4 replaces v3.3.1 ` becomes ` 3.4.0 ` ).
407- Only text which lacks digits will fail coercion (` version one ` is not valid).
408- The maximum length for any semver component considered for coercion is 16 characters;
409- longer components will be ignored (` 10000000000000000.4.7.4 ` becomes ` 4.7.4 ` ).
410- The maximum value for any semver component is ` Integer.MAX_SAFE_INTEGER || (2**53 - 1) ` ;
411- higher value components are invalid (` 9999999999999999.4.7.4 ` is likely invalid).
401+ This aims to provide a very forgiving translation of a non-semver string to
402+ semver. It looks for the first digit in a string, and consumes all
403+ remaining characters which satisfy at least a partial semver (e.g., ` 1 ` ,
404+ ` 1.2 ` , ` 1.2.3 ` ) up to the max permitted length (256 characters). Longer
405+ versions are simply truncated (` 4.6.3.9.2-alpha2 ` becomes ` 4.6.3 ` ). All
406+ surrounding text is simply ignored (` v3.4 replaces v3.3.1 ` becomes
407+ ` 3.4.0 ` ). Only text which lacks digits will fail coercion (` version one `
408+ is not valid). The maximum length for any semver component considered for
409+ coercion is 16 characters; longer components will be ignored
410+ (` 10000000000000000.4.7.4 ` becomes ` 4.7.4 ` ). The maximum value for any
411+ semver component is ` Number.MAX_SAFE_INTEGER || (2**53 - 1) ` ; higher value
412+ components are invalid (` 9999999999999999.4.7.4 ` is likely invalid).
0 commit comments