Skip to content

Commit

Permalink
fix: Circumvent zealous code optimisations in manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidnioulz committed Nov 6, 2024
1 parent ff15ac3 commit 72e9379
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/defaultConfig.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { getTagSuffix } from './utils/tag'
import type { TagBadgeParameters } from './types/TagBadgeParameters'

function upperFirst(str: string): string {
return str[0].toUpperCase() + str.slice(1)
}

export const defaultConfig: TagBadgeParameters = [
{
display: {
Expand All @@ -22,6 +17,9 @@ export const defaultConfig: TagBadgeParameters = [
{
tags: ['alpha', 'beta', 'rc', 'experimental'],
badge: ({ tag }) => {
const upperFirst = (str: string): string =>
str[0].toUpperCase() + str.slice(1)

return {
text: tag === 'rc' ? 'Release candidate' : upperFirst(tag),
bgColor: 'hsl(257, 100%, 84%)',
Expand Down Expand Up @@ -70,7 +68,7 @@ export const defaultConfig: TagBadgeParameters = [
tags: {
prefix: 'version',
},
badge: ({ tag }) => {
badge: ({ getTagSuffix, tag }) => {
const version = getTagSuffix(tag)
const isExperimental = version?.startsWith('0')
const hue = isExperimental ? 66 : 194
Expand Down

0 comments on commit 72e9379

Please sign in to comment.