Skip to content

Commit 9e13ef6

Browse files
committed
chore: pkl types for port numbers
Signed-off-by: Sam Gammon <[email protected]>
1 parent 7e87255 commit 9e13ef6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/tooling/src/main/pkl/Base.pkl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ typealias BinName = String
4747
typealias Purl = String(matches(
4848
Regex(#"^pkg:[a-zA-Z][a-zA-Z0-9+.-]*\/[a-zA-Z0-9._-]+(?:@[a-zA-Z0-9._-]+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$"#)
4949
))
50+
51+
/// Represents a port number.
52+
typealias PortNumber = Int(isBetween(1, 65535))
53+
54+
/// Represents a non-root port number.
55+
typealias NonRootPortNumber = Int(isBetween(1024, 65535))

0 commit comments

Comments
 (0)