Fix:Check if Windows before cleaning file path for POSIX separators #1254

This commit is contained in:
advplyr 2023-01-05 17:45:27 -06:00
parent f76f9c7f84
commit 9a85ad1f6b
19 changed files with 66 additions and 54 deletions

View file

@ -1,5 +1,4 @@
const Path = require('path')
const fs = require('fs')
const Logger = require('../Logger')
const { parseString } = require("xml2js")
const areEquivalent = require('./areEquivalent')
@ -125,10 +124,6 @@ module.exports.copyValue = (val) => {
}
}
module.exports.encodeUriPath = (path) => {
return path.replace(/\\/g, '/').replace(/%/g, '%25').replace(/#/g, '%23')
}
module.exports.toNumber = (val, fallback = 0) => {
if (isNaN(val) || val === null) return fallback
return Number(val)