mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 18:31:38 +01:00
Filesystem Sync (#142)
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import type {AnyModel, GrpcRequest, HttpRequest} from '@yaakapp-internal/models';
|
||||
import type { AnyModel, GrpcRequest, HttpRequest } from '@yaakapp-internal/models';
|
||||
|
||||
export function fallbackRequestName(r: HttpRequest | GrpcRequest | AnyModel | null): string {
|
||||
if (r == null) return '';
|
||||
|
||||
if (r.model !== 'grpc_request' && r.model !== 'http_request') {
|
||||
return 'name' in r ? r.name : '';
|
||||
}
|
||||
|
||||
// Return name if it has one
|
||||
if ('name' in r && r.name) {
|
||||
return r.name;
|
||||
}
|
||||
|
||||
if (r.model !== 'http_request' && r.model !== 'grpc_request') {
|
||||
return 'No Name';
|
||||
}
|
||||
|
||||
// Replace variable syntax with variable name
|
||||
const withoutVariables = r.url.replace(/\$\{\[\s*([^\]\s]+)\s*]}/g, '$1');
|
||||
if (withoutVariables.trim() === '') {
|
||||
|
||||
Reference in New Issue
Block a user