@scalar/api-client
Version:
the open source API testing client
19 lines • 835 B
TypeScript
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
/**
* Generates a unique string ID for an API location, based on the document, path, method, and example.
* Filters out undefined values and serializes the composite array into a stable string.
*
* @param params - An object containing document, path, method, and optional example name.
* @returns A stringified array representing the unique location identifier.
*
* Example:
* generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })
* // => '["mydoc","/users","get","default"]'
*/
export declare const generateLocationId: ({ document, path, method, example, }: {
document: string;
path?: string;
method?: HttpMethod;
example?: string;
}) => string;
//# sourceMappingURL=generate-location-id.d.ts.map