File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed
packages/optimizely-cms-sdk/src Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,12 @@ import { AnyProperty } from '../model/properties.js';
22import {
33 AnyContentType ,
44 MAIN_BASE_TYPES ,
5- MediaStringTypes ,
65 PermittedTypes ,
76} from '../model/contentTypes.js' ;
87import {
98 getContentType ,
109 getAllContentTypes ,
1110 getContentTypeByBaseType ,
12- getAllMediaTypeKeys ,
1311} from '../model/contentTypeRegistry.js' ;
1412import {
1513 getKeyName ,
@@ -129,15 +127,6 @@ function convertPropertyField(
129127 }
130128 extraFragments . push ( ...createFragment ( key , visited ) ) ;
131129 subfields . push ( `...${ key } ` ) ;
132-
133- // if the key name is one of the user defined media type we append the base type fragment
134- // eg: userDefinedImage (baseType:"image") -> _image
135- if ( getAllMediaTypeKeys ( ) . includes ( key ) ) {
136- const cc = getContentType ( key ) ;
137- if ( cc ) {
138- subfields . push ( `...${ cc . baseType . trim ( ) } ` ) ;
139- }
140- }
141130 }
142131
143132 const uniqueSubfields = [ '__typename' , ...new Set ( subfields ) ] . join ( ' ' ) ; // remove duplicates
Original file line number Diff line number Diff line change 1- import { isBaseMediaType } from '../util/baseTypeUtil.js' ;
21import { AnyContentType } from './contentTypes.js' ;
32
43let _registry : AnyContentType [ ] = [ ] ;
@@ -22,8 +21,3 @@ export function getAllContentTypes(): AnyContentType[] {
2221export function getContentTypeByBaseType ( name : string ) : AnyContentType [ ] {
2322 return _registry . filter ( ( c ) => c . baseType === name ) as AnyContentType [ ] ;
2423}
25-
26- /** Get the Component from a content type name */
27- export function getAllMediaTypeKeys ( ) {
28- return _registry . filter ( ( c ) => isBaseMediaType ( c . baseType ) ) . map ( ( c ) => c . key ) ;
29- }
You can’t perform that action at this time.
0 commit comments