File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -251,11 +251,11 @@ export function generateCollectionTableDefinition(collection: ResolvedCollection
251
251
// Handle default values
252
252
if ( 'default' in property ) {
253
253
let defaultValue = typeof property . default === 'string'
254
- ? `' ${ property . default } '`
254
+ ? wrapWithSingleQuote ( property . default )
255
255
: property . default
256
256
257
257
if ( ! ( defaultValue instanceof Date ) && typeof defaultValue === 'object' ) {
258
- defaultValue = `' ${ JSON . stringify ( defaultValue ) } '`
258
+ defaultValue = wrapWithSingleQuote ( JSON . stringify ( defaultValue ) )
259
259
}
260
260
constraints . push ( `DEFAULT ${ defaultValue } ` )
261
261
}
@@ -274,3 +274,13 @@ export function generateCollectionTableDefinition(collection: ResolvedCollection
274
274
275
275
return definition
276
276
}
277
+
278
+ function wrapWithSingleQuote ( value : string ) {
279
+ if ( value . startsWith ( '`' ) && value . endsWith ( '`' ) ) {
280
+ value = value . slice ( 1 , - 1 )
281
+ }
282
+ if ( value . startsWith ( '\'' ) && value . endsWith ( '\'' ) ) {
283
+ return value
284
+ }
285
+ return `'${ value } '`
286
+ }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export function replaceComponentSchemas<T = Draft07Definition | Draft07Definitio
120
120
const nuxt = useNuxt ( )
121
121
let path = String ( $content ?. inherit )
122
122
try {
123
- path = resolveModule ( path )
123
+ path = resolveModule ( path , { paths : [ nuxt . options . rootDir ] } )
124
124
}
125
125
catch {
126
126
// Ignore error
You can’t perform that action at this time.
0 commit comments