The served profile.json does NOT inline a layers array — layers live in a
separate file referenced by profile.Files.layersFile (layers.json, shaped
{ layers: [{ id, configFile, layerManagerId }] }). This helper returns
profile.layers when already present (forward-compat with an inlined array),
otherwise fetches the referenced file. It never throws: any failure resolves
to an empty array.
Callers pass their own profilesBasePath and leadingSlash/validateUrl so
the URL is built with the exact convention their other fetches use (the
display path uses a leading slash + base "profiles"; the download path uses a
relative base "../profiles" guarded by validateFetchUrl).
Resolves the layer list of a profile.
The served
profile.jsondoes NOT inline alayersarray — layers live in a separate file referenced byprofile.Files.layersFile(layers.json, shaped{ layers: [{ id, configFile, layerManagerId }] }). This helper returnsprofile.layerswhen already present (forward-compat with an inlined array), otherwise fetches the referenced file. It never throws: any failure resolves to an empty array.Callers pass their own
profilesBasePathandleadingSlash/validateUrlso the URL is built with the exact convention their other fetches use (the display path uses a leading slash + base "profiles"; the download path uses a relative base "../profiles" guarded byvalidateFetchUrl).