@boon4681/giri 0.0.2-alpha-3 → 0.0.2-alpha-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1014,20 +1014,13 @@ function resolveAliasTarget(cwd, target, capture = "") {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
function matchAlias(request, key) {
|
|
1016
1016
|
if (key.includes("*")) {
|
|
1017
|
-
const [
|
|
1018
|
-
if (request.startsWith(
|
|
1019
|
-
return request.slice(
|
|
1017
|
+
const [prefix, suffix = ""] = key.split("*");
|
|
1018
|
+
if (request.startsWith(prefix) && request.endsWith(suffix)) {
|
|
1019
|
+
return request.slice(prefix.length, request.length - suffix.length);
|
|
1020
1020
|
}
|
|
1021
1021
|
return void 0;
|
|
1022
1022
|
}
|
|
1023
|
-
|
|
1024
|
-
return "";
|
|
1025
|
-
}
|
|
1026
|
-
const prefix = `${key}/`;
|
|
1027
|
-
if (request.startsWith(prefix)) {
|
|
1028
|
-
return request.slice(prefix.length);
|
|
1029
|
-
}
|
|
1030
|
-
return void 0;
|
|
1023
|
+
return request === key ? "" : void 0;
|
|
1031
1024
|
}
|
|
1032
1025
|
function resolveAliasRequest(request, alias, cwd) {
|
|
1033
1026
|
for (const [key, value] of Object.entries(alias ?? {})) {
|