File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { basename } from 'path'
2
2
3
- const modules = import . meta. glob ( " ./*.json" , { eager : true , import : 'default' } )
3
+ const modules = import . meta. glob ( ' ./*.json' , { eager : true , import : 'default' } )
4
4
5
5
export default Object . fromEntries ( Object . entries ( modules ) . map ( ( [ path , module ] ) => {
6
6
return [ basename ( path , '.json' ) , module ]
Original file line number Diff line number Diff line change 1
1
const modules = import . meta. glob ( './*.json' , { eager : true , import : 'default' } )
2
2
const schemas = Object . fromEntries ( Object . entries ( modules ) . map ( ( [ path , module ] ) => {
3
- const name = path . split ( '/' ) . pop ( ) . split ( '.' ) . shift ( ) ;
4
- return [ name == 'schema' ? 'default' : name , module ] ;
5
- } ) ) ;
3
+ const name = path . split ( '/' ) . pop ( ) . split ( '.' ) . shift ( )
4
+ return [ name === 'schema' ? 'default' : name , module ]
5
+ } ) )
6
6
7
- export default schemas ;
7
+ export default schemas
You can’t perform that action at this time.
0 commit comments