wikizimmer.js sanitizeFN Windows

This commit is contained in:
vss-devel 2019-03-13 15:27:42 +03:00
parent 15dc79a822
commit c741b0e79e

View File

@ -72,8 +72,11 @@ let http // http request
let sanitizeRE = /(?:[\x00-\x1F<>:"~\\\?\*]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f])|(?:[. ]$))+/g let sanitizeRE = /(?:[\x00-\x1F<>:"~\\\?\*]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f])|(?:[. ]$))+/g
function sanitizeFN ( name ) { // after https://github.com/pillarjs/encodeurl function sanitizeFN ( name ) { // after https://github.com/pillarjs/encodeurl
return String( name ).replace( sanitizeRE, encodeURIComponent ).replace( /%/g, '~' ) if ( os.type() == 'Windows_NT' ) {
//~ return sanitizeFilename( name, { replacement: '.' }) return String( name ).replace( sanitizeRE, encodeURIComponent ).replace( /%/g, '~' )
} else {
return name
}
} }
function elapsedStr( from , to = Date.now()) { function elapsedStr( from , to = Date.now()) {