mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 06:53:03 +00:00
20 lines
391 B
TypeScript
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;
|
|
}
|
|
|
|
}
|
|
}
|