File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ const TS4TIBResponse = z.object({
10
10
} )
11
11
} )
12
12
13
+ const SPDX_LICENSE_REGEX = / h t t p s : \/ \/ s p d x \. o r g \/ l i c e n s e s \/ ( .* ) \. j s o n /
14
+
13
15
export class TempResolver {
14
16
async resolvePurl ( url : string ) {
15
17
try {
@@ -30,9 +32,8 @@ export class TempResolver {
30
32
31
33
async resolveSpdx ( url : string ) {
32
34
try {
33
- const result = await fetch ( url )
34
- const data = await result . json ( )
35
- console . log ( data )
35
+ const match = SPDX_LICENSE_REGEX . exec ( url )
36
+ return match ? match [ 1 ] : null
36
37
} catch ( e ) {
37
38
console . error ( e )
38
39
return url
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ export const GenericResultRenderer: Story = {
185
185
{
186
186
icon : < ScaleIcon className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
187
187
field : "licenseURL" ,
188
- singleValueMapper : ( v ) => tryURLPrettyPrint ( v ) ,
188
+ singleValueMapper : ( v ) => < PidDisplay pid = { v } /> ,
189
189
label : "License URL"
190
190
} ,
191
191
{
You can’t perform that action at this time.
0 commit comments