Files
shields/gh-badges/lib/index.js
T
chris48sandGitHub 829971f0ef Fix BadgeFactory.create() docblock (#3506)
* fix docblock

* add a reminder in make-badge.js
2019-05-30 12:28:17 +01:00

37 lines
990 B
JavaScript

'use strict'
const makeBadge = require('./make-badge')
class BadgeFactory {
constructor(options) {
if (options !== undefined) {
console.error(
'BadgeFactory: Constructor options are deprecated and will be ignored'
)
}
}
/**
* Create a badge
*
* @param {object} format - Object specifying badge data
* @param {string[]} format.text
* @param {string} format.labelColor - label color
* @param {string} format.color - message color
* @param {string} format.colorA - deprecated: alias for `labelColor`
* @param {string} format.colorscheme - deprecated: alias for `color`
* @param {string} format.colorB - deprecated: alias for `color`
* @param {string} format.format
* @param {string} format.template
* @return {string} Badge in SVG or JSON format
* @see https://github.com/badges/shields/tree/master/gh-badges/README.md
*/
create(format) {
return makeBadge(format)
}
}
module.exports = {
BadgeFactory,
}