Global

Methods

createNumRequestCounter(attrs) → {object}

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Description
category string

e.g: 'build'

serviceFamily string

e.g: 'npm'

name string

e.g: 'NpmVersion'

Source:
Returns:

{ inc() {} }.

Type
object

getColor(attrs) → {string}

Return color for active, maintenance and archived statuses, which were the three example keywords used in Netflix's open-source meetup. See https://slideshare.net/aspyker/netflix-open-source-meetup-season-4-episode-1 Other keywords are possible, but will appear in grey.

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Description
status string

Specifies the current maintenance status

Source:
Returns:

color

Type
string

isMetricWithPattern(nestedRegexp) → {function}

Parameters:
Name Type Description
nestedRegexp RegExp

Pattern that must appear after the metric.

Source:
Returns:

A function that returns a RegExp that matches a metric followed by another pattern.

Type
function

module:services/dynamic/json-path(superclass) → {function}

Dynamic service class factory which wraps module:core/base-service/base~BaseService with support of JSONPath.

Parameters:
Name Type Description
superclass function

class to extend

Source:
Returns:

wrapped class

Type
function

render(translatedPercent) → {object}

Takes a percentage and maps it to a message and color.

The colors are determined based on how Weblate does it internally. Weblate on GitHub

Parameters:
Name Type Description
translatedPercent *

The percentage of translations translated.

Source:
Returns:

Format for the badge.

Type
object

validateAffiliations(value, helpers) → {string}

Validates affiliations should contain combination of allowed values in any order.

Parameters:
Name Type Description
value string

affiliation current value

helpers *

object to construct custom error

Source:
Returns:

valiadtion error or value unchanged

Type
string