11<script setup lang="ts">
2- import { parseLicenseExpression } from " #shared/utils/spdx" ;
2+ import { parseLicenseExpression } from ' #shared/utils/spdx'
33
4- import { useLicenseChanges } from " ~/composables/useLicenseChanges" ;
5- import { useI18n } from " vue-i18n" ;
4+ import { useLicenseChanges } from ' ~/composables/useLicenseChanges'
5+ import { useI18n } from ' vue-i18n'
66
77const props = defineProps <{
8- license: string ;
9- packageName? : string ;
10- }>();
8+ license: string
9+ packageName? : string
10+ }>()
1111
12- const { t } = useI18n ();
12+ const { t } = useI18n ()
1313
14- const tokens = computed (() => parseLicenseExpression (props .license ));
15- const licenseChanges = useLicenseChanges (() => props .packageName );
14+ const tokens = computed (() => parseLicenseExpression (props .license ))
15+ const licenseChanges = useLicenseChanges (() => props .packageName )
1616
17- const changes = computed (() => licenseChanges .data .value ?.changes ?? []);
17+ const changes = computed (() => licenseChanges .data .value ?.changes ?? [])
1818
1919const licenseChangeText = computed (() =>
2020 changes .value
21- .map (( item ) =>
22- t (" package.versions.license_change_item" , {
21+ .map (item =>
22+ t (' package.versions.license_change_item' , {
2323 from: item .from ,
2424 to: item .to ,
2525 version: item .version ,
2626 }),
2727 )
28- .join (" ; " ),
29- );
28+ .join (' ; ' ),
29+ )
3030
31- const hasAnyValidLicense = computed (() =>
32- tokens .value .some ((t ) => t .type === " license" && t .url ),
33- );
31+ const hasAnyValidLicense = computed (() => tokens .value .some (t => t .type === ' license' && t .url ))
3432 </script >
3533
3634<template >
@@ -47,9 +45,7 @@ const hasAnyValidLicense = computed(() =>
4745 {{ token.value }}
4846 </a >
4947 <span v-else-if =" token.type === 'license'" >{{ token.value }}</span >
50- <span v-else-if =" token.type === 'operator'" class =" text-4xs" >{{
51- token.value
52- }}</span >
48+ <span v-else-if =" token.type === 'operator'" class =" text-4xs" >{{ token.value }}</span >
5349 </template >
5450 <span
5551 v-if =" hasAnyValidLicense"
0 commit comments