Version

Version

new Version(options)

Defines a Version.

Parameters:
Name Type Description
options Object | String
Source:

Extends

Members

build :String

Type:
  • String
Source:

major :String

Type:
  • String
Source:

minor :String

Type:
  • String
Source:

patch :String

Type:
  • String
Source:

prerelease :String

Type:
  • String
Source:

raw :String

The raw URL string. If Version#set is called with a string parameter, the string is saved here before parsing various Version components.

Type:
  • String
Source:

string :String

Type:
  • String
Source:

Methods

findInParents(property, customizeropt) → {*|undefined}

Tries to find the given property locally, and then proceeds to lookup in each parent, going up the chain as necessary. Lookup will continue until customizer returns a truthy value. If used without a customizer, the lookup will stop at the first parent that contains the property.

Parameters:
Name Type Attributes Description
property String
customizer function <optional>
Inherited From:
Source:
Returns:
Type
* | undefined

forEachParent(optionsopt, iterator)

Invokes the given iterator for every parent in the parent chain of the given element.

Parameters:
Name Type Attributes Default Description
options Object | Boolean <optional>
{}

A set of options for the parent chain traversal.

Properties
Name Type Attributes Default Description
withRoot Boolean <optional>
<nullable>
false

Set to true to include the collection object as well.

iterator function

The function to call for every parent in the ancestry chain.

Inherited From:
Source:
To Do:
  • Cache the results

meta() → {*}

Returns the meta keys associated with the property

Inherited From:
Source:
Returns:
Type
*

parent() → {*|undefined}

Returns the parent of item

Inherited From:
Source:
Returns:
Type
* | undefined

set(value)

Set the version value as string or object with separate components of version

Parameters:
Name Type Description
value object | string
Source:

toJSON()

Returns the JSON representation of a property, which conforms to the way it is defined in a collection. You can use this method to get the instantaneous representation of any property, including a Collection.

Inherited From:
Source: