Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

33 lines
631 B

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
export class Version {
constructor(
public readonly value: string
) {
}
public eq(other: Version) {
return other && other.trimmed() === this.trimmed();
}
private trimmed(): string {
if (this.value.startsWith('W/')) {
return this.value.substr(2);
} else {
return this.value;
}
}
}
export class Versioned<T> {
constructor(
public readonly version: Version,
public readonly payload: T
) {
}
}