@itwin/imodels-client-management
Version:
iModels API client wrapper for applications that manage iModels.
21 lines • 770 B
JavaScript
export async function getUser(authorization, userOperations, urlFormatter, userLink, headers) {
if (!userLink)
return undefined;
const { iModelId, userId } = urlFormatter.parseUserUrl(userLink);
return userOperations.getSingle({
authorization,
iModelId,
userId,
headers,
});
}
export function assertStringHeaderValue(headerName, headerValue) {
const isString = typeof headerValue === "string" || headerValue instanceof String;
if (!isString)
throw new Error(`Assertion failed: header's ${headerName} value is not a string.`);
}
export function assertLink(link) {
if (!link || !link.href)
throw new Error("Assertion failed: link is falsy.");
}
//# sourceMappingURL=SharedFunctions.js.map