@saptools/cf-hana 0.4.0 → 0.4.1
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 +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1740,7 +1740,7 @@ function normalizeSapCfApiEndpoint(apiEndpoint) {
|
|
|
1740
1740
|
if (/^https:\/\/[^/]*:\d+(?:[/?#]|$)/i.test(trimmed)) {
|
|
1741
1741
|
throw new Error(`Invalid or untrusted CF API endpoint "${apiEndpoint}".`);
|
|
1742
1742
|
}
|
|
1743
|
-
if (parsed.protocol !== "https:" || parsed.username !== "" || parsed.password !== "" || parsed.port !== "" || parsed.pathname.replace(
|
|
1743
|
+
if (parsed.protocol !== "https:" || parsed.username !== "" || parsed.password !== "" || parsed.port !== "" || parsed.pathname.replace(/(?<!\/)\/+$/, "") !== "" || parsed.search !== "" || parsed.hash !== "") {
|
|
1744
1744
|
throw new Error(`Invalid or untrusted CF API endpoint "${apiEndpoint}".`);
|
|
1745
1745
|
}
|
|
1746
1746
|
const hostname = parsed.hostname.toLowerCase();
|
|
@@ -2931,12 +2931,12 @@ function trailingLineCommentIndex(sql) {
|
|
|
2931
2931
|
return void 0;
|
|
2932
2932
|
}
|
|
2933
2933
|
function appendLimit(sql, limit) {
|
|
2934
|
-
const trimmed = sql.replace(/[\s;]+$/, "");
|
|
2934
|
+
const trimmed = sql.replace(/(?<![\s;])[\s;]+$/, "");
|
|
2935
2935
|
const commentIndex = trailingLineCommentIndex(trimmed);
|
|
2936
2936
|
if (commentIndex === void 0) {
|
|
2937
2937
|
return `${trimmed} LIMIT ${String(limit)}`;
|
|
2938
2938
|
}
|
|
2939
|
-
const beforeComment = trimmed.slice(0, commentIndex).replace(/[\s;]+$/, "");
|
|
2939
|
+
const beforeComment = trimmed.slice(0, commentIndex).replace(/(?<![\s;])[\s;]+$/, "");
|
|
2940
2940
|
const comment = trimmed.slice(commentIndex);
|
|
2941
2941
|
return `${beforeComment} LIMIT ${String(limit)} ${comment}`;
|
|
2942
2942
|
}
|