diff --git a/Directory.Packages.props b/Directory.Packages.props
index f1b7b31..403dbf3 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -9,13 +9,14 @@
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/Jvw.DevToys.SemverCalculator.Tests/Jvw.DevToys.SemverCalculator.Tests.csproj b/Jvw.DevToys.SemverCalculator.Tests/Jvw.DevToys.SemverCalculator.Tests.csproj
index 50f275e..3d7006c 100644
--- a/Jvw.DevToys.SemverCalculator.Tests/Jvw.DevToys.SemverCalculator.Tests.csproj
+++ b/Jvw.DevToys.SemverCalculator.Tests/Jvw.DevToys.SemverCalculator.Tests.csproj
@@ -23,6 +23,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Jvw.DevToys.SemverCalculator/Jvw.DevToys.SemverCalculator.csproj b/Jvw.DevToys.SemverCalculator/Jvw.DevToys.SemverCalculator.csproj
index dd93102..44bbc07 100644
--- a/Jvw.DevToys.SemverCalculator/Jvw.DevToys.SemverCalculator.csproj
+++ b/Jvw.DevToys.SemverCalculator/Jvw.DevToys.SemverCalculator.csproj
@@ -57,6 +57,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Jvw.DevToys.SemverCalculator/Pack/Microsoft.Extensions.Primitives.xml b/Jvw.DevToys.SemverCalculator/Pack/Microsoft.Extensions.Primitives.xml
new file mode 100644
index 0000000..9f2e426
--- /dev/null
+++ b/Jvw.DevToys.SemverCalculator/Pack/Microsoft.Extensions.Primitives.xml
@@ -0,0 +1,1035 @@
+
+
+
+ Microsoft.Extensions.Primitives
+
+
+
+
+ A implementation using .
+
+
+
+
+ Initializes a new instance of .
+
+ The .
+
+
+
+
+
+
+
+
+
+
+
+
+ Propagates notifications that a change has occurred.
+
+
+
+
+ Registers the action to be called whenever the token produced changes.
+
+ Produces the change token.
+ Action called when the token changes.
+
+
+
+
+ Registers the action to be called whenever the token produced changes.
+
+ Produces the change token.
+ Action called when the token changes.
+ state for the consumer.
+
+
+
+
+ An which represents one or more instances.
+
+
+
+
+ Creates a new instance of .
+
+ The list of to compose.
+
+
+
+ Returns the list of which compose the current .
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides extensions methods for the namespace.
+
+
+
+
+ Add the given to the .
+
+ The to add to.
+ The to add.
+ The original .
+
+
+
+ Propagates notifications that a change has occurred.
+
+
+
+
+ Gets a value that indicates if a change has occurred.
+
+
+
+
+ Indicates if this token will pro-actively raise callbacks. If false, the token consumer must
+ poll to detect changes.
+
+
+
+
+ Registers for a callback that will be invoked when the entry has changed.
+ MUST be set before the callback is invoked.
+
+ The to invoke.
+ State to be passed into the callback.
+ An that is used to unregister the callback.
+
+
+
+ Provides a mechanism for fast, non-allocating string concatenation.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The suggested starting size of the instance.
+
+
+
+ Gets the number of characters that the current object can contain.
+
+
+
+
+ Appends a string to the end of the current instance.
+
+ The string to append.
+
+
+
+ Appends a string segment to the end of the current instance.
+
+ The string segment to append.
+
+
+
+ Appends a substring to the end of the current instance.
+
+ The string that contains the substring to append.
+ The starting position of the substring within value.
+ The number of characters in value to append.
+
+
+
+ Appends a character to the end of the current instance.
+
+ The character to append.
+
+
+
+ Converts the value of this instance to a String.
+
+ A string whose value is the same as this instance.
+
+
+
+ An optimized representation of a substring.
+
+
+
+
+ A for .
+
+
+
+
+ Initializes an instance of the struct.
+
+
+ The original . The includes the whole .
+
+
+
+
+ Initializes an instance of the struct.
+
+ The original used as buffer.
+ The offset of the segment within the .
+ The length of the segment.
+
+ is .
+
+
+ or is less than zero, or +
+ is greater than the number of characters in .
+
+
+
+
+ Gets the buffer for this .
+
+
+
+
+ Gets the offset within the buffer for this .
+
+
+
+
+ Gets the length of this .
+
+
+
+
+ Gets the value of this segment as a .
+
+
+
+
+ Gets whether this contains a valid value.
+
+
+
+
+ Gets the at a specified position in the current .
+
+ The offset into the
+ The at a specified position.
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Gets a from the current .
+
+ The from this .
+
+
+
+ Gets a from the current that starts
+ at the position specified by , and has the remaining length.
+
+ The zero-based starting character position in this .
+ A with the remaining chars that begins at in
+ this .
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Gets a from the current that starts
+ at the position specified by , and has the specified .
+
+ The zero-based starting character position in this .
+ The number of characters in the span.
+ A with that begins at
+ in this .
+
+ or is less than zero, or + is
+ greater than .
+
+
+
+
+ Gets a from the current .
+
+ The from this .
+
+
+
+ Compares substrings of two specified objects using the specified rules,
+ and returns an integer that indicates their relative position in the sort order.
+
+ The first to compare.
+ The second to compare.
+ One of the enumeration values that specifies the rules for the comparison.
+
+ A 32-bit signed integer indicating the lexical relationship between the two comparands.
+ The value is negative if is less than , 0 if the two comparands are equal,
+ and positive if is greater than .
+
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+
+ An object to compare with this object.
+ if the current object is equal to the other parameter; otherwise, .
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+
+ An object to compare with this object.
+ if the current object is equal to the other parameter; otherwise, .
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+
+ An object to compare with this object.
+ One of the enumeration values that specifies the rules to use in the comparison.
+ if the current object is equal to the other parameter; otherwise, .
+
+
+
+ Determines whether two specified objects have the same value. A parameter specifies the culture, case, and
+ sort rules used in the comparison.
+
+ The first to compare.
+ The second to compare.
+ One of the enumeration values that specifies the rules for the comparison.
+ if the objects are equal; otherwise, .
+
+
+
+ Checks if the specified is equal to the current .
+
+ The to compare with the current .
+ if the specified is equal to the current ; otherwise, .
+
+
+
+ Checks if the specified is equal to the current .
+
+ The to compare with the current .
+ One of the enumeration values that specifies the rules to use in the comparison.
+ if the specified is equal to the current ; otherwise, .
+
+
+
+ Returns a hash code for this instance.
+
+
+ A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
+
+
+
+
+ Checks if two specified have the same value.
+
+ The first to compare, or .
+ The second to compare, or .
+ if the value of is the same as the value of ; otherwise, .
+
+
+
+ Checks if two specified have different values.
+
+ The first to compare, or .
+ The second to compare, or .
+ if the value of is different from the value of ; otherwise, .
+
+
+
+ Creates a new from the given .
+
+ The to convert to a
+
+
+
+ Creates a see from the given .
+
+ The to convert to a .
+
+
+
+ Creates a see from the given .
+
+ The to convert to a .
+
+
+
+ Checks if the beginning of this matches the specified when compared using the specified .
+
+ The to compare.
+ One of the enumeration values that specifies the rules to use in the comparison.
+ if matches the beginning of this ; otherwise, .
+
+ is .
+
+
+
+
+ Checks if the end of this matches the specified when compared using the specified .
+
+ The to compare.
+ One of the enumeration values that specifies the rules to use in the comparison.
+ if matches the end of this ; otherwise, .
+
+ is .
+
+
+
+
+ Retrieves a substring from this .
+ The substring starts at the position specified by and has the remaining length.
+
+ The zero-based starting character position of a substring in this .
+ A that is equivalent to the substring of remaining length that begins at
+ in this
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Retrieves a substring from this .
+ The substring starts at the position specified by and has the specified .
+
+ The zero-based starting character position of a substring in this .
+ The number of characters in the substring.
+ A that is equivalent to the substring of that begins at
+ in this
+
+ or is less than zero, or + is
+ greater than .
+
+
+
+
+ Retrieves a that represents a substring from this .
+ The starts at the position specified by .
+
+ The zero-based starting character position of a substring in this .
+ A that begins at in this
+ whose length is the remainder.
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Retrieves a that represents a substring from this .
+ The starts at the position specified by and has the specified .
+
+ The zero-based starting character position of a substring in this .
+ The number of characters in the substring.
+ A that is equivalent to the substring of that begins at in this
+
+ or is less than zero, or + is
+ greater than .
+
+
+
+
+ Gets the zero-based index of the first occurrence of the character in this .
+ The search starts at and examines a specified number of character positions.
+
+ The Unicode character to seek.
+ The zero-based index position at which the search starts.
+ The number of characters to examine.
+ The zero-based index position of from the beginning of the if that character is found, or -1 if it is not.
+
+ or is less than zero, or + is
+ greater than .
+
+
+
+
+ Gets the zero-based index of the first occurrence of the character in this .
+ The search starts at .
+
+ The Unicode character to seek.
+ The zero-based index position at which the search starts.
+ The zero-based index position of from the beginning of the if that character is found, or -1 if it is not.
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Gets the zero-based index of the first occurrence of the character in this .
+
+ The Unicode character to seek.
+ The zero-based index position of from the beginning of the if that character is found, or -1 if it is not.
+
+
+
+ Reports the zero-based index of the first occurrence in this instance of any character in a specified array
+ of Unicode characters. The search starts at a specified character position and examines a specified number
+ of character positions.
+
+ A Unicode character array containing one or more characters to seek.
+ The search starting position.
+ The number of character positions to examine.
+ The zero-based index position of the first occurrence in this instance where any character in
+ was found; -1 if no character in was found.
+
+ is .
+
+
+ or is less than zero, or + is
+ greater than .
+
+
+
+
+ Reports the zero-based index of the first occurrence in this instance of any character in a specified array
+ of Unicode characters. The search starts at a specified character position.
+
+ A Unicode character array containing one or more characters to seek.
+ The search starting position.
+ The zero-based index position of the first occurrence in this instance where any character in
+ was found; -1 if no character in was found.
+
+ is greater than or equal to or less than zero.
+
+
+
+
+ Reports the zero-based index of the first occurrence in this instance of any character in a specified array
+ of Unicode characters.
+
+ A Unicode character array containing one or more characters to seek.
+ The zero-based index position of the first occurrence in this instance where any character in
+ was found; -1 if no character in was found.
+
+
+
+ Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.
+
+ The Unicode character to seek.
+ The zero-based index position of value if that character is found, or -1 if it is not.
+
+
+
+ Removes all leading and trailing whitespaces.
+
+ The trimmed .
+
+
+
+ Removes all leading whitespaces.
+
+ The trimmed .
+
+
+
+ Removes all trailing whitespaces.
+
+ The trimmed .
+
+
+
+ Splits a string into s that are based on the characters in an array.
+
+ A character array that delimits the substrings in this string, an empty array that
+ contains no delimiters, or null.
+ An whose elements contain the s from this instance
+ that are delimited by one or more characters in .
+
+
+
+ Indicates whether the specified is null or an Empty string.
+
+ The to test.
+
+
+
+
+ Returns the represented by this or if the does not contain a value.
+
+ The represented by this or if the does not contain a value.
+
+
+
+ Compares two objects.
+
+
+
+
+ Gets a object that performs a case-sensitive ordinal comparison.
+
+
+
+
+ Gets a object that performs a case-insensitive ordinal comparison.
+
+
+
+
+ Compares two objects and returns an indication of their relative sort order.
+
+ The first to compare.
+ The second to compare.
+ A 32-bit signed integer that indicates the lexical relationship between the two comparands.
+
+
+
+ Determines whether two objects are equal.
+
+ The first to compare.
+ The second to compare.
+ if the two objects are equal; otherwise, .
+
+
+
+ Returns a hash code for a object.
+
+ The to get a hash code for.
+ A hash code for a , suitable for use in hashing algorithms and data structures like a hash table.
+
+
+
+ Tokenizes a into s.
+
+
+
+
+ Initializes a new instance of .
+
+ The to tokenize.
+ The characters to tokenize by.
+
+
+
+ Initializes a new instance of .
+
+ The to tokenize.
+ The characters to tokenize by.
+
+
+
+ Initializes a new instance of .
+
+ An based on the 's value and separators.
+
+
+
+ Enumerates the tokens represented by .
+
+
+
+
+ Initializes an using a .
+
+ containing value and separators for enumeration.
+
+
+
+ Gets the current from the .
+
+
+
+
+ Releases all resources used by the .
+
+
+
+
+ Advances the enumerator to the next token in the .
+
+ if the enumerator was successfully advanced to the next token; if the enumerator has passed the end of the .
+
+
+
+ Resets the to its initial state.
+
+
+
+
+ Represents zero/null, one, or many strings in an efficient way.
+
+
+
+
+ A readonly instance of the struct whose value is an empty string array.
+
+
+ In application code, this field is most commonly used to safely represent a that has null string values.
+
+
+
+
+ Initializes a new instance of the structure using the specified string.
+
+ A string value or null.
+
+
+
+ Initializes a new instance of the structure using the specified array of strings.
+
+ A string array.
+
+
+
+ Defines an implicit conversion of a given string to a .
+
+ A string to implicitly convert.
+
+
+
+ Defines an implicit conversion of a given string array to a .
+
+ A string array to implicitly convert.
+
+
+
+ Defines an implicit conversion of a given to a string, with multiple values joined as a comma separated string.
+
+
+ Returns null where has been initialized from an empty string array or is .
+
+ A to implicitly convert.
+
+
+
+ Defines an implicit conversion of a given to a string array.
+
+ A to implicitly convert.
+
+
+
+ Gets the number of elements contained in this .
+
+
+
+
+ Gets the at index.
+
+ The string at the specified index.
+ The zero-based index of the element to get.
+ Set operations are not supported on readonly .
+
+
+
+ Gets the at index.
+
+ The string at the specified index.
+ The zero-based index of the element to get.
+
+
+
+ Converts the value of the current object to its equivalent string representation, with multiple values joined as a comma separated string.
+
+ A string representation of the value of the current object.
+
+
+
+ Creates a string array from the current object.
+
+ A string array represented by this instance.
+
+ If the contains a single string internally, it is copied to a new array.
+ If the contains an array internally it returns that array instance.
+
+
+
+
+ Returns the zero-based index of the first occurrence of an item in the .
+
+ The string to locate in the .
+ the zero-based index of the first occurrence of within the , if found; otherwise, -1.
+
+
+ Determines whether a string is in the .
+ The to locate in the .
+ true if item is found in the ; otherwise, false.
+
+
+
+ Copies the entire to a string array, starting at the specified index of the target array.
+
+ The one-dimensional that is the destination of the elements copied from. The must have zero-based indexing.
+ The zero-based index in the destination array at which copying begins.
+ array is null.
+ arrayIndex is less than 0.
+ The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array.
+
+
+ Retrieves an object that can iterate through the individual strings in this .
+ An enumerator that can be used to iterate through the .
+
+
+
+
+
+
+
+
+
+ Indicates whether the specified contains no string values.
+
+ The to test.
+ true if value contains a single null or empty string or an empty array; otherwise, false.
+
+
+
+ Concatenates two specified instances of .
+
+ The first to concatenate.
+ The second to concatenate.
+ The concatenation of and .
+
+
+
+ Concatenates specified instance of with specified .
+
+ The to concatenate.
+ The to concatenate.
+ The concatenation of and .
+
+
+
+ Concatenates specified instance of with specified .
+
+ The to concatenate.
+ The to concatenate.
+ The concatenation of and .
+
+
+
+ Determines whether two specified objects have the same values in the same order.
+
+ The first to compare.
+ The second to compare.
+ true if the value of is the same as the value of ; otherwise, false.
+
+
+
+ Determines whether two specified have the same values.
+
+ The first to compare.
+ The second to compare.
+ true if the value of is the same as the value of ; otherwise, false.
+
+
+
+ Determines whether two specified have different values.
+
+ The first to compare.
+ The second to compare.
+ true if the value of is different to the value of ; otherwise, false.
+
+
+
+ Determines whether this instance and another specified object have the same values.
+
+ The string to compare to this instance.
+ true if the value of is the same as the value of this instance; otherwise, false.
+
+
+
+ Determines whether the specified and objects have the same values.
+
+ The to compare.
+ The to compare.
+ true if the value of is the same as the value of ; otherwise, false. If is null, the method returns false.
+
+
+
+ Determines whether the specified and objects have the same values.
+
+ The to compare.
+ The to compare.
+ true if the value of is the same as the value of ; otherwise, false. If is null, the method returns false.
+
+
+
+ Determines whether this instance and a specified , have the same value.
+
+ The to compare to this instance.
+ true if the value of is the same as this instance; otherwise, false. If is null, returns false.
+
+
+
+ Determines whether the specified string array and objects have the same values.
+
+ The string array to compare.
+ The to compare.
+ true if the value of is the same as the value of ; otherwise, false.
+
+
+
+ Determines whether the specified and string array objects have the same values.
+
+ The to compare.
+ The string array to compare.
+ true if the value of is the same as the value of ; otherwise, false.
+
+
+
+ Determines whether this instance and a specified string array have the same values.
+
+ The string array to compare to this instance.
+ true if the value of is the same as this instance; otherwise, false.
+
+
+
+
+
+
+ Determines whether the specified and objects have different values.
+
+ The to compare.
+ The to compare.
+ true if the value of is different to the value of ; otherwise, false.
+
+
+
+
+
+
+ Determines whether the specified and objects have different values.
+
+ The to compare.
+ The to compare.
+ true if the value of is different to the value of ; otherwise, false.
+
+
+
+
+
+
+ Determines whether the specified and string array have different values.
+
+ The to compare.
+ The string array to compare.
+ true if the value of is different to the value of ; otherwise, false.
+
+
+
+
+
+
+ Determines whether the specified string array and have different values.
+
+ The string array to compare.
+ The to compare.
+ true if the value of is different to the value of ; otherwise, false.
+
+
+
+ Determines whether the specified and , which must be a
+ , , or array of , have the same value.
+
+ The to compare.
+ The to compare.
+ true if the object is equal to the ; otherwise, false.
+
+
+
+ Determines whether the specified and , which must be a
+ , , or array of , have different values.
+
+ The to compare.
+ The to compare.
+ true if the object is equal to the ; otherwise, false.
+
+
+
+ Determines whether the specified , which must be a
+ , , or array of , and specified , have the same value.
+
+ The to compare.
+ The to compare.
+ true if the object is equal to the ; otherwise, false.
+
+
+
+ Determines whether the specified and object have the same values.
+
+ The to compare.
+ The to compare.
+ true if the object is equal to the ; otherwise, false.
+
+
+
+ Determines whether this instance and a specified object have the same value.
+
+ An object to compare with this object.
+ true if the current object is equal to ; otherwise, false.
+
+
+
+ Returns a hash code for this instance.
+
+
+ A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
+
+
+
+
+ Enumerates the string values of a .
+
+
+
+
+ Instantiates an using a .
+
+ The to enumerate.
+
+
+
+ Advances the enumerator to the next element of the .
+
+ if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the .
+
+
+
+ Gets the element at the current position of the enumerator.
+
+
+
+
+ Releases all resources used by the .
+
+
+
+
+ Registers for a callback that will be invoked when the entry has changed.
+ MUST be set before the callback is invoked.
+
+ The callback to invoke.
+ State to be passed into the callback.
+ The to invoke the callback with.
+ The action to execute when an is thrown. Should be used to set the IChangeToken's ActiveChangeCallbacks property to false.
+ The state to be passed into the action.
+ The registration.
+
+
+ Offset and length are out of bounds for the string or length is greater than the number of characters from index to the end of the string.
+
+
+ Offset and length are out of bounds for this StringSegment or length is greater than the number of characters to the end of this StringSegment.
+
+
+ Cannot change capacity after write started.
+
+
+ Not enough capacity to write '{0}' characters, only '{1}' left.
+
+
+ Entire reserved capacity was not used. Capacity: '{0}', written '{1}'.
+
+
+
diff --git a/Jvw.DevToys.SemverCalculator/Pack/Semver.pdb b/Jvw.DevToys.SemverCalculator/Pack/Semver.pdb
index 870c186..ac656f2 100644
Binary files a/Jvw.DevToys.SemverCalculator/Pack/Semver.pdb and b/Jvw.DevToys.SemverCalculator/Pack/Semver.pdb differ
diff --git a/Jvw.DevToys.SemverCalculator/Pack/Semver.xml b/Jvw.DevToys.SemverCalculator/Pack/Semver.xml
index b0d82dd..2807fe9 100644
--- a/Jvw.DevToys.SemverCalculator/Pack/Semver.xml
+++ b/Jvw.DevToys.SemverCalculator/Pack/Semver.xml
@@ -18,7 +18,7 @@
Compare by the left bound and then by the reversed
- right bound. Thus wider ranges sort before narrower ones. Finally, sort ranges including
+ right bound. Thus, wider ranges sort before narrower ones. Finally, sort ranges including
prerelease before those not including prerelease.
This order is important to the removal of fully contained ranges from
@@ -41,10 +41,6 @@
with a value. However, the
namespace types do not accept and will not return such a
.
-
- Invalid metadata identifiers including arbitrary Unicode characters and empty string can
- currently be produced by the
- constructor. Such identifiers are compared via an ordinal string comparision.
@@ -54,14 +50,6 @@
The string value of this metadata identifier or if this is
a default .
-
-
- Construct a potentially invalid .
-
- The parameter is .
- This should only be used by the constructor that
- still accepts illegal values.
-
Constructs a without checking that any of the invariants
@@ -102,12 +90,12 @@
Determines whether two identifiers are equal.
- if is equal to the this identifier;
+ if is equal to this identifier;
otherwise .
Determines whether the given object is equal to this identifier.
- if is equal to the this identifier;
+ if is equal to this identifier;
otherwise .
@@ -156,7 +144,7 @@
Identifiers are compared lexically in ASCII sort order. Invalid identifiers are
- compared via an ordinal string comparision.
+ compared via an ordinal string comparison.
@@ -188,7 +176,7 @@
is not a .
Identifiers are compared lexically in ASCII sort order. Invalid identifiers are
- compared via an ordinal string comparision.
+ compared via an ordinal string comparison.
@@ -204,38 +192,30 @@
The string value of this identifier or if this is
a default
-
+
Parse optional spaces from the beginning of the segment.
-
+
Parse optional whitespace from the beginning of the segment.
-
+
Parse a version number from the beginning of the segment.
-
-
- Parse a comparison from the beginning of the segment.
-
-
- Must have leading whitespace removed. Will consume trailing whitespace.
-
- When applying caret, tilde, or wildcards to versions already at
- there are ranges that would be equivalent to being able to
- increment beyond max value. However, for simplicity, this is treated as an error instead.
- This also makes sense given that these ranges would logically include versions valid
- according to the spec that can't be represented by this library due to the limitations
- of . Finally, if these equivalent ranges were supported they would also
- need special case handling in the method.
-
+
+
+ Parse a comparison from the beginning of the segment.
+
+
+ Must have leading whitespace removed. Will consume trailing whitespace.
+
-
+
The greater than operator taking into account the wildcard.
@@ -265,7 +245,7 @@
This does not validate the or
parameter values. That must be done in the calling method.
-
+
An internal method that is used when parsing versions from ranges. Because this is
called by both
@@ -321,21 +301,13 @@
Compatible with version. Allows minor and patch updates.
-
-
- Parse a comparison from the beginning of the segment.
-
-
- Must have leading whitespace removed. Will consume trailing whitespace.
-
- When applying caret, tilde, or wildcards to versions already at
- there are ranges that would be equivalent to being able to
- increment beyond max value. However, for simplicity, this is treated as an error instead.
- This also makes sense given that these ranges would logically include versions valid
- according to the spec that can't be represented by this library due to the limitations
- of . Finally, if these equivalent ranges were supported they would also
- need special case handling in the method.
-
+
+
+ Parse a comparison from the beginning of the segment.
+
+
+ Must have leading whitespace removed. Will consume trailing whitespace.
+
@@ -367,15 +339,6 @@
with a value. However, the
namespace types do not accept and will not return such a
.
-
- Invalid prerelease identifiers including arbitrary Unicode characters, empty string,
- and numeric identifiers with leading zero can currently be produced by the
- constructor and the obsolete
- and
- methods. Such alphanumeric
- identifiers are compared via an ordinal string comparision. Numeric identifiers with
- leading zeros are considered equal (e.g. '15' is equal to '015').
-
@@ -397,15 +360,7 @@
otherwise .
The numeric value of a prerelease identifier will never be negative.
-
-
- Construct a potentially invalid .
-
- The parameter is .
- This should be used only by the constructor that
- still accepts illegal values.
-
-
+
Construct a without checking that any of the invariants
hold. Used by the parser for performance.
@@ -415,9 +370,9 @@
constructors are visible to the package users. So they see a class consistently
using constructors without any create methods.
-
+
- Private constructor used by .
+ Private constructor used by .
@@ -432,7 +387,6 @@
The is empty or contains invalid characters
(i.e. characters that are not ASCII alphanumerics or hyphens) or has leading zeros for
a numeric identifier when is .
- The numeric identifier value is too large for .
Because a valid numeric identifier does not have leading zeros, this constructor
will never create a with leading zeros even if
is . Any leading zeros will
@@ -448,7 +402,7 @@
parameter name.
-
+
Construct a valid numeric from an integer value.
@@ -459,14 +413,14 @@
Determines whether two identifiers are equal.
- if is equal to the this identifier;
+ if is equal to this identifier;
otherwise .
Numeric identifiers with leading zeros are considered equal (e.g. '15'
is equal to '015').
Determines whether the given object is equal to this identifier.
- if is equal to the this identifier;
+ if is equal to this identifier;
otherwise .
Numeric identifiers with leading zeros are considered equal (e.g. '15'
is equal to '015').
@@ -526,7 +480,7 @@
Numeric identifiers are compared numerically. Numeric identifiers with leading zeros are
considered equal (e.g. '15' is equal to '015'). Alphanumeric identifiers are
compared lexically in ASCII sort order. Invalid alphanumeric identifiers are
- compared via an ordinal string comparision.
+ compared via an ordinal string comparison.
@@ -561,7 +515,7 @@
Numeric identifiers are compared numerically. Numeric identifiers with leading zeros are
considered equal (e.g. '15' is equal to '015'). Alphanumeric identifiers are
compared lexically in ASCII sort order. Invalid alphanumeric identifiers are
- compared via an ordinal string comparision.
+ compared via an ordinal string comparison.
@@ -591,12 +545,13 @@
- A range of versions that is bounded only on the right. That is a range defined by some version
- x such that v < x or v <= x depending on whether it is inclusive.
- A right-bounded range forms the upper limit for a version range.
+ A range of versions that is bounded only on the right. That is a range defined by some
+ version x such that v < x or v <= x depending on whether it is
+ inclusive. A right-bounded range forms the upper limit for a version range.
An "unbounded" right-bounded range is represented by an inclusive upper bound of
- .
+ since there is no maximum . This requires
+ special checking for comparison.
@@ -625,38 +580,34 @@
The to populate with data.
The destination (see ) for this serialization.
-
+
Constructs a new instance of the class.
The major version number.
+ The version
+ number is negative.
-
+
Constructs a new instance of the class.
The major version number.
The minor version number.
+ The or
+ version number is negative.
-
+
Constructs a new instance of the class.
The major version number.
The minor version number.
The patch version number.
+ The ,
+ , or version number is negative.
-
-
- Constructs a new instance of the class.
-
- The major version number.
- The minor version number.
- The patch version number.
- The prerelease portion (e.g. "alpha.5").
- The build metadata (e.g. "nightly.232").
-
-
+
Constructs a new instance of the class.
@@ -665,11 +616,11 @@
The patch version number.
The prerelease identifiers.
The build metadata identifiers.
- A ,
+ The ,
, or version number is negative.
A prerelease or metadata identifier has the default value.
-
+
Constructs a new instance of the class.
@@ -678,17 +629,15 @@
The patch version number.
The prerelease identifiers.
The build metadata identifiers.
- A ,
+ The ,
, or version number is negative.
One of the prerelease or metadata identifiers is .
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier. Or, a metadata identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens).
- A numeric prerelease identifier value is too large
- for .
-
+
Create a new instance of the class. Parses prerelease
and metadata identifiers from dot separated strings. If parsing is not needed, use a
@@ -701,30 +650,15 @@
The build metadata (e.g. "nightly.232").
Allow leading zeros in numeric prerelease identifiers. Leading
zeros will be removed.
- A ,
+ The ,
, or version number is negative.
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier when is
. Or, a metadata identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens).
- A numeric prerelease identifier value is too large
- for .
-
-
-
- Constructs a new instance of the class from
- a .
-
- used to initialize
- the major, minor, and patch version numbers and the build metadata.
- The is null.
- Constructs a with the same major and
- minor version numbers. The patch version number will be the fourth component
- of the . The build meta data will contain the third component
- of the if it is greater than zero.
-
+
Construct a from its proper parts.
@@ -760,7 +694,8 @@
The equivalent .
The semantic version is a prerelease version
- or has build metadata or has a negative major, minor, or patch version number.
+ or has build metadata or has a major, minor, or patch version number greater than
+ .
A semantic version of the form major.minor.patch
is converted to a of the form
@@ -786,22 +721,6 @@
is .
The is invalid or not in a
format compliant with .
- A numeric part of is too
- large for an .
-
-
-
- Converts the string representation of a semantic version to its equivalent.
-
- The version string.
- If set to , minor and patch version are required;
- otherwise they are optional.
- The is .
- The has an invalid format.
- The is missing minor
- or patch version numbers when is .
- The major, minor, or patch version number is larger
- than .
@@ -821,91 +740,7 @@
is not a valid
value.
-
-
- Converts the string representation of a semantic version to its
- equivalent. The return value indicates whether the conversion succeeded.
-
- The version string.
- When this method returns, contains a instance equivalent
- to the version string passed in, if the version string was valid, or if the
- version string was invalid.
- If set to , minor and patch version numbers are required;
- otherwise they are optional.
- when an invalid version string is passed, otherwise .
-
-
-
- Compares two versions and indicates whether the first precedes, follows, or is
- equal to the other in the sort order. Note that sort order is more specific than precedence order.
-
-
- An integer that indicates whether precedes, follows, or
- is equal to in the sort order.
-
-
- Value
- Condition
-
- -
- Less than zero
- precedes in the sort order.
-
- -
- Zero
- is equal to .
-
- -
- Greater than zero
-
- follows in the sort order
- or is .
-
-
-
-
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Make a copy of the current instance with changed properties.
-
- The value to replace the major version number or
- to leave it unchanged.
- The value to replace the minor version number or
- to leave it unchanged.
- The value to replace the patch version number or
- to leave it unchanged.
- The value to replace the prerelease portion
- or to leave it unchanged.
- The value to replace the build metadata or
- to leave it unchanged.
- The new version with changed properties.
-
- The change method is intended to be called using named argument syntax, passing only
- those fields to be changed.
-
-
- To change only the patch version:
- var changedVersion = version.Change(patch: 4);
-
-
-
+
Creates a copy of the current instance with multiple changed properties. If changing only
one property use one of the more specific WithX() methods.
@@ -916,13 +751,11 @@
The value to replace the prerelease identifiers or to leave it unchanged.
The value to replace the build metadata identifiers or to leave it unchanged.
The new version with changed properties.
- A ,
+ The ,
, or version number is negative.
A prerelease or metadata identifier has the default value.
- A numeric prerelease identifier value is too large
- for .
- The method is intended to be called using named argument syntax, passing only
+ The method is intended to be called using named argument syntax, passing only
those fields to be changed.
@@ -930,10 +763,10 @@
var modifiedVersion = version.With(minor: 2, patch: 4);
-
+
Creates a copy of the current instance with multiple changed properties. Parses prerelease
- and metadata identifiers from dot separated strings. Use instead if
+ and metadata identifiers from dot separated strings. Use instead if
parsing is not needed. If changing only one property use one of the more specific
WithX() methods.
@@ -945,17 +778,15 @@
Allow leading zeros in numeric prerelease identifiers. Leading
zeros will be removed.
The new version with changed properties.
- A ,
+ The ,
, or version number is negative.
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier when is
. Or, a metadata identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens).
- A numeric prerelease identifier value is too large
- for .
- The method is intended to be called using named argument
+ The method is intended to be called using named argument
syntax, passing only those fields to be changed.
@@ -963,7 +794,7 @@
var modifiedVersion = version.WithParsedFrom(patch: 4, prerelease: "alpha.5");
-
+
Creates a copy of the current instance with a different major version number.
@@ -971,7 +802,7 @@
The new version with the different major version number.
is negative.
-
+
Creates a copy of the current instance with a different minor version number.
@@ -979,7 +810,7 @@
The new version with the different minor version number.
is negative.
-
+
Creates a copy of the current instance with a different patch version number.
@@ -1000,8 +831,6 @@
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier when is .
- A numeric prerelease identifier value is too large
- for .
Because a valid numeric identifier does not have leading zeros, this constructor
will never create a with leading zeros even if
is . Any leading zeros will
@@ -1022,8 +851,6 @@
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier.
- A numeric prerelease identifier value is too large
- for .
@@ -1036,8 +863,6 @@
A prerelease identifier is empty or contains invalid
characters (i.e. characters that are not ASCII alphanumerics or hyphens) or has leading
zeros for a numeric identifier.
- A numeric prerelease identifier value is too large
- for .
@@ -1224,21 +1049,6 @@
the and
properties are non-empty.
-
- The build metadata for this version.
-
- The build metadata for this version or empty string if there is no build metadata.
-
-
- The build metadata is a series of dot separated identifiers separated from the
- rest of the version number with a plus sign ('+'). Valid metadata identifiers are
- non-empty and consist of ASCII alphanumeric characters and hyphens ([0-9A-Za-z-]).
-
- The metadata does not affect precedence. Two version numbers differing only in
- build metadata have the same precedence. However, metadata does affect sort order. An
- otherwise identical version without metadata sorts before one that has metadata.
-
-
The build metadata for this version.
The build metadata for this version or empty string if there
@@ -1280,23 +1090,23 @@
Determines whether two semantic versions are equal.
if the two versions are equal, otherwise .
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not be equal.
Determines whether the given object is equal to this version.
- if is equal to the this version;
+ if is equal to this version;
otherwise .
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not be equal.
Determines whether two semantic versions are equal.
- if is equal to the this version;
+ if is equal to this version;
otherwise .
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not be equal.
@@ -1316,14 +1126,6 @@
if the version precedences are equal, otherwise
.
-
-
- Determines whether two semantic versions have the same precedence. Versions
- that differ only by build metadata have the same precedence.
-
- The semantic version to compare to.
- if the version precedences are equal.
-
Gets a hash code for this instance.
@@ -1332,7 +1134,7 @@
A hash code for this instance, suitable for use in hashing algorithms
and data structures like a hash table.
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not have the same hash code.
@@ -1340,7 +1142,7 @@
Determines whether two semantic versions are equal.
if the two versions are equal, otherwise .
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not be equal.
@@ -1348,7 +1150,7 @@
Determines whether two semantic versions are not equal.
if the two versions are not equal, otherwise .
- Two versions are equal if every part of the version numbers are equal. Thus two
+ Two versions are equal if every part of the version numbers are equal. Thus, two
versions with the same precedence may not be equal.
@@ -1583,238 +1385,6 @@
a shorter series if all the preceding identifiers are equal.
-
-
- Compares this version to an and indicates whether this instance
- precedes, follows, or is equal to the object in the sort order. Note that sort order
- is more specific than precedence order.
-
-
- An integer that indicates whether this instance precedes, follows, or is equal to
- the other in the sort order.
-
-
- Value
- Condition
-
- -
- Less than zero
- This instance precedes the other in the sort order.
-
- -
- Zero
- This instance is equal to the other.
-
- -
- Greater than zero
-
- This instance follows the other in the sort order
- or the other is .
-
-
-
-
- The is not a .
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions and indicates whether this instance precedes, follows, or is
- equal to the other in the sort order. Note that sort order is more specific than precedence order.
-
-
- An integer that indicates whether this instance precedes, follows, or is equal to
- the other in the sort order.
-
-
- Value
- Condition
-
- -
- Less than zero
- This instance precedes the other in the sort order.
-
- -
- Zero
- This instance is equal to the other.
-
- -
- Greater than zero
-
- This instance follows the other in the sort order
- or the other is .
-
-
-
-
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions and indicates whether this instance precedes, follows, or is in the same
- position as the other in the precedence order. Versions that differ only by build metadata
- have the same precedence.
-
-
- An integer that indicates whether this instance precedes, follows, or is in the same
- position as in the precedence order.
-
-
- Value
- Condition
-
- -
- Less than zero
- This instance precedes in the precedence order.
-
- -
- Zero
- This instance has the same precedence as .
-
- -
- Greater than zero
-
- This instance follows in the precedence order
- or is .
-
-
-
-
-
- Precedence order is determined by comparing the major, minor, patch, and prerelease
- portion in order from left to right. Versions that differ only by build metadata have the
- same precedence. The major, minor, and patch version numbers are compared numerically. A
- prerelease version precedes a release version.
-
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions by sort order. Note that sort order is more specific than precedence order.
-
- if follows
- in the sort order; otherwise .
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions by sort order. Note that sort order is more specific than precedence order.
-
- if follows or is equal to
- in the sort order; otherwise .
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions by sort order. Note that sort order is more specific than precedence order.
-
- if precedes
- in the sort order; otherwise .
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
-
-
- Compares two versions by sort order. Note that sort order is more specific than precedence order.
-
- if precedes or is equal to
- in the sort order; otherwise .
-
- Sort order is consistent with precedence order, but provides an order for versions
- with the same precedence. Sort order is determined by comparing the major, minor,
- patch, prerelease portion, and build metadata in order from left to right. The major,
- minor, and patch version numbers are compared numerically. A prerelease version precedes
- a release version.
- The prerelease portion is compared by comparing each prerelease identifier from
- left to right. Numeric prerelease identifiers precede alphanumeric identifiers. Numeric
- identifiers are compared numerically. Alphanumeric identifiers are compared lexically
- in ASCII sort order. A longer series of prerelease identifiers follows a shorter series
- if all the preceding identifiers are equal.
- Otherwise equal versions without build metadata precede those with metadata. The
- build metadata is compared by comparing each metadata identifier. Identifiers are
- compared lexically in ASCII sort order. A longer series of metadata identifiers follows
- a shorter series if all the preceding identifiers are equal.
-
-
Checks if this version satisfies the given predicate.
@@ -1865,8 +1435,6 @@
zero.
The is invalid or not in a
format compliant with .
- A numeric part of a version in
- is too large for an .
If checks against a range will be performed repeatedly, it is much more
efficient to parse the range into a once and use that
object to repeatedly check for containment.
@@ -1887,8 +1455,6 @@
zero.
The is invalid or not in a
format compliant with .
- A numeric part of a version in
- is too large for an .
If checks against a range will be performed repeatedly, it is much more
efficient to parse the range into a once and use that
object to repeatedly check for containment.
@@ -1910,8 +1476,6 @@
is less than
zero.
The is invalid.
- A numeric part of a version in
- is too large for an .
If checks against a range will be performed repeatedly, it is much more
efficient to parse the range into a once using
and use that object to
@@ -1932,23 +1496,11 @@
is less than
zero.
The is invalid.
- A numeric part of a version in
- is too large for an .
If checks against a range will be performed repeatedly, it is much more
efficient to parse the range into a once using
and use that object to
repeatedly check for containment.
-
-
- Implicit conversion from to .
-
- The semantic version.
- The object.
- The is .
- The version number has an invalid format.
- The major, minor, or patch version number is larger than .
-
A range of values. A range can have gaps in it and may include only
@@ -2132,8 +1684,6 @@
is .
The is invalid or not in a
format compliant with .
- A numeric part of a version in
- is too large for an .
@@ -2149,8 +1699,6 @@
is .
The is invalid or not in a
format compliant with the option.
- A numeric part of a version in
- is too large for an .
@@ -2200,11 +1748,9 @@
is less than zero.
is .
The is invalid.
- A numeric part of a version in
- is too large for an .
The npm "loose" option is not supported. The
method provides more control over
- parsing. However, it does not accept all of the npm syntax.
+ parsing. However, it does not accept all the npm syntax.
@@ -2218,11 +1764,9 @@
is less than zero.
is .
The is invalid.
- A numeric part of a version in
- is too large for an .
The npm "loose" option is not supported. The
method provides more control over
- parsing. However, it does not accept all of the npm syntax.
+ parsing. However, it does not accept all the npm syntax.
@@ -2241,7 +1785,7 @@
is less than zero.
The npm "loose" option is not supported. The
method
- provides more control over parsing. However, it does not accept all of the npm syntax.
+ provides more control over parsing. However, it does not accept all the npm syntax.
@@ -2258,7 +1802,7 @@
is less than zero.
The npm "loose" option is not supported. The
method
- provides more control over parsing. However, it does not accept all of the npm syntax.
+ provides more control over parsing. However, it does not accept all the npm syntax.
@@ -2297,7 +1841,7 @@
be possible for two ranges to match the same set of versions but be expressed in
different ways and so not be equal.
- if is equal to the this range;
+ if is equal to this range;
otherwise .
@@ -2306,7 +1850,7 @@
ranges, it may be possible for two ranges to match the same set of versions but be
expressed in different ways and so not be equal.
- if is equal to the this range;
+ if is equal to this range;
otherwise .
@@ -2532,9 +2076,7 @@
inclusive would be empty.
See https://en.wikipedia.org/wiki/Interval_(mathematics)#Classification_of_intervals
- Since all objects have a and
- , the only unique empty range is the one whose start is the max
- version and end is the minimum version.
+ Since there is no maximum version the only unique empty range is <0.0.0-0.
@@ -2663,9 +2205,11 @@
- The end, right limit, or maximum of this range. Cannot be null.
+ The end, right limit, or maximum of this range. Can be .
- The end, right limit, or maximum of this range. Cannot be null.
+ The end, right limit, or maximum of this range. Can be .
+ Ranges with no upper bound have an value
+ of .
@@ -2701,14 +2245,14 @@
Determines whether two version ranges are equal.
- if is equal to the this range;
+ if is equal to this range;
otherwise .
Determines whether the given object is equal to this range.
- if is equal to the this range;
+ if is equal to this range;
otherwise .
@@ -2769,14 +2313,6 @@
Is this character and ASCII alphabetic character or hyphen [A-Za-z-]
-
-
- Combine hash codes in a good way since System.HashCode isn't available.
-
- Algorithm based on HashHelpers previously used in the core CLR.
- https://github.com/dotnet/coreclr/blob/456afea9fbe721e57986a21eb3b4bb1c9c7e4c56/src/System.Private.CoreLib/shared/System/Numerics/Hashing/HashHelpers.cs
-
-
The class allows for the various conditional checks done only in
@@ -2788,7 +2324,7 @@
been reached.
#if DEBUG
- if(condition) throw new Exception("...");
+ if (condition) throw new Exception("...");
#endif
@@ -2808,24 +2344,10 @@
Compare two strings as they should be compared as identifiers.
- This enforces ordinal comparision. It also fixes a technically
- correct but odd thing where the comparision result can be a number
+ This enforces ordinal comparison. It also fixes a technically
+ correct but odd thing where the comparison result can be a number
other than -1, 0, or 1.
-
-
- The number of digits in a non-negative number. Returns 1 for all
- negative numbers. That is ok because we are using it to calculate
- string length for a for numbers that
- aren't supposed to be negative, but when they are it is just a little
- slower.
-
-
- This approach is based on https://stackoverflow.com/a/51099524/268898
- where the poster offers performance benchmarks showing this is the
- fastest way to get a number of digits.
-
-
Internal helper for efficiently creating empty read only lists
@@ -2866,12 +2388,7 @@
The standard method handles all zeros
by returning "". This efficiently handles the kind of trimming needed.
-
-
- An efficient representation of a section of a string
-
-
-
+
Trim leading zeros from a numeric string segment. If the segment consists of all zeros,
return "0".
@@ -2879,6 +2396,9 @@
The standard method handles all zeros
by returning "". This efficiently handles the kind of trimming needed.
+
+ An optimized split for splitting on a single char.
+
Used to clearly mark when a case should be unreachable and helps properly manage code coverage.
diff --git a/Jvw.DevToys.SemverCalculator/Services/NpmService.cs b/Jvw.DevToys.SemverCalculator/Services/NpmService.cs
index 83273c4..dd74aaa 100644
--- a/Jvw.DevToys.SemverCalculator/Services/NpmService.cs
+++ b/Jvw.DevToys.SemverCalculator/Services/NpmService.cs
@@ -105,7 +105,7 @@ public bool IsValidRange(string value)
/// Range value.
/// Parsed version range.
/// Whether value is valid range.
- private static bool TryParseRange(string value, out SemVersionRange versionRange)
+ private static bool TryParseRange(string value, out SemVersionRange? versionRange)
{
return SemVersionRange.TryParseNpm(value, true, out versionRange);
}