Pure
JavaScript
stuff. Nothing here should be WEB
API aware, except
Logger's use of console (and apparently crypto).
- Version:
- 73
Classes
Members
-
static, constant Code :number
-
Mapping of Google's Canonical Error Codes.
Properties:
Name Type Description OKnumber CANCELLEDnumber INVALID_ARGUMENTnumber DEADLINE_EXCEEDEDnumber NOT_FOUNDnumber ALREADY_EXISTSnumber PERMISSION_DENIEDnumber UNAUTHENTICATEDnumber RESOURCE_EXHAUSTEDnumber FAILED_PRECONDITIONnumber ABORTEDnumber OUT_OF_RANGEnumber UNIMPLEMENTEDnumber INTERNALnumber UNAVAILABLEnumber DATA_LOSSnumber -
static, constant LAST_ITEM :number
-
Identify the last item in a collection like
at(-1). -
static, constant NOT_FOUND :number
-
Returned by some APIs like
findIndex(). -
static, constant ONE_ITEM :number
-
Useful for testing length of an array.
-
static, constant version :number
-
Bumped per release.
Methods
-
static ensure(versions) → {object}
-
Ensures appropriate versions of NexusHoratio libraries are loaded.
Parameters:
Name Type Description versionsArray.<module:base~Version> Versions required.
Throws:
-
When requirements not met.
- Type
- Error
Returns:
object -Namespace with only ensured libraries present.
-
-
static safeId(input) → {string}
-
Normalize a string to be safe to use as an HTML element id.
Parameters:
Name Type Description inputstring The string to normalize.
Returns:
string -Normalized string.
-
static sha256(string) → {string}
-
Parameters:
Name Type Description stringstring String to hash.
Returns:
string -Hex digest of the string.
- Deprecated:
- Compute the SHA-256 digest of a string.
-
static simpleParseWords(text) → {Array.<string>}
-
Separate a string of concatenated words along transitions.
Transitions are: lower to upper (lowerUpper -> lower Upper) grouped upper to lower (ABCd -> AB Cd) underscores (snake_case -> snake case) spaces character/numbers (lower2Upper -> lower 2 Upper) Likely only works with ASCII. Empty strings return an empty array. Extra separators are consolidated.
Parameters:
Name Type Description textstring Text to parse.
Returns:
Array.<string> -Parsed text.
-
static strHash(s) → {string}
-
Jenkins one at a time hash.
https://en.wikipedia.org/wiki/Jenkins_hash_function#one_at_a_time
Parameters:
Name Type Description sstring String to hash.
Returns:
string -Hash value.
-
static uuId(strBase) → {string}
-
Create a UUID-like string with a base.
Parameters:
Name Type Description strBasestring Base value for the string.
Returns:
string -A unique string.
-
inner runTests()
-
Basic test runner.
This depends on
Logger, hence the location in this file instead ofmodule:xunit.
Type Definitions
-
Version
-
Properties:
Name Type Attributes Default Description namestring Library name.
minVersionnumber <optional>
0 Minimal version needed.