mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-30 08:28:10 +00:00
Various bug fixes for URI format parsing
This commit is contained in:
1 parent
fc86f3e15d
commit
da44dc9cab
7 files changed
+68
-74
No files matched your search
@@ -13,4 +13,20 @@ function isIPv6(ip) {
|
||||
return IPV6_REGEX.test(ip);
|
||||
}
|
||||
|
||||
export { isIPv4, isIPv6 };
|
||||
function isNotBlank(str) {
|
||||
return typeof str === 'string' && str.trim().length > 0;
|
||||
}
|
||||
|
||||
function getIfNotBlank(str, defaultValue) {
|
||||
return isNotBlank(str) ? str : defaultValue;
|
||||
}
|
||||
|
||||
function isPresent(obj) {
|
||||
return typeof obj !== 'undefined' && obj !== null;
|
||||
}
|
||||
|
||||
function getIfPresent(obj, defaultValue) {
|
||||
return isPresent(obj) ? obj : defaultValue;
|
||||
}
|
||||
|
||||
export { isIPv4, isIPv6, isNotBlank, getIfNotBlank, isPresent, getIfPresent };
|
||||
Reference in new issue
Block a user