fix: is_protocol() not returning a boolean (#180)

Returning a string instead of a boolean is fine in most cases,
but if the result gets compared against a boolean this breaks things.
This commit is contained in:
christoph-heinrich
2022-09-13 11:12:20 +02:00
committed by GitHub
parent 56a60629e1
commit 079b0a4f50

View File

@@ -778,7 +778,7 @@ end
-- Check if path is a protocol, such as `http://...`
---@param path string
function is_protocol(path)
return type(path) == 'string' and path:match('^%a[%a%d-_]+://')
return type(path) == 'string' and path:match('^%a[%a%d-_]+://') ~= nil
end
---@param path string