Unify remaining service order and enforce (#3359)

Ref #3353
This commit is contained in:
Paul Melnikow
2019-04-24 16:53:33 -04:00
committed by GitHub
parent f8aeb56129
commit 0088a9d0da
38 changed files with 665 additions and 665 deletions

View File

@@ -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}` : ''