Skip to content

Commit

Permalink
style: apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasLohoff committed May 22, 2024
1 parent 5a3ede9 commit a661ba2
Show file tree
Hide file tree
Showing 8 changed files with 1,903 additions and 1,552 deletions.
832 changes: 458 additions & 374 deletions fixtures/ogc-api/sample-data/styles/Light/metadata.json

Large diffs are not rendered by default.

832 changes: 458 additions & 374 deletions fixtures/ogc-api/sample-data/styles/Night/metadata.json

Large diffs are not rendered by default.

897 changes: 493 additions & 404 deletions fixtures/ogc-api/sample-data/styles/Outdoor/metadata.json

Large diffs are not rendered by default.

817 changes: 453 additions & 364 deletions fixtures/ogc-api/sample-data/styles/OutdoorHillshade/metadata.json

Large diffs are not rendered by default.

57 changes: 31 additions & 26 deletions fixtures/ogc-api/sample-data/styles/Tritanopia/metadata.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{
"title" : "Tritanopia",
"links" : [ {
"rel" : "self",
"type" : "application/json",
"title" : "This document",
"href" : "https://local/zoomstack/styles/Tritanopia/metadata?f=json"
}, {
"rel" : "alternate",
"type" : "text/html",
"title" : "This document as HTML",
"href" : "https://local/zoomstack/styles/Tritanopia/metadata?f=html"
} ],
"id" : "Tritanopia",
"scope" : "style",
"stylesheets" : [ {
"title" : "ArcGIS",
"version" : "n/a",
"specification" : "https://www.esri.com/",
"native" : true,
"link" : {
"rel" : "stylesheet",
"type" : "application/vnd.esri.lyr",
"title" : "Style in format 'ArcGIS'",
"href" : "https://local/zoomstack/styles/Tritanopia?f=lyr"
"title": "Tritanopia",
"links": [
{
"rel": "self",
"type": "application/json",
"title": "This document",
"href": "https://local/zoomstack/styles/Tritanopia/metadata?f=json"
},
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "https://local/zoomstack/styles/Tritanopia/metadata?f=html"
}
} ]
}
],
"id": "Tritanopia",
"scope": "style",
"stylesheets": [
{
"title": "ArcGIS",
"version": "n/a",
"specification": "https://www.esri.com/",
"native": true,
"link": {
"rel": "stylesheet",
"type": "application/vnd.esri.lyr",
"title": "Style in format 'ArcGIS'",
"href": "https://local/zoomstack/styles/Tritanopia?f=lyr"
}
}
]
}
8 changes: 2 additions & 6 deletions src/ogc-api/endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,9 +1992,7 @@ The document at http://local/nonexisting?f=json could not be fetched.`
{
title: 'OS Open Zoomstack - Outdoor with Hillshade',
id: 'OutdoorHillshade',
formats: [
'application/vnd.mapbox.style+json'
],
formats: ['application/vnd.mapbox.style+json'],
},
{
title: 'OS Open Zoomstack - Road',
Expand All @@ -2014,9 +2012,7 @@ The document at http://local/nonexisting?f=json could not be fetched.`
});
describe('#getStyleMetadata', () => {
it('returns style metadata', async () => {
await expect(
endpoint.getStyle('Deuteranopia')
).resolves.toEqual({
await expect(endpoint.getStyle('Deuteranopia')).resolves.toEqual({
title: 'Deuteranopia',
id: 'Deuteranopia',
scope: 'style',
Expand Down
10 changes: 7 additions & 3 deletions src/ogc-api/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,13 @@ ${e.message}`);
*/
get allStyles(): Promise<StyleItem[]> {
return this.styles.then(async (stylesDoc) => {
const metadataPromises = stylesDoc.styles.map(style => this.getStyleMetadataDocument(style.id));
return Promise.all(metadataPromises).then(results => {
return results.map(r => parseStyleMetadataAsList(r as OgcApiStyleMetadata));
const metadataPromises = stylesDoc.styles.map((style) =>
this.getStyleMetadataDocument(style.id)
);
return Promise.all(metadataPromises).then((results) => {
return results.map((r) =>
parseStyleMetadataAsList(r as OgcApiStyleMetadata)
);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/ogc-api/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export function parseStyleMetadataAsList(doc: OgcApiStyleMetadata): StyleItem {
return {
id,
title,
formats: stylesheetFormats
formats: stylesheetFormats,
} as StyleItem;
}

Expand Down

0 comments on commit a661ba2

Please sign in to comment.