@homer0/path-utils
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -22,2 +22,6 @@ "use strict"; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
@@ -42,3 +46,9 @@ mod | ||
constructor(options = {}) { | ||
/** | ||
* The root path from where the app is being executed. | ||
*/ | ||
__publicField(this, "path"); | ||
/** | ||
* The dictionary with the known locations in the project. | ||
*/ | ||
__publicField(this, "locations", {}); | ||
@@ -54,2 +64,9 @@ this.path = process.cwd(); | ||
} | ||
/** | ||
* Adds a new location. | ||
* | ||
* @param name The reference name. | ||
* @param location The path of the location. It must be inside the path from where | ||
* the app is being executed. | ||
*/ | ||
addLocation(name, location) { | ||
@@ -65,2 +82,8 @@ let locPath = location; | ||
} | ||
/** | ||
* Gets a location path by its name. | ||
* | ||
* @param name The location name. | ||
* @throws If there location is not registered. | ||
*/ | ||
getLocation(name) { | ||
@@ -73,5 +96,14 @@ const location = this.locations[name]; | ||
} | ||
/** | ||
* Gets the dictionary with the known locations. | ||
*/ | ||
getLocations() { | ||
return { ...this.locations }; | ||
} | ||
/** | ||
* Builds a path using a location path as base. | ||
* | ||
* @param location The location name. | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
joinFrom(location, ...paths) { | ||
@@ -81,11 +113,25 @@ const locationPath = this.getLocation(location); | ||
} | ||
/** | ||
* Alias to {@link PathUtils.joinFrom} that uses the `home` location by default. | ||
* | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
join(...paths) { | ||
return this.joinFrom("home", ...paths); | ||
} | ||
/** | ||
* Gets the project root path. | ||
*/ | ||
getHome() { | ||
return this.getLocation("home"); | ||
} | ||
/** | ||
* The path to the directory where the app executable is located. | ||
*/ | ||
getApp() { | ||
return this.getLocation("app"); | ||
} | ||
/** | ||
* The root path from where the app is being executed (`cwd`). | ||
*/ | ||
getPath() { | ||
@@ -92,0 +138,0 @@ return this.path; |
@@ -11,3 +11,9 @@ var __defProp = Object.defineProperty; | ||
constructor(options = {}) { | ||
/** | ||
* The root path from where the app is being executed. | ||
*/ | ||
__publicField(this, "path"); | ||
/** | ||
* The dictionary with the known locations in the project. | ||
*/ | ||
__publicField(this, "locations", {}); | ||
@@ -23,2 +29,9 @@ this.path = process.cwd(); | ||
} | ||
/** | ||
* Adds a new location. | ||
* | ||
* @param name The reference name. | ||
* @param location The path of the location. It must be inside the path from where | ||
* the app is being executed. | ||
*/ | ||
addLocation(name, location) { | ||
@@ -34,2 +47,8 @@ let locPath = location; | ||
} | ||
/** | ||
* Gets a location path by its name. | ||
* | ||
* @param name The location name. | ||
* @throws If there location is not registered. | ||
*/ | ||
getLocation(name) { | ||
@@ -42,5 +61,14 @@ const location = this.locations[name]; | ||
} | ||
/** | ||
* Gets the dictionary with the known locations. | ||
*/ | ||
getLocations() { | ||
return { ...this.locations }; | ||
} | ||
/** | ||
* Builds a path using a location path as base. | ||
* | ||
* @param location The location name. | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
joinFrom(location, ...paths) { | ||
@@ -50,11 +78,25 @@ const locationPath = this.getLocation(location); | ||
} | ||
/** | ||
* Alias to {@link PathUtils.joinFrom} that uses the `home` location by default. | ||
* | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
join(...paths) { | ||
return this.joinFrom("home", ...paths); | ||
} | ||
/** | ||
* Gets the project root path. | ||
*/ | ||
getHome() { | ||
return this.getLocation("home"); | ||
} | ||
/** | ||
* The path to the directory where the app executable is located. | ||
*/ | ||
getApp() { | ||
return this.getLocation("app"); | ||
} | ||
/** | ||
* The root path from where the app is being executed (`cwd`). | ||
*/ | ||
getPath() { | ||
@@ -61,0 +103,0 @@ return this.path; |
@@ -22,2 +22,6 @@ "use strict"; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
@@ -42,3 +46,9 @@ mod | ||
constructor(options = {}) { | ||
/** | ||
* The root path from where the app is being executed. | ||
*/ | ||
__publicField(this, "path"); | ||
/** | ||
* The dictionary with the known locations in the project. | ||
*/ | ||
__publicField(this, "locations", {}); | ||
@@ -54,2 +64,9 @@ this.path = process.cwd(); | ||
} | ||
/** | ||
* Adds a new location. | ||
* | ||
* @param name The reference name. | ||
* @param location The path of the location. It must be inside the path from where | ||
* the app is being executed. | ||
*/ | ||
addLocation(name, location) { | ||
@@ -65,2 +82,8 @@ let locPath = location; | ||
} | ||
/** | ||
* Gets a location path by its name. | ||
* | ||
* @param name The location name. | ||
* @throws If there location is not registered. | ||
*/ | ||
getLocation(name) { | ||
@@ -73,5 +96,14 @@ const location = this.locations[name]; | ||
} | ||
/** | ||
* Gets the dictionary with the known locations. | ||
*/ | ||
getLocations() { | ||
return { ...this.locations }; | ||
} | ||
/** | ||
* Builds a path using a location path as base. | ||
* | ||
* @param location The location name. | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
joinFrom(location, ...paths) { | ||
@@ -81,11 +113,25 @@ const locationPath = this.getLocation(location); | ||
} | ||
/** | ||
* Alias to {@link PathUtils.joinFrom} that uses the `home` location by default. | ||
* | ||
* @param paths The rest of the path components to join. | ||
*/ | ||
join(...paths) { | ||
return this.joinFrom("home", ...paths); | ||
} | ||
/** | ||
* Gets the project root path. | ||
*/ | ||
getHome() { | ||
return this.getLocation("home"); | ||
} | ||
/** | ||
* The path to the directory where the app executable is located. | ||
*/ | ||
getApp() { | ||
return this.getLocation("app"); | ||
} | ||
/** | ||
* The root path from where the app is being executed (`cwd`). | ||
*/ | ||
getPath() { | ||
@@ -92,0 +138,0 @@ return this.path; |
{ | ||
"name": "@homer0/path-utils", | ||
"description": "A utility service to manage paths on a project", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"repository": { | ||
@@ -26,9 +26,9 @@ "type": "git", | ||
"dependencies": { | ||
"@homer0/jimple": "^2.0.1" | ||
"@homer0/jimple": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"jest": "^29.4.1", | ||
"jest": "^29.4.3", | ||
"ts-jest": "^29.0.5", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.4" | ||
"tsup": "^6.6.3", | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -49,3 +49,3 @@ "engine-strict": true, | ||
}, | ||
"gitHead": "59c0f6af6901b9f4edb8d2ec36abaf11f6b0780d" | ||
"gitHead": "1ed6ea29e2035f10f0dff60203b6b1d54c601dc8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34868
500
Updated@homer0/jimple@^2.0.2