mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
⚡ Simplify code
This commit is contained in:
parent
29887c11c1
commit
3a49730675
|
@ -293,11 +293,14 @@ export const split = (subject: string): string[] =>
|
|||
.map(s => s.replace(/\\([\s\S])/gm, ($0, $1) => $1))
|
||||
;
|
||||
|
||||
const userBaseUri = (str?: string) => {
|
||||
if (str === undefined) {
|
||||
return str;
|
||||
const userBaseUri = (uri?: string) => {
|
||||
if (uri === undefined) {
|
||||
return uri;
|
||||
}
|
||||
let end = str.length;
|
||||
for (; end > 0 && str[end - 1] === '/'; --end) {}
|
||||
return end < str.length ? str.substring(0, end) : str;
|
||||
|
||||
if (uri.endsWith('/')) {
|
||||
return uri.slice(0, -1);
|
||||
}
|
||||
|
||||
return uri;
|
||||
};
|
||||
|
|
|
@ -95,7 +95,7 @@ export interface IRowResponse{
|
|||
metadata: [
|
||||
{
|
||||
key: string,
|
||||
name: string
|
||||
name: string,
|
||||
}
|
||||
];
|
||||
results: IRow[];
|
||||
|
|
Loading…
Reference in a new issue