Simplify code

This commit is contained in:
Jan Oberhauser 2021-10-07 17:12:06 -05:00
parent 29887c11c1
commit 3a49730675
2 changed files with 10 additions and 7 deletions

View file

@ -293,11 +293,14 @@ export const split = (subject: string): string[] =>
.map(s => s.replace(/\\([\s\S])/gm, ($0, $1) => $1)) .map(s => s.replace(/\\([\s\S])/gm, ($0, $1) => $1))
; ;
const userBaseUri = (str?: string) => { const userBaseUri = (uri?: string) => {
if (str === undefined) { if (uri === undefined) {
return str; return uri;
} }
let end = str.length;
for (; end > 0 && str[end - 1] === '/'; --end) {} if (uri.endsWith('/')) {
return end < str.length ? str.substring(0, end) : str; return uri.slice(0, -1);
}
return uri;
}; };

View file

@ -95,7 +95,7 @@ export interface IRowResponse{
metadata: [ metadata: [
{ {
key: string, key: string,
name: string name: string,
} }
]; ];
results: IRow[]; results: IRow[];