Skip to content

Commit

Permalink
Fixed typo in STAC_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Feb 12, 2021
1 parent 256ba49 commit 2bcff85
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/migrate.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/* Methods that transform STAC object JSON from older versions to
allow for a more consistent usage in other parts of the codebase */
import { STAC_VERSION } from './config';
import { STAC_VERSION } from "./config";

export const transformCatalog = (entity) => {
if(!entity) { return entity; }
export const transformCatalog = entity => {
if (!entity) {
return entity;
}

const stacVersion = entity.stac_version || STAC_VERISON;
// Account for the item-assets extension renaming the property used
// in collections from 'assets' to 'item-assets' for STAC 1.0
if(entity.assets) {
if(stacVersion < "1.0") {
entity.item_assets = entity.assets;
delete entity.assets;
}
const stacVersion = entity.stac_version || STAC_VERSION;
// Account for the item-assets extension renaming the property used
// in collections from 'assets' to 'item-assets' for STAC 1.0
if (entity.assets) {
if (stacVersion < "1.0") {
entity.item_assets = entity.assets;
delete entity.assets;
}
return entity;
}
return entity;
};

export const transformItem = (entity) => {
return entity;
};
export const transformItem = entity => {
return entity;
};

0 comments on commit 2bcff85

Please sign in to comment.