@@ -35,6 +35,7 @@ const idArray = require('../utils/restrictedKeyWords');
3535 * // Outputs: 'prefix_my_special_id'
3636 */
3737const uidCorrector = ( uid , prefix ) => {
38+ console . log ( 'uidCorrector' , uid , prefix ) ;
3839 let newId = uid ;
3940 if ( idArray . includes ( uid ) ) {
4041 newId = uid . replace ( uid , `${ prefix } _${ uid } ` ) ;
@@ -62,7 +63,8 @@ const uidCorrector = (uid, prefix) => {
6263 *
6364 * // Outputs: an array of content type objects, each containing metadata and field mappings.
6465 */
65- const createInitialMapper = async ( ) => {
66+ const createInitialMapper = async ( affix = "" ) => {
67+ console . log ( 'Creating initial mapper for content types...' , config , affix ) ;
6668 try {
6769 const initialMapper = [ ] ;
6870 const files = await fs . readdir (
@@ -82,7 +84,7 @@ const createInitialMapper = async () => {
8284 otherCmsTitle : title ,
8385 otherCmsUid : data [ 0 ] ?. contentfulID ,
8486 contentstackTitle : title . charAt ( 0 ) . toUpperCase ( ) + title . slice ( 1 ) ,
85- contentstackUid : uidCorrector ( data [ 0 ] ?. contentUid ) ,
87+ contentstackUid : uidCorrector ( data [ 0 ] ?. contentUid , affix ) ,
8688 type : 'content_type' ,
8789 fieldMapping : [ ]
8890 } ;
0 commit comments