@@ -17,13 +17,6 @@ module.exports = class Bundlephobia extends BaseJsonService {
|
||||
return 'size'
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'bundlephobia',
|
||||
color: 'informational',
|
||||
}
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'bundlephobia',
|
||||
@@ -31,14 +24,6 @@ module.exports = class Bundlephobia extends BaseJsonService {
|
||||
}
|
||||
}
|
||||
|
||||
static render({ format, size }) {
|
||||
const label = format === 'min' ? 'minified size' : 'minzipped size'
|
||||
return {
|
||||
label,
|
||||
message: prettyBytes(size),
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
@@ -88,6 +73,21 @@ module.exports = class Bundlephobia extends BaseJsonService {
|
||||
]
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'bundlephobia',
|
||||
color: 'informational',
|
||||
}
|
||||
}
|
||||
|
||||
static render({ format, size }) {
|
||||
const label = format === 'min' ? 'minified size' : 'minzipped size'
|
||||
return {
|
||||
label,
|
||||
message: prettyBytes(size),
|
||||
}
|
||||
}
|
||||
|
||||
async fetch({ scope, packageName, version }) {
|
||||
const packageQuery = `${scope ? `${scope}/` : ''}${packageName}${
|
||||
version ? `@${version}` : ''
|
||||
|
||||
Reference in New Issue
Block a user