* Encode the individual directories and filenames in a path without encoding the slashes.
( path )
| 1177 | * Encode the individual directories and filenames in a path without encoding the slashes. |
| 1178 | */ |
| 1179 | function encodePathParts( path ) { |
| 1180 | let pathAndTime = path.split( '#t=' ); |
| 1181 | let pathParts = pathAndTime[0].split( '/' ); |
| 1182 | pathParts.forEach( function ( value, idx ) { |
| 1183 | pathParts[ idx ] = encodeURIComponent( value ); |
| 1184 | } ); |
| 1185 | |
| 1186 | let returnValue = pathParts.join( '/' ); |
| 1187 | |
| 1188 | // If there was a timestamp, add it back in. |
| 1189 | if ( pathAndTime[1] ) { |
| 1190 | returnValue += '#t=' + pathAndTime[1]; |
| 1191 | } |
| 1192 | |
| 1193 | console.log( path + " encoded is " + returnValue ); |
| 1194 | |
| 1195 | return returnValue; |
| 1196 | } |
| 1197 | |
| 1198 | /** |
| 1199 | * Decode the individual directories and filenames in a path without encoding the slashes. |
no outgoing calls
no test coverage detected