@@ -85,22 +85,23 @@ export default {
8585 } else if ( ! rootCondition === ! newDocIdCondition ) {
8686 root += "/" ;
8787 }
88- // if pathname is undefined, meaning a docId/volume (e.g :primary:)
89- // has not been detected, so no newDocId's ":" will be added.
90- if ( ! pathname ) {
91- // Ensure proper path separator between root and newDocId
92- let separator = '' ;
93- if ( root . endsWith ( '/' ) && newDocId . startsWith ( '/' ) ) {
94- // Both have separator, strip one from newDocId
95- newDocId = newDocId . slice ( 1 ) ;
96- } else if ( ! root . endsWith ( '/' ) && ! newDocId . startsWith ( '/' ) ) {
97- // Neither has separator, add one
98- separator = '/' ;
99- }
100- return `${ contentUri . rootUri } ::${ root } ${ separator } ${ newDocId } ${ query } ` ;
101- }
10288 return `${ contentUri . rootUri } ::${ root } ${ newDocId } ${ query } ` ;
10389 }
90+
91+ // if pathname is undefined, meaning a docId/volume (e.g :primary:)
92+ // has not been detected, so no newDocId's ":" will be added.
93+ if ( ! pathname ) {
94+ // Ensure proper path separator between root and newDocId
95+ let separator = "" ;
96+ if ( root . endsWith ( "/" ) && newDocId . startsWith ( "/" ) ) {
97+ // Both have separator, strip one from newDocId
98+ newDocId = newDocId . slice ( 1 ) ;
99+ } else if ( ! root . endsWith ( "/" ) && ! newDocId . startsWith ( "/" ) ) {
100+ // Neither has separator, add one
101+ separator = "/" ;
102+ }
103+ return `${ contentUri . rootUri } ::${ root } ${ separator } ${ newDocId } ${ query } ` ;
104+ }
104105 return `${ contentUri . rootUri } ::${ root } :${ newDocId } ${ query } ` ;
105106 } catch ( error ) {
106107 return null ;
0 commit comments