File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
packages/optimizely-cms-cli/src/utils Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1+ import { contentType } from '@optimizely/cms-sdk' ;
2+
3+ export const contentTypeWithRegexProperty = contentType ( {
4+ key : 'CT_with_asterisk' ,
5+ baseType : '_page' ,
6+ displayName : 'CT_with_asterisk' ,
7+ properties : { } ,
8+ mayContainTypes : [ '*' ] ,
9+ } ) ;
Original file line number Diff line number Diff line change 55 "private" : " true" ,
66 "main" : " index.js" ,
77 "scripts" : {
8- "test:manual" : " echo \" Error: no test specified \" && exit 1 "
8+ "test:manual" : " optimizely-cms-cli config push ./content-types.optimizely.config.mjs "
99 },
1010 "dependencies" : {
1111 "@optimizely/cms-sdk" : " workspace:*" ,
Original file line number Diff line number Diff line change @@ -25,8 +25,13 @@ export function parseChildContentType(
2525 const duplicates : string [ ] = [ ] ;
2626 const normalized = mayContainTypes . map ( ( entry : any ) => {
2727 const key = extractKeyName ( entry , parentKey ) ;
28- // Do not allow keys that start with '_' to be validated against allowedKeys
29- if ( ! key . startsWith ( '_' ) && allowedKeys && ! allowedKeys . has ( key ) ) {
28+ if (
29+ key !== '*' &&
30+ // Do not allow keys that start with '_' to be validated against allowedKeys
31+ ! key . startsWith ( '_' ) &&
32+ allowedKeys &&
33+ ! allowedKeys . has ( key )
34+ ) {
3035 invalid . push ( key ) ;
3136 }
3237 if ( seen . has ( key ) ) {
You can’t perform that action at this time.
0 commit comments