@opra/common
Version:
Opra common package
36 lines (35 loc) • 1.01 kB
JavaScript
import { __decorate, __metadata } from "tslib";
import { vg } from 'valgen';
import { DECODER, ENCODER } from '../../constants.js';
import { SimpleType } from '../simple-type.js';
let UuidType = class UuidType {
constructor(attributes) {
if (attributes)
Object.assign(this, attributes);
}
version;
[DECODER](properties) {
return vg.isUUID(properties?.version, { coerce: true });
}
[ENCODER](properties) {
return vg.isUUID(properties?.version, { coerce: true });
}
};
__decorate([
SimpleType.Attribute({
description: 'Version of the UUID',
}),
__metadata("design:type", Number)
], UuidType.prototype, "version", void 0);
UuidType = __decorate([
SimpleType({
name: 'uuid',
description: 'A Universal Unique Identifier (UUID) value',
nameMappings: {
js: 'string',
json: 'string',
},
}),
__metadata("design:paramtypes", [Object])
], UuidType);
export { UuidType };