@loaders.gl/textures
Version:
Framework-independent loaders for compressed and super compressed (basis) textures
15 lines (12 loc) • 423 B
text/typescript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import type {GetUrl, UrlOptions} from './texture-api-types';
// Generate a member url by calling getUrl with merged options.
export function generateUrl(
getUrl: string | GetUrl,
options: UrlOptions,
urlOptions: Record<string, any>
): string {
return typeof getUrl === 'function' ? getUrl({...options, ...urlOptions}) : getUrl;
}