-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reference: #22688 To support sorting a list of strings in ascending semantic versioning order using the pre-existing 'blang/semver' package dependency.
- Loading branch information
Showing
6 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: "functions" | ||
page_title: "sortsemver - Functions - Configuration Language" | ||
sidebar_current: "docs-funcs-collection-sortsemver" | ||
description: |- | ||
The sortsemver function takes a list of strings and returns a new list with | ||
those strings sorted in semantic versioning order. | ||
--- | ||
|
||
# `sortsemver` Function | ||
|
||
-> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and | ||
earlier, see | ||
[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). | ||
|
||
`sortsemver` takes a list of strings and returns a new list with | ||
those strings sorted in semantic versioning order. A valid string version is | ||
described by the v2.0.0 specification found at https://semver.org/. | ||
|
||
## Examples | ||
|
||
``` | ||
> sortsemver(["1.0.0", "1.2.4", "1.4.0-5", "1.2.3"]) | ||
[ | ||
"1.0.0", | ||
"1.2.3", | ||
"1.2.4", | ||
"1.4.0-5", | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters