@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/index.js
CHANGED
|
@@ -1105,7 +1105,7 @@ function normalizeSapCfApiEndpoint(apiEndpoint) {
|
|
|
1105
1105
|
if (/^https:\/\/[^/]*:\d+(?:[/?#]|$)/i.test(trimmed)) {
|
|
1106
1106
|
throw new Error(`Invalid or untrusted CF API endpoint "${apiEndpoint}".`);
|
|
1107
1107
|
}
|
|
1108
|
-
if (parsed.protocol !== "https:" || parsed.username !== "" || parsed.password !== "" || parsed.port !== "" || parsed.pathname.replace(
|
|
1108
|
+
if (parsed.protocol !== "https:" || parsed.username !== "" || parsed.password !== "" || parsed.port !== "" || parsed.pathname.replace(/(?<!\/)\/+$/, "") !== "" || parsed.search !== "" || parsed.hash !== "") {
|
|
1109
1109
|
throw new Error(`Invalid or untrusted CF API endpoint "${apiEndpoint}".`);
|
|
1110
1110
|
}
|
|
1111
1111
|
const hostname = parsed.hostname.toLowerCase();
|
|
@@ -2296,12 +2296,12 @@ function trailingLineCommentIndex(sql) {
|
|
|
2296
2296
|
return void 0;
|
|
2297
2297
|
}
|
|
2298
2298
|
function appendLimit(sql, limit) {
|
|
2299
|
-
const trimmed = sql.replace(/[\s;]+$/, "");
|
|
2299
|
+
const trimmed = sql.replace(/(?<![\s;])[\s;]+$/, "");
|
|
2300
2300
|
const commentIndex = trailingLineCommentIndex(trimmed);
|
|
2301
2301
|
if (commentIndex === void 0) {
|
|
2302
2302
|
return `${trimmed} LIMIT ${String(limit)}`;
|
|
2303
2303
|
}
|
|
2304
|
-
const beforeComment = trimmed.slice(0, commentIndex).replace(/[\s;]+$/, "");
|
|
2304
|
+
const beforeComment = trimmed.slice(0, commentIndex).replace(/(?<![\s;])[\s;]+$/, "");
|
|
2305
2305
|
const comment = trimmed.slice(commentIndex);
|
|
2306
2306
|
return `${beforeComment} LIMIT ${String(limit)} ${comment}`;
|
|
2307
2307
|
}
|