MCPcopy Create free account
hub / github.com/cfinke/Channel-Two / decodePathParts

Function decodePathParts

channel-two.js:1201–1216  ·  view source on GitHub ↗

* Decode the individual directories and filenames in a path without encoding the slashes.

( path )

Source from the content-addressed store, hash-verified

1199 * Decode the individual directories and filenames in a path without encoding the slashes.
1200 */
1201 function decodePathParts( path ) {
1202 let pathAndTime = path.split( '#t=' );
1203 let pathParts = pathAndTime[0].split( '/' );
1204 pathParts.forEach( function ( value, idx ) {
1205 pathParts[ idx ] = decodeURIComponent( value );
1206 } );
1207
1208 let returnValue = pathParts.join( '/' );
1209
1210 // If there was a timestamp, add it back in.
1211 if ( pathAndTime[1] ) {
1212 returnValue += '#t=' + pathAndTime[1];
1213 }
1214
1215 return returnValue;
1216 }
1217
1218 // Add key bindings so you can use arrow keys to advance the current programming point.
1219

Callers 2

channel-two.jsFile · 0.85
adBreakFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected