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:

committed by
GitHub

parent
56a60629e1
commit
079b0a4f50
@@ -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
|
||||
|
Reference in New Issue
Block a user