UNPKG

wallee

Version:
40 lines (39 loc) 1.7 kB
import { FeatureFromJSON, } from './Feature'; import { LabelDescriptorCategoryFromJSON, LabelDescriptorCategoryToJSON, } from './LabelDescriptorCategory'; import { LabelDescriptorGroupFromJSON, LabelDescriptorGroupToJSON, } from './LabelDescriptorGroup'; /** * Check if a given object implements the LabelDescriptor interface. */ export function instanceOfLabelDescriptor(value) { return true; } export function LabelDescriptorFromJSON(json) { return LabelDescriptorFromJSONTyped(json, false); } export function LabelDescriptorFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'features': json['features'] == null ? undefined : (new Set(json['features'].map(FeatureFromJSON))), 'name': json['name'] == null ? undefined : json['name'], 'description': json['description'] == null ? undefined : json['description'], 'weight': json['weight'] == null ? undefined : json['weight'], 'id': json['id'] == null ? undefined : json['id'], 'category': json['category'] == null ? undefined : LabelDescriptorCategoryFromJSON(json['category']), 'type': json['type'] == null ? undefined : json['type'], 'group': json['group'] == null ? undefined : LabelDescriptorGroupFromJSON(json['group']), }; } export function LabelDescriptorToJSON(json) { return LabelDescriptorToJSONTyped(json, false); } export function LabelDescriptorToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'category': LabelDescriptorCategoryToJSON(value['category']), 'group': LabelDescriptorGroupToJSON(value['group']), }; }