File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
packages/schema-org/createSchemaOrg Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -29,18 +29,21 @@ export const createSchemaOrg = (options: CreateSchemaOrgInput) => {
29
29
// eslint-disable-next-line no-console
30
30
let warn : ConsolaFn | ( ( ...arg : any ) => void ) = ( ...arg : any ) => { console . warn ( ...arg ) }
31
31
// opt-in to consola if available
32
- try {
33
- import ( 'consola' ) . then ( ( consola ) => {
34
- const logger = consola . default . withScope ( '@vueuse/schema-org' )
35
- if ( options . debug ) {
36
- logger . level = 4
37
- debug = logger . debug
38
- }
39
- warn = logger . warn
40
- } ) . catch ( )
32
+ if ( options . debug ) {
33
+ try {
34
+ import ( 'consola' ) . then ( ( consola ) => {
35
+ const logger = consola . default . withScope ( '@vueuse/schema-org' )
36
+ if ( options . debug ) {
37
+ logger . level = 4
38
+ debug = logger . debug
39
+ }
40
+ warn = logger . warn
41
+ } ) . catch ( )
42
+ }
43
+ // if consola is missing it's not a problem
44
+ catch ( e ) {
45
+ }
41
46
}
42
- // if consola is missing it's not a problem
43
- catch ( e ) { }
44
47
45
48
if ( ! options . provider ?. useRoute )
46
49
warn ( 'Missing useRoute implementation. Provide a `useRoute` handler, usually from `vue-router`.' )
You can’t perform that action at this time.
0 commit comments