base

Description

Pure JavaScript stuff. Nothing here should be WEB API aware, except Logger's use of console and uuId's use of crypto.

Depends on:

Details

74

Classes


new Dispatcher( ...eventTypes )


new MessageQueue()


new NumberOp( value )


new FactoryTypeError()


new DefaultMap( factory [, iterable ] )


new Logger( loggerName )


new Service( shortName )

Methods


<static> ensure( versions ) → {object}

Description

Ensures appropriate versions of NexusHoratio libraries are loaded.

Parameters
Name Type Description
versions Array.<NexusHoratio.base~Version>

Versions required.

Returns

Namespace with only ensured libraries present.

Throws

When requirements not met.

Details

<inner> runTests()

Description

Basic test runner.

This depends on Logger, hence the location in this file instead of NexusHoratio.xunit.

Details

<static> uuId( strBase ) → {string}

Description

Create a UUID-like string with a base.

Parameters
Name Type Description
strBase string

Base value for the string.

Returns

A unique string.

Details

<static> safeId( input ) → {string}

Description

Normalize a string to be safe to use as an HTML element id.

Parameters
Name Type Description
input string

The string to normalize.

Returns

Normalized string.

Details

<static> strHash( s ) → {string}

Description
Parameters
Name Type Description
s string

String to hash.

Returns

Hash value.

Details

<static> simpleParseWords( text ) → {Array.<string>}

Description

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
text string

Text to parse.

Returns

Parsed text.

Details

Type Definitions


Version

Properties
Name Type Attributes Default Description
name string

Library name.

minVersion number <optional>
0

Minimal version needed.

Details
object