Files
dspace-angular/src/app/core/cache/it-to-uuid-serializer.ts
2018-05-29 15:03:40 +02:00

20 lines
391 B
TypeScript

import { hasValue } from '../../shared/empty.util';
export class IDToUUIDSerializer {
constructor(private prefix: string) {
}
Serialize(uuid: string): any {
return undefined; // ui-only uuid doesn't need to be sent back to the server
}
Deserialize(id: string): string {
if (hasValue(id)) {
return `${this.prefix}-${id}`;
} else {
return id;
}
}
}