diff options
Diffstat (limited to 'lua/mason-core/purl.lua')
| -rw-r--r-- | lua/mason-core/purl.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/mason-core/purl.lua b/lua/mason-core/purl.lua index 6bda134f..65acbdd1 100644 --- a/lua/mason-core/purl.lua +++ b/lua/mason-core/purl.lua @@ -16,7 +16,7 @@ local function percent_encode(char) return ("%%%x"):format(string.byte(char, 1, 1)) end -local decode_percent_encoding = _.gsub("%%([A-F0-9][A-F0-9])", _.compose(string.char, parse_hex)) +local decode_percent_encoding = _.gsub("%%([A-Fa-f0-9][A-Fa-f0-9])", _.compose(string.char, parse_hex)) local encode_percent_encoding = _.gsub("[!#$&'%(%)%*%+;=%?@%[%] ]", percent_encode) local function validate_conan(purl) @@ -162,6 +162,11 @@ local github = _.evolve { namespace = _.to_lower, } +local composer = _.evolve { + name = _.to_lower, + namespace = _.to_lower, +} + local is_mlflow_azuredatabricks = _.all_pass { _.prop_eq("type", "mlflow"), _.path_satisfies(_.matches "^https?://.*azuredatabricks%.net", { "qualifiers", "repository_url" }), @@ -176,6 +181,7 @@ local type_validations = _.cond { local type_transforms = _.cond { { _.prop_eq("type", "bitbucket"), bitbucket }, + { _.prop_eq("type", "composer"), composer }, { _.prop_eq("type", "github"), github }, { _.prop_eq("type", "pypi"), pypi }, { _.prop_eq("type", "huggingface"), huggingface }, |
