Starting to implement a proper library for OSM tags
This commit is contained in:
parent
a4e975dbeb
commit
3f56cf9c23
|
@ -0,0 +1,11 @@
|
|||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { getTagStatus } from './tags';
|
||||
|
||||
describe('The getTagStatus function', () => {
|
||||
it('should return false/false for a tag that does NOT exist', () => {
|
||||
expect(getTagStatus('whatever', {}, '', '')).toEqual({
|
||||
selected: false,
|
||||
highlighted: false,
|
||||
});
|
||||
});
|
||||
});
|
|
@ -0,0 +1,31 @@
|
|||
interface TagStatus {
|
||||
selected: boolean;
|
||||
highlighted: boolean;
|
||||
}
|
||||
|
||||
interface TagFormatDefinition {}
|
||||
|
||||
interface TagCategoryDefinitions {
|
||||
[key: string]: TagFormatDefinition;
|
||||
}
|
||||
|
||||
interface TagActivityDefinitions {
|
||||
[key: string]: TagCategoryDefinitions;
|
||||
}
|
||||
|
||||
interface TagDefinitions {
|
||||
[key: string]: TagActivityDefinitions;
|
||||
}
|
||||
|
||||
export const getTagStatus = (
|
||||
tag: string,
|
||||
definitions: TagDefinitions,
|
||||
selectedKey: string,
|
||||
highlightedKey: string
|
||||
) => {
|
||||
let status: TagStatus = {
|
||||
selected: false,
|
||||
highlighted: false,
|
||||
};
|
||||
return status;
|
||||
};
|
Loading…
Reference in New Issue