diff --git a/lib/types/application/ApplicationFormatter.js b/lib/types/application/ApplicationFormatter.js index 803f60997..39c81c4d7 100644 --- a/lib/types/application/ApplicationFormatter.js +++ b/lib/types/application/ApplicationFormatter.js @@ -3,7 +3,6 @@ const path = require("path"); const fs = require("graceful-fs"); const {promisify} = require("util"); const readFile = promisify(fs.readFile); -const slash = require("slash"); const AbstractUi5Formatter = require("../AbstractUi5Formatter"); class ApplicationFormatter extends AbstractUi5Formatter { @@ -44,7 +43,7 @@ class ApplicationFormatter extends AbstractUi5Formatter { let p = path; let projectPath = this._project.path; if (posix) { - projectPath = slash(projectPath); + projectPath = projectPath.replace(/\\/g, "/"); p = path.posix; } return p.join(projectPath, this._project.resources.pathMappings["/"]); diff --git a/lib/types/library/LibraryFormatter.js b/lib/types/library/LibraryFormatter.js index d593bcaca..d23b8c86b 100644 --- a/lib/types/library/LibraryFormatter.js +++ b/lib/types/library/LibraryFormatter.js @@ -4,7 +4,6 @@ const fs = require("graceful-fs"); const {promisify} = require("util"); const readFile = promisify(fs.readFile); const glob = require("globby"); -const slash = require("slash"); const AbstractUi5Formatter = require("../AbstractUi5Formatter"); const SAP_THEMES_NS_EXEMPTIONS = ["themelib_sap_fiori_3", "themelib_sap_bluecrystal", "themelib_sap_belize"]; @@ -67,7 +66,7 @@ class LibraryFormatter extends AbstractUi5Formatter { let p = path; let projectPath = this._project.path; if (posix) { - projectPath = slash(projectPath); + projectPath = projectPath.replace(/\\/g, "/"); p = path.posix; } return p.join(projectPath, this._project.resources.pathMappings["/resources/"]); @@ -247,7 +246,7 @@ class LibraryFormatter extends AbstractUi5Formatter { getNamespaceFromFsPath(fsPath) { // Transform path to POSIX and remove any trailing slashes - const posixFsPath = slash(fsPath).replace(/\/$/, ""); + const posixFsPath = fsPath.replace(/\\/g, "/").replace(/\/$/, ""); // Remove base path from fsPath const posixBasePath = this.getSourceBasePath(true); diff --git a/package.json b/package.json index 35dbcb634..15e19b0fa 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,6 @@ "replacestream": "^4.0.3", "rimraf": "^3.0.2", "semver": "^7.3.4", - "slash": "^3.0.0", "terser": "^5.5.1", "xml2js": "^0.4.23", "yazl": "^2.5.1"