Common functions and utilities for tasks related to license badges.
- Source:
Members
(inner, constant) licenseToColorMap :object
Mapping of licenses to their corresponding color and priority.
Type:
- object
- Source:
Methods
(inner) licenseToColor(licenses) → {string}
Maps the license to its corresponding color and priority and sorts the list of mapped licenses by priority.
Parameters:
Name | Type | Description |
---|---|---|
licenses |
string | Array.<string> | License or list of licenses |
- Source:
Returns:
Color corresponding to the license or the list of licenses
- Type
- string
(inner) renderLicenseBadge(attrs) → {object}
Handles rendering concerns of license badges. Determines the message of the badge by joining the licenses in a comma-separated format. Sets the badge color to the provided value, if not provided then the color is used from licenseToColorMap.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attrs |
object | Refer to individual attributes Properties
|
- Source:
Returns:
Badge with message and color properties
- Type
- object