Refactor for activeIdentityToken (#631)
* Refactor for activeIdentityToken * Account selector stuff * Small refactor * Tweak * That's a wrap * comment * Lint fix * Localize * Lint fix * Close view on error * parse error when gathering tracking urls --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
4c94db2c03
commit
9e3da6b67d
31 files changed
+606
-413
No files matched your search
@@ -1,24 +1,23 @@
|
||||
namespace OptionUtils
|
||||
|
||||
function Get(opts as object, key as string, passthroughFunction = invalid as dynamic) as dynamic
|
||||
function Get(opts as object, key as string) as dynamic
|
||||
if opts = invalid
|
||||
if passthroughFunction = invalid
|
||||
return invalid
|
||||
end if
|
||||
return passthroughFunction(invalid)
|
||||
return invalid
|
||||
end if
|
||||
|
||||
return opts[key]
|
||||
end function
|
||||
|
||||
function GetOrDefault(opts as object, key as string, defaultValue as dynamic) as dynamic
|
||||
if opts = invalid or not opts.DoesExist(key)
|
||||
return defaultValue
|
||||
end if
|
||||
|
||||
value = opts[key]
|
||||
if value = invalid
|
||||
if passthroughFunction = invalid
|
||||
return invalid
|
||||
end if
|
||||
return passthroughFunction(invalid)
|
||||
return defaultValue
|
||||
end if
|
||||
|
||||
if passthroughFunction <> invalid
|
||||
return passthroughFunction(value)
|
||||
end if
|
||||
return value
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user